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


You have an xml document with partly html content


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


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"

<xsl:template match="/">

    <h1>Lubby Knowledgebase Article</h1>

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


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


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


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



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!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.