Skip to content Skip to sidebar Skip to footer

Creating Html Page From Xml File

I reading xml document which consists of html elements. Now I need to fetch the data from that xml file and construct a HTML and display it using servlets or javascript. How do I d

Solution 1:

You could use XSLT to transform your XML document into an XHTML page.

There's an open-source XSLT servlet available here.

Solution 2:

You should use XSLT for this task. Start with a basic tutorial.

Solution 3:

Basically, in java there are 3 apis to read and parse xml data: * dom: reads whole file at once and lets you access data with random access. high memory usage. * sax: stream-reads file and lets you react on events. Low memory usage, more complicated than dom. * stax: similar to sax, but more modern interface, event based. also low memory usage.

How to present the information from the HTML file cannot be explained in a single answer here, hundreds of books were written about that. Among the possibilities are: You can do HTML creation yourself (prgramatically in java) or you could use JSP, JSF, Ruby on Rails, XSLT, Velocity, GWT, Tapestry, Wicket, JBoss Seam, WebWork, just to name a few.

Post a Comment for "Creating Html Page From Xml File"