need help transforming an XML file, whose part of it is with escape sequences, into html

Posted by shlomi on Stack Overflow See other posts from Stack Overflow or by shlomi
Published on 2010-04-07T13:08:33Z Indexed on 2010/04/07 13:13 UTC
Read the original article Hit count: 295

Filed under:
|

hello, i need help transforming the following XML

<?xml-stylesheet type=text/xsl href=XSL_17.xsl?>
<Root>
  <Book>
    <Author>John smith</Author>
    <Genre>Novel</Genre>
    <Details>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Dets&gt;&lt;Ds&gt;&lt;D DN="Pages" DV="381" /&gt;&lt;D DN="Binding" DV="Hardcover" /&gt;&lt;D DN="Rate" DV="7.8" /&gt;&lt;/Ds&gt;&lt;/Dets&gt;</Details>
  </Book>
  <Car>
    <Year>2010</Year>
    <Name>Charger</Name>
    <Manufacturer>Dodge</Manufacturer>
  </Car>
</Root>

to the following HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <table>
        <tr>
            <td><strong>Book</strong></td>
        </tr>
        <tr>
            <td><strong>Name</strong></td>
            <td><strong>Value</strong></td>
        </tr>
        <tr>
            <td>Author</td>
            <td>John smith</td>
        </tr>
        <tr>
            <td>Genre</td>
            <td>Novel</td>
        </tr>
        <tr>
            <td>Details</td>
            <td>
                <table>
                    <tr>
                        <td><strong>Name</strong></td>
                        <td><strong>Value</strong></td>
                    </tr>
                    <tr>
                        <td>Pages</td>
                        <td>381</td>
                    </tr>
                    <tr>
                        <td>Binding</td>
                        <td>Hardcover</td>
                    </tr>
                    <tr>
                        <td>Rate</td>
                        <td>7.8</td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td><strong>Car</strong></td>
        </tr>
        <tr>
            <td><strong>Name</strong></td>
            <td><strong>Value</strong></td>
        </tr>
        <tr>
            <td>Year</td>
            <td>2010</td>
        </tr>
        <tr>
            <td>Name</td>
            <td>Charger</td>
        </tr>
        <tr>
            <td>Manufacturer</td>
            <td>Dodge</td>
        </tr>
    </table>
</body>
</html>

i.e. i need to represent both normal XML and escaped XML in HTML tables.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about Xml