Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have an xml file which is a list

Status
Not open for further replies.

transparent

Programmer
Sep 15, 2001
333
GB
I have an xml file which is a list of xml file locations.

Can I use XSL to import elements from each of these files?
 
i think you can.

in xsl, use the document() xpath function. consider this xml:

<documents>
<document>
</document>
<document>
</document>
<document>
</document>
</documents>


to retrieve values from these documents, say the node &quot;element&quot;, do this with xsl:

<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<xsl:template match=&quot;/&quot;>
<xsl:for-each select=&quot;documents&quot;>
<xsl:value-of select=&quot;document(text())/element&quot;/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

hope that helps

m@
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top