|
Subject: RE: [xsl] Reusing XPath statements (defining once and only once) From: "Dr. Frank Mabry" <fmabry@xxxxxxxxxx> Date: Fri, 18 Apr 2003 18:25:33 -0400 |
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:template match="@* | * | comment() | processing-instruction() | text()"> <xsl:copy> <!-- this is line 12 in my version --> <xsl:apply-templates select="@* | * | comment() | processing-instruction() | text()" /> </xsl:copy> </xsl:template>
<xsl:template match="Host">
<xsl:copy>
<xsl:apply-templates select="@*" />
<!-- here you copy the attributes of the
host element to the result tree. -->
<xsl:if test="@appBase='webapps'">
<xsl:choose>
<xsl:when test="Context[@path='/axis']" />
<xsl:otherwise>
<Context debug="0"
docBase="c:\xml-axis-10\webapps\axis" path="/axis"
reloadable="true" />
</xsl:otherwise>
</xsl:choose>
</xsl:if> <xsl:apply-templates
select="@* | * | comment() | processing-instruction() | text()" />
<!-- the '@*' alternative in the preceding select eventually
causes the system to attempt to add an attribute node
to the result tree ... the attributes have already been
placed in the output result tree -->
</xsl:copy>
</xsl:template>
</xsl:stylesheet>Dr. Frank Mabry Dept. of EE&CS U.S. Military Academy West Point, New York, 10996
Work Phone: 845-938-2960 work email: df6954@xxxxxxxxxxxxxxx home email: fmabry@xxxxxxxxxx
"The great use of life is to spend it for something that will outlast it." - William James
-- Dr. Frank Mabry Dept. of EE&CS U.S. Military Academy West Point, New York, 10996
Work Phone: 845-938-2960 work email: df6954@xxxxxxxxxxxxxxx home email: fmabry@xxxxxxxxxx
"The great use of life is to spend it for something that will outlast it." - William James
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Reusing XPath statements (def, Mitchell, David [CC] | Thread | RE: [xsl] Reusing XPath statements , Michael Kay |
| RE: [xsl] I have the XSLT, now need, Andrew Watt | Date | Re: [xsl] I have the XSLT, now need, S Woodside |
| Month |