Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSLT removes HTML tags

From: Majid@-----------.---------.---
To: NULL
Date: 3/6/2009 2:21:00 AM
Hi,
I use the following XSLT file to transfer a xml document into XHTML format 
and everything goes fine except the fact that XSLT removes all my html tags 
such as <br /> tags or <b></b> and only uses the text content.
This is the XSLT file : 


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  <xsl:output omit-xml-declaration="yes"/>
  <xsl:template match="/">
    <html xmlns="http:////www.w3.org/1999/xhtml">
      <head>
        <title>Test title</title>
      </head>
      <body>

        <xsl:apply-templates select="/emaillist/email_content"/>

      </body>
    </html>
  </xsl:template>
  <xsl:template match="item">
  </xsl:template>
</xsl:stylesheet>

And this is the xml file I use:

<?xml version="1.0" encoding="utf-8" ?>
<emaillist>
  <email_content>
     <b>Test Text</b>,<br />

    Test Text,<br />


  </email_content>
</emaillist>


The output of the above transformation is :

<html xmlns="http:////www.w3.org/1999/xhtml">
  <head>
    <title>Test title</title>
  </head>
  <body>
    Test Text,

    Test Text,


  </body>
</html>


As you can see xsl has automatically removed my html tags. Can you please 
help me how I can stop XSL to remove my html tags. Below is the desired xhtml 
document which I want:
<html xmlns="http:////www.w3.org/1999/xhtml">
  <head>
    <title>Test title</title>
  </head>
  <body>
    <b>Test Text</b>,<br />

    Test Text,<br />


  </body>
</html>






























 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent