This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]