469,270 Members | 1,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Multiple XML documents in one XSL file as variables

Does any XSLT expert know if there is a way to import xml data as a
parameter into an XSL stylesheet. I know you can import an XML file
using the document('file.xml') function but the data I get comes from a
web service and I would rather not write it to a file and then delete
after the transformation if I don't have to.

I found this example but it did not work for me:
http://www.zend.com/tips/tips.php?id=253&single=1

And I searched around and couldn't find any more examples of this.

-Derrick

Nov 24 '06 #1
4 1769
pl*************@gmail.com wrote:
Does any XSLT expert know if there is a way to import xml data as a
parameter into an XSL stylesheet. I know you can import an XML file
using the document('file.xml') function but the data I get comes from a
web service and I would rather not write it to a file and then delete
after the transformation if I don't have to.
Well the document function load from a URI and not necessarily a static
file so I don't see any problem, if that web service exposes its service
with a HTTP URI then simply use e.g.
document('http://example.com/service?arg1=1&arg2=2')
and the XSLT processor will access the web service as needed.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 24 '06 #2
In article <45**********************@newsspool3.arcor-online.net>,
Martin Honnen <Ma***********@gmx.dewrote:
>Well the document function load from a URI and not necessarily a static
file so I don't see any problem, if that web service exposes its service
with a HTTP URI
So long as it works with GET rather than POST.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Nov 24 '06 #3
Thanks using a HTTP URI works. I probably won't link directly to the
web service, instead I'll point to local a php page that'll serve up
the XML after doing some preprocessing.

I guess my assumption was right that there isn't a way to pass in XML
data as a parameter.

Thanks

Martin Honnen wrote:
pl*************@gmail.com wrote:
Does any XSLT expert know if there is a way to import xml data as a
parameter into an XSL stylesheet. I know you can import an XML file
using the document('file.xml') function but the data I get comes from a
web service and I would rather not write it to a file and then delete
after the transformation if I don't have to.

Well the document function load from a URI and not necessarily a static
file so I don't see any problem, if that web service exposes its service
with a HTTP URI then simply use e.g.
document('http://example.com/service?arg1=1&arg2=2')
and the XSLT processor will access the web service as needed.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 24 '06 #4
I guess my assumption was right that there isn't a way to pass in XML
data as a parameter.
Of course, such assumption is wrong. Every XSLT processor has
(implementation-dependent) ways of passing external parameters to the
transformation.

Just read the respective documentation.

Cheers,
Dimitre Novatchev

<pl*************@gmail.comwrote in message
news:11*********************@f16g2000cwb.googlegro ups.com...
Thanks using a HTTP URI works. I probably won't link directly to the
web service, instead I'll point to local a php page that'll serve up
the XML after doing some preprocessing.

I guess my assumption was right that there isn't a way to pass in XML
data as a parameter.

Thanks

Martin Honnen wrote:
>pl*************@gmail.com wrote:
Does any XSLT expert know if there is a way to import xml data as a
parameter into an XSL stylesheet. I know you can import an XML file
using the document('file.xml') function but the data I get comes from a
web service and I would rather not write it to a file and then delete
after the transformation if I don't have to.

Well the document function load from a URI and not necessarily a static
file so I don't see any problem, if that web service exposes its service
with a HTTP URI then simply use e.g.
document('http://example.com/service?arg1=1&arg2=2')
and the XSLT processor will access the web service as needed.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 24 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by John Sutor | last post: by
6 posts views Thread by Gaijinco | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.