[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Which one to choose

Subject: RE: Which one to choose
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Wed, 16 Feb 2000 11:37:13 -0700
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.