Windows DatabaseebooksStatistical Information

LLE10057 : Howto keep html in an xml document even after a transform with xslproc

Symptom:

You have an xml document with partly html content

Cause:

This can be tricky. A better way is to not implement html in xml.

Solution:

To keep the html part for a certain entry in an xml file, you need to write a special xsl file. In the xsl file you can define the way the contents is converted into html. In this case, you should ommit another conversion on the html.

The following is the contents of an xsl file in which a certain entry, in this case "solution", is already html.

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

 <html>
  <body>
    <h1>Lubby Knowledgebase Article</h1>
    <h2>Title</h2>

    <p>
        <xsl:value-of select="lkb/title"/>
    </p>

    <h2>Symptom</h2>

    <p>
        <xsl:value-of select="lkb/symptom"/>
    </p>

    <h2>Cause</h2>

    <p>
        <xsl:value-of select="lkb/cause"/>
    </p>

    <h2>Solution</h2>

    <p>
        <xsl:value-of select="lkb/solution" disable-output-escaping="yes"/>
    </p>

  </body>
 </html>
</xsl:template>
</xsl:stylesheet> 


Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics