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!

Some XML/XSL Questions... 1

Status
Not open for further replies.

Lenvdb

Programmer
Jun 21, 2002
81
GB
Hello guys & girls
I have a few XML/XSL related questions, some I know we ALL want to ask, but are too shy to expose our ignorance.
I have an ASP application which calls a dll created in VB.
I created an XML Document using the DOM in the VB6 dll and return this xml Document back to the calling function in ASP. Remember, the xml document is held in memory.
I want to display this document on the client side. There is a saved XSL sheet which deals with the formatting in the same folder.
Now for the questions:

1.Can I display this XML document without first having to SAVE it.
2.And how do I display it using the XSL style sheet.
3.Can I use the Document.write xmlDoc menthod to display the data from inside my VBscript Sub?

I DONT want to save this XML document at this point, only later when I need to save it as a PDF file...

Please could someone throw some samplecode at me to see how this is done?

Poor me is struggling with this...B-( (very sad face...)

Len
 
In answer to your questions,

1. Yes. Use:

response.write mydocument.xml;

2. to transform the document, use another IXMLDOmDocument to load the xslt and create an XSLProcessor to transform:

... original document creation code...
myXSLDocument = Server.CreateObject("Msxml2.FreeThreadedDOMDocument40")
myXSLDocument.load("myxsl.xsl");
myXSLT = Server.CreateObject("Msxml2.XSLTemplate40")
myXSLT.stylesheet = myXSLDocument
xslProc = myXSLT.createProcessor()

xslProc.input = myXMLDocument ' your document you create b4!!

xslProc.transform

response.write xslProc.output

3. erm. no, use response.write from asp.


Indeed, if you are beginning and even if you are not, the MSXML documentation could help you alot. go to for the download or use msdn on microsofts site to lookup functionality.



hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top