-----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 '<';a href="http://www.sample.com"'>';Sample Title'<';/a>'; 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]
