Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XQuery On the Server

Status
Not open for further replies.

TheVillageIdiot27

Programmer
Nov 10, 2005
58
GB
Hi

I am sure this is probably very easy but I am new to XML so bare with me.

I am trying to create an ASP page which will load an XML file sitting on the server, run a XQuery over it then transform the results with and XSLT stylesheet.

I have worked out how to load the XML file into the XMLDOM and am able to transform that with the XSLT but cannot work out how to execute a short XQUERY instruction before doing the transform.

FYI: The code I have at the moment is:

<%
set xmlsource = Server.CreateObject("Microsoft.XMLDOM")
xmlsource.async = false
xmlsource.load(Server.MapPath("docs.xml"))

set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("docs.xsl"))

Response.Write(xmlsource.transformNode(xsl))
%>

and for the sake of example the XQUERY could be 'doc("docs.xml")' (I appreciate this does nothing).
 
MSXSL has no mechanism for XQuery, so you need to find some sort of third-party XQuery component to use with ASP. I've had a quick look and can't find anything (more info for XQuery in ASP.Net).

Why do you need to use XQuery as well as XSLT? Can't you filter the XML with XSLT?

Jon

"I don't regret this, but I both rue and lament it.
 
Thanks, I appreciate that - Is it possible to pass variables to an XSLT file through an ASP script?

I think I have decided to install a SQL server instance to query for the XML data then process it with the XSLT if it's not but it would be useful to know.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top