[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: document() revisited
Thanks for all your help on this one and sorry to bother you once more. I found this construct works for the copying (overwriting) using the XT extension: <xsl:template match="file"> <xsl:variable name="path" select="."/> <xsl:variable name="contents" select="document($path)"/> <xsl:variable name="newcontents"> <!-- write new contents --> </xsl:variable> <xt:document method="html" href="{$path}"> <xsl:copy-of select="$newcontents"/> </xt:document> </xsl:template> It's the "write new contents" that's bugging me now: I wish to go through each file and copy those nodes to the result tree that EITHER have no "lang" attribute set, or that DO NOT have lang="german" or lang="french". It seems that I can copy either everything or nothing, since only the HTML root seems to be selected by any expression I try (is this the "lazy evaluation" you speak of, Steve?). My filter is: <xsl:copy-of select="selection*[not(boolean(@lang)) or ( @lang !='german' and @lang !='french' )]"/> How can I apply this filter to all nodes ("selection") in the files and filter "true" nodes through to the output files? Remember my input document was something like: <mother> <file>files\overview.htm</file> <file>files\book1\page1.htm</file> <file>files\book1\chap1\page2.htm</file> </mother> Thanks and cheers, Marc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|