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.

Still trying....

Regards,

From: Andreas L Delmelle <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: embedding output escaping
Date: Thu, 28 Jul 2005 02:33:59 +0200

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

On Jul 27, 2005, at 23:57, Fabrizio Caldas wrote:

Hi,

This question has probably come up before, but couldn't find it in the archives. I want to disable output escaping.

Here's an example:
public static ObjXml createSampleObj() {
 ObjXml obj = new ObjXml();

 obj.setTitle("<a href=\"http://www.sample.com\";>Sample Title</a>");
}

public static void main(String[] args) {
 app.convertObj2XML(obj, "C:\\xmlfile.xml");
 app.convertObj2PDF(obj, "C:\\pdffile.pdf");
}

The xml output is '&lt';a href="http://www.sample.com";'&gt';Sample Title'&lt';/a&gt'; And on the PDF its just text not a link.


First things first: Neither in PDF nor in XSL-FO can this be considered a link, since after all, it IS an HTML element.

The correct FO syntax that corresponds to this HTML :

<a href="...">Click here</a>

is

<fo:basic-link external-destination="...">Click here</fo:basic-link>

Does anyone know how to escape this?

Not exactly, nor do I believe you really need to. I think your problem is caused by the internals of the methods ObjXml.setTitle() and app.convertObj2XML(). Presumably, the first stores the text as a java.lang.String member variable of the object in question, while the second writes that String to the output XML file --as text, so escaping the usual markup characters and/or quotes. (Analogous to our own embedding example: in ProjectTeam.java, the setProjectName() method is only used to store the name as a String. If you look at ProjectTeamXMLReader.java, you will see that ultimately a new projectname-element is created and the name is only used as its content.)

I have a feeling the setTitle() method is incorrectly being used. You expect it to magically transform character data containing markup - --HTML markup no less-- to a FO element in the output file. If you just take a closer look at that embedding example, I think you'll be able to figure it out. If not, just yell.


HTH!

Greetz,

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

iD8DBQFC6CgFyHTbFO9b8aARAljVAKC7zzh2HdZoa3qC4ustw992bmAd1wCgvBYr
9CKrDkObMtStVVQPy+o34Uo=
=fU8S
-----END PGP SIGNATURE-----


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


_________________________________________________________________
Chegou o que faltava: MSN Acesso Grátis. Instale Já! http://www.msn.com.br/discador


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

Reply via email to