-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jul 28, 2005, at 16:56, Fabrizio Caldas wrote:

Hi,

I got the escape working for the XML, you're right about being in the XMLReader.java that I need to make this change.

In the first generateFor() method that I have I included a call to

handler.processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING,null);

This disables output escaping when creating the xml with the ExampleObj2XML.

But when I transform to PDF using the ExampleObj2PDF the escaping does not work.

Well, I still think you don't need to do any escaping (or disable escaping for that matter).

If you need to have:
<fo:basic-link external-destination="url">Click here</fo:basic-link>

There are two things to take into account:
- - our example embedding.tools.AbstractObjectReader doesn't activate namespace support
- - and it does not offer any support for attributes

You basically have two options:
1) modify the code for AbstractObjectReader to allow namespaces and attributes (or override the relevant methods in a subclass) 2) generate semantic XML from your object, then transform it via XSLT to FO

For 2), the scenario would look something like:
* use a method similar to setTitle() to set/store the strings for the destination URL and "Click here". For example store it in member variables named linkContent and linkDest (and provide getXXX() methods to retrieve them)

* then, in your XMLReader in the generateFor() method that will process your object, you create the result element roughly as follows:
...
handler.startElement("link");
handler.element("destination",obj.getLinkDest());
handler.element("content",obj.getLinkContent());
handler.endElement("link");
...

You will then get XML output like this:

<link>
  <destination>URL</destination>
  <content>Click here</content>
</link>

This fragment can be transformed by an XSL template:

<xsl:template match="link">
  <fo:basic-link external-destination="{destination}">
    <xsl:value-of select="content" />
  </fo:basic-link>
</xsl:template>

HTH!

Greetz,

AD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFC6QbLyHTbFO9b8aARAvJjAKCMLiPYet/aCXFS7JBEg1RGBRf2GQCdHA74
+HKtu2LMlsYDDGy4KRKQ2XU=
=Gu0x
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to