2004-11-04 05:03 PM - last edited on 2024-09-24 10:06 AM by Doreena Deng
2004-11-29 01:37 PM
<example> <value/> <container> <list> </list> <interestingValue/> </container> <otherContainer> <list> </list> <otherContainer> </example>
<!-- change the value of interestingValue -> <xsl:template match="example/container/interestingValue"> <!-- do something here --> </xsl:template> <!-- copy everything else in container --> <xsl:template match="example/container/*[name () != 'interestingValue']"> <xsl:copy-of select="."/> </xsl:template> <!-- copy container --> <xsl:template match="example/container"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- copy everything that's not a container --> <xsl:template match="example/*[name () != 'container']"> <xsl:copy-of select="."/> </xsl:template> <!-- copy the whole document, applying changes --> <xsl:template match="example"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template>
2004-11-29 03:13 PM
2004-11-29 04:48 PM
2004-11-30 03:30 PM
TomWaltz wrote:
Andras
I guess my question now is if you have used any kind of scripting with this in the past. It seems as though every XML file will need to have both the DTD and the XSL file called out in it.
Since we are talking about 1500 or so XML files, is there some method you have used to add the needed text to every XML file, then run the transformation on all the files?
-Tom
Xalan xml_source_file xsl_stylesheet
2004-12-15 08:47 PM
2006-02-14 11:09 AM