xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <...@mcc.id.au>
Subject Re: Strange entity behaviour: Omitting last character
Date Wed, 08 Apr 2009 01:28:43 GMT
Hi Paul.

Paul Wellner Bou:
> So why are single quotes ' within attributes replaced with their entity?  
> Can I prevent them from beeing replaced?

I doubt that you can prevent them from being replaced without modifying
Batik.  As with the issue you raised earlier, it is perfectly fine for
an XML serialisation to use numeric character references and entity
references like this (i.e., it’s well formed XML).

In the example below, it’s true that the apostrophes need not be
replaced with entities inside double-quoted attributes.  I’m not sure if
the serialisation code sometimes uses double-quoted attributes and
sometimes single-quoted attributes; if it does, then it may use &apos;
unconditionally just because it is simpler to do so.  But if it’s usign
double-quoted attributes all the time, then I agree it’s better if it
didn’t use &apos;.

Can you submit a small, standalone program that demonstrates the

> And why is batik omitting the last character if it has to do something  
> with entities? For example:
> * If I try to set an attribute to &#xFC; (I did that before I knew that  
> all entities are replaced every time), As result I get: &amp;#xFC. The &  
> is replaced with it's entity, this is ok, but the semicolon disappeared.
> * If I have single quotes in attribute values (Adobe Illustrator seems  
> to do this writing the font names), those single quotes are replaced  
> with their entity &apos; and the last character of the string within the  
>  single quotes disappears:
> 	Original: font-family="'ArialNarrow-Bold'"
> 	Batik written: font-family="&apos;ArialNarrow-Bol&apos;"
> I am using Batik-1.8pre. Is this a known bug?

I don’t think that’s a known bug, no, but it does look like a bug.  As
above, can you provide a test case?



Cameron McCormack ≝ http://mcc.id.au/

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

View raw message