Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [smila-dev] org.eclipse.smila.utils.XMLHelper / XML 1.1

Hi,

> XML 1.0 standard doesn't allow (escaped) control characters in XML,
> whereas XML 1.1 does.
> 
> Xerces 2.9 (which we use in SMILA) supports XML 1.1. So, when replacing
> the version in the header constant XML_HEADER_UTF8 in XMLHelper everything 
> works fine.

The only "problem" with this approach I can think of is that there could 
be some non-SMILA message listener that is absolutely not able to read
XML 1.1 ... that seems quite esoteric to me.
 
> Another workaround may be to use a CDATA section instead of a text node
> for record attribute values.(see
> org.eclipse.smila.datamodel.record.dom.RecordBuilder.appendTextElement()) 
> Hmm, that didn't work with my test case, CDATA section isn't correctly
> wrapped around the control character at the end of the text, but maybe I'm 
> doing something wrong...

Even if this worked, it would add quite some overhead to the created XML 
(at least in a string serialization) to surround each attribute value
by the CDATA tag. Or a performance overhead for first checking the string
for invalid characters. 

> What do you think?

I suppose, I'd rather vote for the XML-1.1 approach then.

Cheers,
Jürgen.




Back to the top