0

I have a requirement to publish a HTML file from an XML file where the HTML file will show hard-coded values for the specific point in time they were present on the XML file (i.e. independent of XML changes after the HTML doc is created).

Example: XML File

<dvd>
  <name>Titanic</name>
  <price>10</price>
</dvd>
<dvd>
  <name>Avatar</name>
  <price>12</price>
</dvd>

Now I need to convert these into a HTML document whereby the values are hardcoded into the HTML

Example HTML File

<html>
<body>
<h1>DVD List</h1>
<table>
  <tr ...>
  <th>Name</th><th>Price</th>
  <td>Titanic</td><td>10</td>
  <td>Avatar</td><td>12</td>

I have tried using XSLT however this only provides a render of the XML document that is updated according to XML changes. I would require a point-in-time HTML document referring to the values as they were on the XML.

Perhaps there is an easy way to do this with existing technologies, or some simple custom Java code?

Greg Byrne
  • 188
  • 1
  • 7
  • Are you looking to dynamically update / render the HTML as the data in the XML doc changes? – David Apr 01 '15 at 15:51
  • 1
    Run a transform and save the results to a file? Picking an XSLT processor at random: `xsltproc --output my.html my.xsl my.xml` would do it. Tell us what XSLT processor you are using, and someone should know the syntax. – bjimba Apr 01 '15 at 17:16

0 Answers0