[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Which one to choose
Ural wrote: >> Can anybody tell me how to access remote xml file. Steve Muench wrote: > http://remoteserver/file.xml ? Ural, you got a terse answer because your question was vague. Can we assume you meant to say that you want an XSL stylesheet to refer to data in a remote XML file? If so, then you need a URI that points to the XML file. Use it as the argument to the document() function: <xsl:variable name="foo" select="document('http://remoteserver/file.xml')"/> Then, if the resource identified by the URI could be parsed, $foo will be a node-set containing the root node from file.xml. You can put it in an XPath expression to get data from the document: <xsl:value-of select="$foo/path/to/some/nodes"/> If the resource identified by the URI could not be parsed, your XSL processor is supposed to either signal an error or return an empty node-set. XT does the former and aborts processing, so it's best to have some control over the documents you are obtaining in this manner. You can also use a node-set as the argument to document(). The string-values of the nodes will be used as a list of URIs, and the function will return the union of root nodes from those documents. There are a few other features of the document() function explained in the XSLT spec at http://www.w3.org/TR/xslt#document 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
|