Annotation of xmlschema/xsv.msxsl, revision 1.3
1.1 ht 1: <?xml version='1.0'?>
2: <xsl:stylesheet result-ns="" indent-result="yes" xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns="http://www.w3.org/TR/REC-html40" xmlns:xsv="http://www.w3.org/2000/05/xsv">
1.3 ! ht 3: <!-- $Id: xsv.msxsl,v 1.2 2000/05/18 17:38:21 ht Exp $ -->
1.2 ht 4: <!-- Stylesheet for XSV output: this version for IE5 as released -->
1.1 ht 5: <!-- Hacks to compensate for broken MS implementation -->
6: <xsl:template match="*">
7: <xsl:apply-templates/>
8: </xsl:template>
9: <xsl:template match="textnode()">
10: <xsl:value-of/>
11: </xsl:template>
12:
13: <!-- The real stylesheet starts here -->
14: <xsl:template match="/">
15: <HTML>
16: <HEAD>
17: <TITLE>
18: Schema validation report for
19: <xsl:value-of select="xsv:xsv/@target"/>
20: </TITLE>
21: </HEAD>
22: <BODY>
23: <xsl:apply-templates/>
24: </BODY>
25: </HTML>
26: </xsl:template>
27:
28: <xsl:template match="xsv:xsv">
1.2 ht 29: <H3>Schema validating with <xsl:value-of select="@version"/></H3>
1.1 ht 30: <UL>
31: <xsl:apply-templates select="@target"/>
32: <xsl:apply-templates select="@docElt"/>
33: <xsl:apply-templates select="@validation"/>
34: <xsl:apply-templates select="@schemaLocs"/>
35: <xsl:apply-templates select="@schemaDocs"/>
36: <xsl:apply-templates select="@schemaErrors"/>
37: <xsl:apply-templates select="@instanceAssessed"/>
38: <xsl:apply-templates select="@instanceErrors"/>
39: </UL>
40: <HR/>
1.2 ht 41: <xsl:apply-templates select="xsv:XMLMessages"/>
1.3 ! ht 42: <xsl:if test="xsv:importAttempt|xsv:includeAttempt">
! 43: <H3>Schema resources involved</H3>
! 44: <xsl:apply-templates select="xsv:importAttempt|xsv:includeAttempt"/>
! 45: <HR/>
! 46: </xsl:if>
1.2 ht 47: <xsl:if test="xsv:schemaError">
48: <H3>Schema representation errors</H3>
49: <xsl:apply-templates select="xsv:schemaError"/>
50: </xsl:if>
51: <xsl:if test="xsv:invalid|xsv:warning">
52: <H3>Problems with the schema-validity of the target</H3>
53: <xsl:apply-templates select="xsv:invalid|xsv:warning"/>
54: </xsl:if>
1.1 ht 55: </xsl:template>
56:
57: <xsl:template match="@*">
58: <LI>
59: <STRONG><xsl:eval>this.nodeName</xsl:eval></STRONG>: <xsl:value-of select="."/></LI>
60: </xsl:template>
1.2 ht 61:
62: <xsl:template match="@target|@schemaDocs|@docElt">
63: <LI>
64: <STRONG><xsl:eval>this.nodeName</xsl:eval></STRONG>: <CODE><xsl:value-of select="."/></CODE></LI>
65: </xsl:template>
66:
67: <xsl:template match="@schemaErrors">
68: <LI>The schema(s) used for schema-validation had <xsl:value-of select="."/> errors</LI>
69: </xsl:template>
70:
71: <xsl:template match="@schemaErrors[.=0]">
72: <LI>The schema(s) used for schema-validation had no errors</LI>
73: </xsl:template>
1.1 ht 74:
1.2 ht 75: <xsl:template match="@schemaErrors[.=-1]">
76: <LI>The schema(s) used for schema-validation had fatal errors</LI>
77: </xsl:template>
78:
79: <xsl:template match="@schemaErrors[.=1]">
80: <LI>The schema(s) used for schema-validation had 1 error</LI>
1.1 ht 81: </xsl:template>
82:
83: <xsl:template match="@instanceErrors">
1.2 ht 84: <LI><xsl:value-of select="."/> schema-validity problems were found in the target</LI>
85: </xsl:template>
86: <xsl:template match="@instanceErrors[.=0]">
87: <LI>No schema-validity problems were found in the target</LI>
88:
89: </xsl:template><xsl:template match="@instanceErrors[.=1]">
90: <LI>One schema-validity problem was found in the target</LI>
1.1 ht 91: </xsl:template>
92:
1.2 ht 93: <xsl:template match="@validation[.='lax']">
94: <LI>No declaration for document root found, validation was lax</LI>
95: </xsl:template>
96:
97: <xsl:template match="@validation[.='strict']">
98: <LI>Validation was strict, starting with type <CODE><xsl:value-of select="../@rootType"/></CODE></LI>
99: </xsl:template>
100:
101: <xsl:template match="xsv:XMLMessages">
102: <H3>Low-level XML well-formedness and/or validity processing output</H3>
103: <P>
104: <PRE><xsl:apply-templates/></PRE>
105: </P>
1.1 ht 106: <HR/>
1.3 ! ht 107: </xsl:template>
! 108:
! 109: <xsl:template match="xsv:importAttempt">
! 110: <P>Attempt to import a schema document from <CODE>
! 111: <xsl:value-of select="@URI"/></CODE> for
! 112: <xsl:choose><xsl:when test="@namespace"><CODE><xsl:value-of select="@namespace"/></CODE></xsl:when>
! 113: <xsl:otherwise>no namespace</xsl:otherwise>,
! 114: </xsl:choose>
! 115: <xsl:choose>
! 116: <xsl:when test=".[@outcome='success']"> succeeded</xsl:when>
! 117: <xsl:when test=".[@outcome='redundant']"> skipped, already loaded</xsl:when>
! 118: <xsl:when test=".[@outcome='skipped']"> skipped, other docs already loaded for
! 119: this namespace: <xsl:value-of select="@otherLocs"/></xsl:when>
! 120: <xsl:when test=".[@outcome='failure']"> failed</xsl:when>
! 121: </xsl:choose>
! 122: </P>
! 123: </xsl:template>
! 124:
! 125: <xsl:template match="xsv:includeAttempt">
! 126: <P>Attempt to include a schema document from <CODE>
! 127: <xsl:value-of select="@URI"/></CODE> for
! 128: <xsl:choose><xsl:when test="@namespace"><CODE><xsl:value-of select="@namespace"/></CODE></xsl:when>
! 129: <xsl:otherwise>no namespace</xsl:otherwise>,
! 130: </xsl:choose>
! 131: <xsl:choose>
! 132: <xsl:when test=".[@outcome='success']"> succeeded</xsl:when>
! 133: <xsl:when test=".[@outcome='redundant']"> skipped, already loaded</xsl:when>
! 134: <xsl:when test=".[@outcome='skipped']"> skipped, other docs already loaded for
! 135: this namespace: <xsl:value-of select="@otherLocs"/></xsl:when>
! 136: <xsl:when test=".[@outcome='failure']"> failed</xsl:when>
! 137: </xsl:choose>
! 138: </P>
1.1 ht 139: </xsl:template>
140:
141: <xsl:template match="xsv:invalid">
142: <P><SPAN STYLE="color: red"><xsl:value-of select="@resource"/>:<xsl:value-of select="@line"/>:<xsl:value-of select="@char"/></SPAN>: <SPAN STYLE="color: blue">Invalid<xsl:if test="@code"> <xsl:value-of select="@code"/></xsl:if></SPAN>: <xsl:value-of select="."/></P>
143: </xsl:template>
144:
145: <xsl:template match="xsv:warning">
146: <P><SPAN STYLE="color: green"><xsl:value-of select="@resource"/>:<xsl:value-of select="@line"/>:<xsl:value-of select="@char"/></SPAN>: <SPAN STYLE="color: blue">Warning</SPAN>: <xsl:value-of select="."/></P>
147: </xsl:template>
148: </xsl:stylesheet>
Webmaster