[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Question on CDATA in XML
Hi List. I have some hairy troubles with html encoded parts I want to convey in DocBook XML then convert back to HTML (and later on to PDF, but that's another sad story). My problem is that it works in some cases but not in others (I am using DB5.0, Saxon 9.2. Tested with Kernow) For example, if I have ------------------------------------------------------------------------ ----------- <?xml version="1.0" encoding="ISO-8859-1"?> <test> <table frame="none" role="Tab1" rowsep="0" colsep="0"> <row> <entry role="Tab3">Assay Name</entry> <entry role="Tab3"><rtf><![CDATA[ <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> Source </span> ]]></rtf> </entry> <entry role="Tab3"><rtf><![CDATA[ <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> Ligand </span> ]]></rtf> </entry> </row> </table> <biblioentry id="179"> <indexterm> <primary>Bibl.179</primary> </indexterm> <subtitle><rtf><![CDATA[ <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <b>PABREZA, L.A., DHAWAN, S. and KELLAR, K.J. (1991)</b> </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> </span> ]]></rtf> </subtitle> <title><rtf><![CDATA[ <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> [ </span> <span style="color: #000000; font-size: 6pt; font-family: Times New Roman"> 3 </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> H]cytisine binding to nicotinic cholinergic receptors in brain. </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> </span> ]]></rtf> </title> <releaseinfo><rtf><![CDATA[ <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <i>Mol. Pharmacol., </i> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <u><i>39</i></u> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <i>: 9-12.</i> </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> ]]></rtf> </releaseinfo> </biblioentry> </test> ------------------------------------------------------------------------ ----------- As xml and the following DB XSL ------------------------------------------------------------------------ ----------- <?xml version='1.0' encoding="ISO-8859-1"?> <!-- Template to convert DocBook XML to HTML --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" exclude-result-prefixes="d" > <xsl:import href="docBook/xsl/html/docbook.xsl"/> <xsl:function name="exslt:node-set" xmlns:exslt="http://exslt.org/common" as="node()"> <xsl:param name="node" as="node()"/> <xsl:sequence select="$node"/> </xsl:function> <xsl:output method="html"/> <xsl:param name="html.stylesheet" select="'corpstyle.css'"/> <xsl:param name="admon.graphics" select="1"/> <xsl:template match="d:rtf"> <xsl:value-of select="text()" disable-output-escaping="yes"/> </xsl:template> <xsl:template match="d:*" mode="html.title.attribute"/> </xsl:stylesheet> ------------------------------------------------------------------------ ----------- The first part gives Assay Name <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> Source </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> Ligand </span> And the second (which is correct) <div class="biblioentry"><a name="179"></a><p>[179] <span class="indexterm"> . </span> <span class="subtitle"> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <b>PABREZA, L.A., DHAWAN, S. and KELLAR, K.J. (1991)</b> </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> </span> . </span> <span class="title"><i> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> [ </span> <span style="color: #000000; font-size: 6pt; font-family: Times New Roman"> 3 </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> H]cytisine binding to nicotinic cholinergic receptors in brain. </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> </span> </i>. </span> <span class="releaseinfo"> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <i>Mol. Pharmacol., </i> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <u><i>39</i></u> </span> <span style="color: #000000; font-size: 10pt; font-family: Times New Roman"> <i>: 9-12.</i> </span> <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif"> </span> . </span> </p></div> So, the big question is why ? Thanks a lot in advance Best regards, Fabien
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]