Re: [xml] Content normalization



On Fri, Jul 01, 2005 at 11:12:48AM -0400, Daniel Veillard wrote:
On Fri, Jul 01, 2005 at 05:07:41PM +0200, Armin Bauer wrote:
but what i would like to get is the output with the "
" replaced by 
0x0D.
so is it possible to disable this normalization of text nodes?

  No, this is a requirement to be conformant to the XML spec, not negociable,
and any XML parser will do it anyway.
     http://www.w3.org/TR/REC-xml/#sec-line-ends

        While the XML spec is nice to follow, telling him that doesn't help him
solve his problem.

        Armin, there is a function that use can use to get the data contents
of that element in a way that expands any character references like &#xD.
In perl XML::DOM land it is called expandEntityRefs, but I don't know what
it is when working directly with libxml2.  You can use that if you need just
that one element.
        Translating 
 within an entire xml doc is something you'd probably
have to do yourself.  Writing a function to search through the output
for that shouldn't be too hard, or pipe the output through sed (if it's
convinient to do so).

eric



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]