xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: Embeded Cyrillic Font still showing unicode chars .. HELP!!
Date Wed, 20 Feb 2008 16:52:24 GMT
On Feb 20, 2008, at 17:38, knoxorino wrote:

>
> Hi Andreas,
>
>> Can you check the following:
>> - What is the result of calling xmlDom.getInputEncoding()?
>
> I'm actually get a 'null' returned for that. Should this be set to  
> 'UTF-8' ?
> If so, how do I set it ?

Sorry, my mistake. This obviously only applies if the DOM is parsed  
from a stream/file.

>> - How are the numeric character references inserted into the DOM  
>> by the
> generateXml() method (if they >are already present in the DOM, that  
> is...)?
>
> Here's a generateXml() method snippet, I build up the xml in this  
> way and
> then return the Document
>
>
>         	DocumentBuilderFactory factory =
> DocumentBuilderFactory.newInstance();
> 		DocumentBuilder builder = factory.newDocumentBuilder();
> 		Document doc = builder.newDocument();
>
> 		Element certificate = doc.createElement("certificate");
> 		
> 		Element certificateNumber = doc.createElement("certificatenumber");
> 	
> certificateNumber.appendChild(doc.createTextNode 
> (cert.getCertificateNumber()));
> 		certificate.appendChild(certificateNumber);

Does the certificate generate these NCR's?
I mean: getCertificateNumber() returns a java.lang.String.
Now, any non-Western characters in that String should be Java Unicode  
characters (\uXXXX). If this method generates a String containing  
'&#XXXX;', then when doc.createTextNode() is called to insert the  
text into the DOM, the ampersands will be escaped to '&amp;'. The  
XSLT processor (and ultimately also FOP) will never see these as  
NCR's (= 1 character), but as a sequence of 7 characters ('&'  
escaped, followed by '#' etc.).


Cheers

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message