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!

transform node on server: xml parser 3.0 1

Status
Not open for further replies.

rubychyld

Programmer
Mar 22, 2001
76
US
I'm going around in circles, please help!

I have written an xml file to a string with asp.

Then I'm using an external and well formatted (and validated!) xsl document to get a simple xslt output. (with this namespace if it matters: <xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>)

I am transforming the two together with asp and assigning the output to a session variable, and then just writing that out to the browser.

Sounds straigt forward enough, but what is happening is the html source of the output page shows the xsl file, instead of the xml result I want transformed. no error, just the exact xsl page.

Since I just started using the Xml 3.0 parser. I am wondering if one of my object/method references are incorrect.

Would you take a look? Any suggestions would be appreciated, I keep going around in circles with this...


Here is where I think the problem is...

'Load the XML
set xml = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
xml.async = false
xml.loadXML(Session(&quot;XMLMenuData&quot;))

'Load the XSL
set xsl = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
xsl.async = false
xsl.load(Server.MapPath(&quot;/applications/library/xml/nav.xsl&quot;))

'Transform the file
Session(&quot;strXMLMenuData&quot;)=xml.transformNode(xsl)


***'Response.Write(Session(&quot;strXMLMenuData&quot;))
this line right here, writes the XSL document to the browser html source without transforming it and the html page is left blank.*******

Can anyone keep me from going crazy with this? I'm almost there!

Thanks, Liz
 
Hi Liz,

Have you tried debugging?

Perhaps an error occured on the transformation and that's why you just get the xsl.

Try asking if xsl.ParseError.ErrorCode <> 0 if it isn't ask the reason: xsl.ParseError.reason

Hope it helps.

Jordi Reineman
 
I got it. Since I am using XML 3.0 Parser the object is different.

XML 3.0 object is this
Server.CreateObject(&quot;MSXML2.DOMdocument&quot;)

instead of this
Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)

... I wonder what else is new?

Liz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top