Is possible to tranform from XML DOM to PDF or HTML

Questions about XML that are not covered by the other forums should go here.
slaterino
Posts: 11
Joined: Sat Jan 09, 2010 8:13 pm

Is possible to tranform from XML DOM to PDF or HTML

Post by slaterino » Sun Jan 10, 2010 4:16 pm

I am not sure whether this should be in the other board of the forum but seeing as it's kind of a general question I wanted to ask it here.

I am designing a site using XML and at the moment XML DOM is working perfectly for presenting my XML content exactly as I want it. The only problem I can foresee is the lack of actual content on the site as everything is in nodes. Does anyone know if it's possible to convert from XML DOM into HTML or PDF? Is this a possible transform?

adrian
Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: Is possible to tranform from XML DOM to PDF or HTML

Post by adrian » Mon Jan 11, 2010 1:53 pm

Hello,

What web server and what language/script are you using to create the DOM tree?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

slaterino
Posts: 11
Joined: Sat Jan 09, 2010 8:13 pm

Re: Is possible to tranform from XML DOM to PDF or HTML

Post by slaterino » Mon Jan 11, 2010 4:17 pm

Hi,
I am just using what I believe is the Microsoft-developed XML Dom and then using Javacsript to display it.

I feel really comfortable using it but I think the problem will be with the SEOs as the content will all be hidden in the nodes, which is why I was trying to find if there was a way to do some kind of transform.

adrian
Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: Is possible to tranform from XML DOM to PDF or HTML

Post by adrian » Mon Jan 11, 2010 4:39 pm

My mistake, I thought you were talking about a Java XML DOM tree resulted from parsing an XML file. I have no idea how Microsoft XMLDOM works.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

slaterino
Posts: 11
Joined: Sat Jan 09, 2010 8:13 pm

Re: Is possible to tranform from XML DOM to PDF or HTML

Post by slaterino » Mon Jan 11, 2010 4:44 pm

It is also possible that I am confusing things!!!

This is an example of a short script I have done for the XML DOM:

Code: Select all

<script type="text/javascript">
xmlDoc=loadXMLDoc("main.xml");

var x=xmlDoc.getElementsByTagName("chapter");
i=0;

function next()
{
if (i<x.length-1)
{
i++;
display();
}
}

function previous()
{
if (i>0)
{
i--;
display();
}
}

function display()
{
title=(x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue);
document.getElementById("show").innerHTML="Title: " + title;
}
</script>
Do you think it's possible to actually parse something like this into HTML or would this be very messy and probably better to just use XSL?

Post Reply