Jun 25, 2002 #1 transparent Programmer Joined Sep 15, 2001 Messages 333 Location 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 have an xml file which is a list of xml file locations. Can I use XSL to import elements from each of these files?
Jun 27, 2002 #2 flumpy Programmer Joined May 17, 2002 Messages 256 Location GI i think you can. in xsl, use the document() xpath function. consider this xml: <documents> <document> http://www.wibble.org/xml.xml </document> <document> http://www.wibble.org/xml2.xml </document> <document> http://www.wibble.org/xml3.xml </document> </documents> to retrieve values from these documents, say the node "element", do this with xsl: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <xsl:for-each select="documents"> <xsl:value-of select="document(text())/element"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> hope that helps m@ Upvote 0 Downvote
i think you can. in xsl, use the document() xpath function. consider this xml: <documents> <document> http://www.wibble.org/xml.xml </document> <document> http://www.wibble.org/xml2.xml </document> <document> http://www.wibble.org/xml3.xml </document> </documents> to retrieve values from these documents, say the node "element", do this with xsl: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <xsl:for-each select="documents"> <xsl:value-of select="document(text())/element"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> hope that helps m@