Link to home
Start Free TrialLog in
Avatar of TOM BURKHARDT
TOM BURKHARDTFlag for Canada

asked on

Can I use XQuery directly from an ASP page?

Hi, after years of using VBScript/ASP/SQL coding, I'm boldly venturing into the XML arena.

Am beginning to grok how XML, XSLT, and XPath work. Now I'm looking at XQuery.

Right now I'm using the Saxon XQuery Processor to apply
a text file(test1.xquery) with an XQuery
to an XML page(test1.xml).

The test1.xquery file looks like this:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<html>
<head><title>Tom's First XQuery</title></head>
<body>
<ol type="1">
{
for $x in doc("test1.xml")/tomForm1/elementOne
order by $x/subelementOne
return <li>{$x/subelementOne/text()}</li>
}
</ol>
</body>
</html>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

When I set Saxon to direct this to an output file, I end up with a great HTML file.

Is there a way I can do this to the test1.xml page from an ASP page, using VBScript?   Or is this too bleeding edge??

Any help would be immensely appreciated here ....
Avatar of alorentz
alorentz
Flag of United States of America image

Not sure if this is what you;re after:
http://www.asp101.com/samples/viewasp.asp?file=db%5Fxml%2Easp
Avatar of TOM BURKHARDT

ASKER

Hi alorentz

Should have mentioned, I have already done an ASP page that displays an MS Access table, and also saves it to an HTML file. Have also created an ASP page which applies an XSL page of your choice to an XML page of your choice.

These functions basically use VBScript to manipulate files using the Scripting Object.

What I'm looking for is a way to apply XQuery code to an XML file directly from an ASP page, using VBScript.

Thanks anyway!
>>Do you use .Net?
>>http://aspalliance.com/395

Nyet, as in not yet. It's next on the ToLearn list, but figured I'd do one thing at a time.

Although it's starting to look as though XQuery is destined to bypass plain old ASP pages completely. And that I'll have to stick to XSLT and XPath if I want to stay with ASP. Or learn Java. I just preferred using VBScript because it does not show up in the Browser View Code function.

Probably will indeed have to master ASP.Net before I can move on to XQuery. Can't very well ask clients to buy the Saxon Processor and do command-line Transformations.

Sorry can't offer much in ASP with XQuery then, haven't used it with ASP.  .Net has the support for it.

Thank you anyway!

I will continue working with XSLT for now. It allows you to use the "transformNode" method to apply an XSL stylesheet to an XML page from an ASP page using VBScript, and will have to do for now.

Right now my "learning curve" feels like I'm standing at the bottom of the Swiss Alps looking up at the top, but hey, it keeps the grey cells from turning to sludge.  :>)
If anything I mentioned help. please close.  Or post to community support to close.  thanks.
ASKER CERTIFIED SOLUTION
Avatar of kodiakbear
kodiakbear

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial