[Home] [By Thread] [By Date] [Recent Entries]
On Apr 12, 2005, at 11:12 AM, Magic Finger wrote:
how can I translate XML files (like the following), which contain XHTML-formatted text in one element, to PDF using Apache FOP ?
<p:pipe name="xhtml-convert" xmlns:p="urn:publicid:IDN+smallx.com:pipeline:1.0" > <p:subtree select="TITLE"> <p:parse/> </p:subtree> </p:pipe> That will convert: <TITLE><b>Homer Simpson For President</b></TITLE> to: <TITLE><b xmlns="http://www.w3.org/1999/xhtml">Homer Simpson For President</b></TITLE> You can also "trap" parse errors: <p:pipe name="xhtml-convert" xmlns:p="urn:publicid:IDN+smallx.com:pipeline:1.0" > <p:subtree select="TITLE"> <p:trap> <p:parse/> <p:on-error> <p:template> <TITLE bad="true"><xsl:copy-of select="/*/node()"/></TITLE> </p:template> </p:on-error> </p:trap> </p:subtree> </p:pipe> [1] http://smallx.dev.java.net -- Alex Milowski "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered." Bertrand Russell in a footnote of Principles of Mathematics
|

Cart



