📄 mydefaultss80.xsl
字号:
<xsl:otherwise> <SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name()"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN> </xsl:otherwise> </xsl:choose> <SPAN class="m">?></SPAN> </DIV></xsl:template><!-- Template for attributes not handled elsewhere --><xsl:template match="@*|@xmlns:*|@xmlns|@xml:*|@dt:*|@d2:*" > <!-- xml:space="preserve" --><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <xsl:variable name="parentXML" select="normalize-space(vxpathuser:xml(..))"/> <xsl:variable name="bImplied" select="not(contains($parentXML, concat(' ', name(), '=')) or contains($parentXML, concat(' ', name(), ' =')))"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$belongs=0"> <pre><SPAN id="Selected" class="se"> <xsl:choose> <xsl:when test="$bImplied"> <xsl:attribute name="title">default/implied</xsl:attribute> </xsl:when> </xsl:choose> <B><font size="+0.5" face="Verdana"><xsl:value-of select="vxpathuser:xml(.)"/></font></B> </SPAN></pre> </xsl:when> <xsl:otherwise> <SPAN> <xsl:choose> <xsl:when test="$bImplied"> <xsl:attribute name="class">dfa</xsl:attribute> <xsl:attribute name="title">default/implied</xsl:attribute> <b> <xsl:value-of select="name()"/> </b><SPAN class="m">="</SPAN> <pre><SPAN class="dfa"> <xsl:value-of select="." disable-output-escaping="yes"/> </SPAN></pre><SPAN class="m">"</SPAN> </xsl:when> <xsl:otherwise> <xsl:attribute name="class"> <xsl:if test="starts-with(name(), 'xsl:')">x</xsl:if>t</xsl:attribute> <b> <xsl:value-of select="name()"/> </b><SPAN class="m">="</SPAN> <pre><SPAN class="tx"><font size="+0.1" face="Verdana"> <xsl:value-of select="." disable-output-escaping="yes"/> </font></SPAN></pre><SPAN class="m">"</SPAN> </xsl:otherwise> </xsl:choose> </SPAN> </xsl:otherwise> </xsl:choose></xsl:template><!-- Template for attributes in the dt namespace --><xsl:template match="@dt:*|@d2:*"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"> <xsl:value-of select="name()"/>=<xsl:value-of select="."/></SPAN> </xsl:when> <xsl:otherwise> <SPAN class="dt"> <xsl:value-of select="name()"/></SPAN> <SPAN class="m">="</SPAN><B class="dt"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN> </xsl:otherwise> </xsl:choose> </xsl:template><!-- Template for text nodes --><xsl:template match="text()"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <xsl:choose> <xsl:when test="$belongs=0"> <pre><SPAN id="Selected" class="se"><font size="+0.5" face="Verdana"> <b><xsl:value-of select="vxpathuser:xml(.)"/></b></font></SPAN></pre> </xsl:when> <xsl:otherwise> <pre><SPAN class="tx"><font size="+0.5" face="Verdana"> <b><xsl:value-of select="vxpathuser:xml(.)"/></b></font> </SPAN></pre> </xsl:otherwise> </xsl:choose></xsl:template><!-- Note that in the following templates for comments and cdata, by default we apply a style appropriate for single line content (e.g. non-expandable, single line display). But we also inject the attribute 'id="clean"' and a script call 'f(clean)'. As the output is read by the browser, it executes the function immediately. The function checks to see if the comment or cdata has multi-line data, in which case it changes the style to a expandable, multi-line display. Performing this switch in the DHTML instead of from script in the XSL increases the performance of the style sheet, especially in the browser's asynchronous case --> <!-- Template for comment nodes --><xsl:template match="comment()"> <DIV class="k"> <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><!--</SPAN></SPAN><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected"></SPAN><SPAN id="clean" class="se"><PRE><xsl:value-of select="."/></PRE></SPAN> </xsl:when> <xsl:otherwise> <SPAN id="clean" class="ci"><PRE><xsl:value-of select="."/></PRE></SPAN> </xsl:otherwise> </xsl:choose> <SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m">--></SPAN> <SCRIPT>f(clean);</SCRIPT></DIV></xsl:template><!-- Template for cdata nodes <xsl:template match="node()[true()=vxpathuser:cdata(.)]" > <DIV class="k"> <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><![CDATA[</SPAN></SPAN> <SPAN id="clean" class="di"><PRE><xsl:value-of select="."/></PRE></SPAN> <SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m">]]></SPAN> <SCRIPT>f(clean);</SCRIPT></DIV></xsl:template>--><!-- Note the following templates for elements may examine children. This harms to some extent the ability to process a document asynchronously - we can't process an element until we have read and examined at least some of its children. Specifically, the first element child must be read before any template can be chosen. And any element that does not have element children must be read completely before the correct template can be chosen. This seems an acceptable performance loss in the light of the formatting possibilities available when examining children. --><!-- Template for elements not handled elsewhere (leaf nodes) --><xsl:template match="*"> <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m"><</SPAN> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"><xsl:value-of select="name()"/></SPAN> </xsl:when> <xsl:otherwise> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getNamespaceNodes"/> <xsl:apply-templates select="@*|@xmlns:*|@xmlns|@xml:*|@dt:*|@d2:*"/><SPAN class="m"> /></SPAN> </DIV></DIV></xsl:template> <!-- Template for elements with comment, pi and/or cdata children --><xsl:template match="*[node()]"> <DIV class="e"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"><xsl:value-of select="name()"/></SPAN> </xsl:when> <xsl:otherwise> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getNamespaceNodes"/> <xsl:apply-templates select="@*|@xmlns:*|@xmlns|@xml:*|@dt:*|@d2:*"/> <SPAN class="m">></SPAN></DIV> <DIV><xsl:apply-templates/> <DIV><SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m"></</SPAN> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> <SPAN class="m">></SPAN></DIV> </DIV></DIV></xsl:template><!-- Template for elements with only text children --><xsl:template match="*[text()and not(comment()or processing-instruction())]"> <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m"><</SPAN> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"><xsl:value-of select="name()"/></SPAN> </xsl:when> <xsl:otherwise> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getNamespaceNodes"/> <xsl:apply-templates select="@*|@xmlns:*|@xmlns|@xml:*|@dt:*|@d2:*"/> <SPAN class="m">></SPAN> <!-- <SPAN class="tx"><xsl:value-of select="."/></SPAN> --> <xsl:apply-templates/> <SPAN class="m"></</SPAN> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> <SPAN class="m">></SPAN> </DIV></DIV></xsl:template><!-- Template for processing the namespace nodes --><xsl:template name="getNamespaceNodes" > <xsl:variable name="parentElementText"> <xsl:for-each select=".."> <xsl:copy > <xsl:apply-templates select="comment()"/> </xsl:copy > </xsl:for-each> </xsl:variable> <xsl:for-each select="namespace::*[position() > 1]"> <xsl:if test="not(parent::*/parent::*) or not(contains(vxpathuser:xml($parentElementText), vxpathuser:xml(.)))" > <xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/> <SPAN class="m"><xsl:text> </xsl:text></SPAN> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"> <xsl:value-of select="vxpathuser:xml(.)"/></SPAN> </xsl:when> <xsl:otherwise> <SPAN class="ns"> <xsl:value-of select="'xmlns'"/> <xsl:if test="local-name()"> <xsl:value-of select="concat(':', local-name())"/> </xsl:if> </SPAN> <SPAN class="m">="</SPAN> <B class="ns"><xsl:value-of select="."/></B> <SPAN class="m">"</SPAN> <!-- <xsl:value-of select="vxpathuser:xml(.)"/></SPAN> --> </xsl:otherwise> </xsl:choose> <!-- <xsl:text> </xsl:text><xsl:value-of select="vxpathuser:xml(.)"/> --> </xsl:if> </xsl:for-each></xsl:template><!-- Template for elements with element children --><xsl:template match="*[*]"> <DIV class="e"><xsl:variable name="belongs" select="count($selectedNodes|.)-count($selectedNodes)"/><xsl:variable name="hasSelectedOffspring" select="count($nodesWithSelectedOffspring|.)-count($nodesWithSelectedOffspring)"/><DIV class="c" STYLE="margin-left:1em;text-indent:-2em"> <xsl:choose> <xsl:when test="$hasSelectedOffspring=0"> <A href="#" onclick="return false" onfocus="h()" class="bs">-</A> <SPAN class="m"><</SPAN> </xsl:when> <xsl:otherwise><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="$belongs=0"> <SPAN id="Selected" class="se"><xsl:value-of select="name()"/></SPAN> </xsl:when> <xsl:otherwise> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN> </xsl:otherwise> </xsl:choose> <xsl:call-template name="getNamespaceNodes"/> <xsl:apply-templates select="@*|@xmlns:*|@xmlns|@xml:*|@dt:*|@d2:*"/> <SPAN class="m">></SPAN></DIV> <DIV><xsl:apply-templates/> <DIV><SPAN class="b"><xsl:value-of select="string(' ')"/></SPAN> <SPAN class="m"></</SPAN> <SPAN><xsl:attribute name="class"><xsl:if test="self::xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name()"/></SPAN><SPAN class="m">></SPAN></DIV> </DIV></DIV></xsl:template><msxsl:script implements-prefix="vxpathuser"><![CDATA[ function xml(node) { return node(0).xml; //now(); } function nodeType(node) { return node(0).nodeType(); } function cdata(node) { return (node(0).nodeType() == 4); //CData == 4 } ]]> </msxsl:script></xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -