Altova Mailing List Archives
>microsoft.public.xml Archive Home
>Recent entries
>Thread Prev - XML to HTML
[Thread Next]
Re: XML to HTML
To: NULL
Date: 10/14/2004 10:49:00 AM
"Payal" <ppatel@f...> wrote in message news:83aae981.0410131123.25790b36@p...... > Hi, I have a XML code that needs to be shown in HTML/ASP format > without using XSL. Diffremt XML files will have diffrent number of > nodes and I have to write one standard code to convert all xml data in > HTML in tabular format. > > Is it possible to do? Any help is highly appriciated. > > -Payal You need to use server side coding for parsing the XML data and format them into HTML layout. This is sample code: Dim xmlObj set xmlObj = Server.CreateObject("Msxml2.DOMDocument.4.0") xmlObj.async = false IF xmlObj.load("d:\R_DSource\ddd.xml") = FALSE THEN Set xmlObj = nothing Response.Write "XML transformation failed." Response.end END IF set rootElement = xmlObj.documentElement Set objNodeList = rootElement.selectNodes("JobProperties") For i = 0 To (objNodeList.length - 1) Set objJobNumber = objNodeList.Item(i).selectNodes("JobNumber") JobNumber = objJobNumber.Item(0).Text Response.Write "JobNumber->" & JobNumber & "<BR>" Set objJobStartDate = objNodeList.Item(i).selectNodes("JobStartDate") JobStartDate = objJobStartDate.Item(0).Text Response.Write "JobStartDate->" & JobStartDate & "<BR>" Set objJobStartDate = nothing Set objJobNumber = nothing Next Set objNodeList = nothing However, I would suggest you to use XSLT to transform the XML data at server as it is much much powerful and faster then the method shown in sample code above.
Disclaimer
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

