|
|
 |
Article:
 |
 |
Reading Multiple Input Documents
|
| Subject: |
unnecessary lines in xq493.xml |
| Date: |
2007-01-23 02:27:13 |
| From: |
whitis |
|
|
|
Two of the lines in example xq497.xml appear to be unnecessary.
<xsl:apply-templates select="$colorLookupDoc"/>
unnecessarily pulls the external file into the main document where it has to be pruned by the
second unnecessary line:
<xsl:template match="colors">
At least that is what I found when trying to perform a similar conversion with output method="xml".
On the other hand, since you didn't include these lines just before the output of the stylesheet:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
the reader will be very disappointed when they try to change the output method to xml and see what happens.
|
- unnecessary lines in xq493.xml
2007-01-24 12:43:09 Bob DuCharme
[Reply]
(I assume you mean xq487.xsl, which has that line, because there is no xq497.xml with this article.)
I declared colorNumKey to read in the document into the variable where it could be referenced by the two different template rules. Otherwise, the document could have been read in multiple times: once when the XSLT processor hit the shirts element and then once each time it hit a shirt element.
You're right about the second point: simply changing the output method to "xml" isn't enough if you want to see the actual elements output. You need a template rule to copy the elements. For the purposes of my demo, that's not what I was trying to do.
Bob
|
 |
Sponsored By:
|