xsl-list
[Top] [All Lists]

RE: [xsl] Assigning multiple xml's file names into variable name using for-each possible?

2006-07-18 06:59:39
So, what I was trying to do is to make a seperate xml file 
listing all the xml file to be processed. e.g: xmlFileList.xml 

      <ContentGroup name="Arts">
              <ContentFile>S207.xml</ContentFile>
              <ContentFile>S103_2.xml</ContentFile>
              <ContentFile>DD03.xml</ContentFile>
              .... etc etc
      </ContentGroup>


And in the xsl file, trying to loop thro to get each file 
name and process it like:

<xsl:template match="/"> <!-- of xmlFileList.xml -->
      <xsl:for-each select="//ContentFile">
              <xsl:variable name="fileName" select="node()"/>
              <xsl:variable name="currentFile" 
select="document('{$fileName}')"/>


You just want

select="document($fileName)"

Curly braces are only used when an XPath expression is embedded in attribute
text, never to embed one XPath expression inside another.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>