473,390 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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 1979
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AMT2K5 | last post by:
Hello. When I compile my program I recieve lots and lots of the following message which I am trying to decipher. "xxx was declared deprecated". What exactly does that mean?
2
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document...
3
by: svdh2 | last post by:
I have been looking at a problem the entire week in access, I have still not been able to find a solution. Hope that you could maybe tell where to look Concerns the link between Access and Word....
3
by: John Sutor | last post by:
Does anyone know how to print multiple page documents? I can print from a test box or a one page document, but not one with multiple pages.
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
1
by: rider0375 | last post by:
Having some major issues... Racking my brain. Also it is worthy to note as of 3 weeks ago i have 0 experience with MySQL. So anyway.. HOW DO YOU DO IT?? hehe - I can get multiple services...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
6
by: Gaijinco | last post by:
I'm having a weird error compiling a multiple file project: I have three files: tortuga.h where I have declared 5 global variables and prototypes for some functions. tortuga.cpp where I...
3
by: Jordan S. | last post by:
I would appreciate your thoughts and opinions on the following: I am looking to render documents into multiple document formats. At a minimum the documents will need to be rendered as HTML, and...
0
Pittaman
by: Pittaman | last post by:
Hello, We're developing an application (.NET 2.0) that let's users drop documents in the application and allows users to show some document types "embedded". For example, a textfile would appear...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.