darma teja

darma teja

  • NA
  • 496
  • 336.3k

crop cdata in xslt

Oct 7 2015 4:42 AM
I have a source xml file and dtd. I am writing Xslt code to transform xml to HTML.
I stuck with CDATA which is in my xml file. my xslt shows CDATA in HTML.
I do not want to show CDATA of xml into HTML.
my xml is like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE xml_file SYSTEM "TranslationXml.dtd">
<xml_file name="dan" version="1.0.2"><![CDATA[
name: name1
Server: 0.0.0.10
Version: 1.0.2
]]><PAGE
.....
....
....
my xslt:
<?xml version="1.0" encoding="UTF-16"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY anchor "<xsl:apply-templates select='@id' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'/>">
<!ENTITY add-style "<xsl:call-template name='add-style-attribute' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'/>">
]>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html"
version="4.0"
encoding="utf-8"
doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
indent="yes"
omit-xml-declaration="yes"
cdata-section-elements="xml_file" />
but it is not working. How can i achieve this.
Advance thanks,
Darma

Answers (1)