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

Re: Do you have a rock-solid function for fetching an

Subject: Re: Do you have a rock-solid function for fetching an XML document?
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 20 May 2011 18:32:42 +0200
Re:  Do you have a rock-solid function for fetching an
Costello, Roger L. wrote:
Hi Folks,

I need a function that fetches an XML document. The function takes two parameters:

1. The href (URL) to the desired XML document.

2. The document (root element) from which the href came from.

A document node and its root element are two different items in the XPath/XSLT data model.


I need the function to be able to work no matter whether the href

- references a file in the current folder, e.g., foo.xml

- references a file in another folder, using a relative path, e.g., ../../../tmp/foo.xml

- references a file in another folder, using an absolute path, e.g., c:/tmp/foo.xml

That is not a URL, it would need to be file:///c:/tmp/foo.xml


- references a file on the network, e.g., http://www.example.org/foo.xml

Do you have code for this function:

     <xsl:function name="f:get-file" as="element()?">
         <xsl:param name="href" as="xs:anyURI" />
         <xsl:param name="document"  as="element()"/>

Doesn't <xsl:sequence select="document($href,$document)/*"/> do what you want?

--

	Martin Honnen --- MVP Data Platform Development
	http://msmvps.com/blogs/martin_honnen/

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.