XML Question

Status
Not open for further replies.

StoneTable

Ars Praefectus
3,274
Subscriptor++
If you are using ASP, you can use the com object MSXML.DOMDocument.
The basic idea is that you load your XML into one document, and use a second object to "transform" your XML into HTML via a XSL (Extensible Style Sheet).

This page on MSDN might help you a bit, too. If you're still having questions tomorrow (when I'm at work) I can post some specific samples for you.


Good Luck (and forgive any spelling/gramatical errors, I'm sleepy :D )
 

slok

Ars Scholae Palatinae
619
you will need to decide
1. the language u are using
2. after the language, look for the parser (either DOM or SAX) that
is available for the language

DOM parser loads the whole XML document into memory and from there you
can "walk the DOM"

SAX parser does not load the entire document, and you do it by event
based.

If you are currently using ASP or VBScript or JavaScript or JScript,
Microsoft have a MSXML parser (probably v2 or v3).

For more info. go to MSDN.
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000438
 

Swish

Seniorius Lurkius
22
Actually that's about what I had going but I had trouble with this line right here:

xmldoc.Load(theFile)

Where "thefile" is not actually a saved file but rather it's the return value from the preivious function that gets info from off-site and returns an XML file stored in a variable. So, if I did Response.Write(theFile) it would display a perfectly valid xml file... make sense?
My point being is that it didn't like when I did that, I think it actually has to have a file to load. Like I said before I'm a newb at xml and dealing with it from asp so I don't know if there is a way around this. I don't really want to make and save the return xml info to a file because it will be constantly changing.


This is code from the KB article you posted above
<%

Set xmldoc = Server.CreateObject("MSXML2.DOMDocument")
Set xsldoc = Server.CreateObject("MSXML2.DOMDocument")

xmldoc.Load Server.MapPath(Request.QueryString("xml"))
xsldoc.Load Server.MapPath(Request.QueryString("xsl"))

Response.Write xmldoc.TransformNode(xsldoc)

%>
 
Status
Not open for further replies.