java - Escaped HTML in XML node via XSLT into XSL-FO -
i have document has generated pdf. use xalan , apache fop processing xml xslt xsl-fo.
in xml tree there node this:
<root> <formula> <text>3+10*10^-6*l</text> <html><html xmlns="http://www.w3.org/1999/xhtml">3 · + 10 · 10<sup>-6</sup> ยท <i>l</i></html></html> </formula> </root>
how can not proper html (by using disable-output-escaping="yes"
) node-set (exsl:node-set
?) can process later on? mean, want xsl-fo representation of html formula in order integrate pdf output.
something like
<xsl:template match="xhtml:b"> <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline> </xsl:template>
there may solution using saxon:parse()
. however, cannot switch xalan-j.
is there solution in scenario?
you can write 1 stylesheet process xalan does
<xsl:template match="html"> <xsl:value-of select="." disable-output-escaping="yes"/> </xsl:template>
which creates serialized result document xhtml markup.
a second stylesheet process result document of first stylesheet e.g.
<xsl:template match="xhtml:html" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xsl:apply-templates/> </xsl:template>
but can't within 1 stylesheet result tree fragment doe (disable-output-escaping) serialization feature , if work result tree fragments converted node set of exsl:node-set
or similar within 1 stylesheet there no serialization happening.
looking closer, snippet seems contain references undeclared entities ·
think sample not parse xml @ need fix first xslt processing.
Comments
Post a Comment