Re: [xml] Keeping entity references unchanged with xmlParseFile

On Tue, Dec 09, 2003 at 11:35:37PM +0100, bvh wrote:
On Tue, Dec 09, 2003 at 10:26:19PM +0100, bvh wrote:
However the reference entities seem to be skipped over completly. For
example for

<para>Foo &agrave; bar</para>

I get simple two text node with "Foo " and " bar" as content under the para node.

Just to be clear : I do get a node with type = XML_ENTITY_REF
but I'd like just to have everyting lumped together in one (or more) text nodes.

  No, entities references are not text node this makes no sense. And entity
can contain structure, hold full chapters, etc ... they cannot be associated
to a text node.

(My bad : I should have reread this before sending) Ideally, the parser should
ignore them completly and try not to validate them to a dtd. Not sure if this

   validation is irrelevant in that case.

would go against the xml standard of some sorts but from a practical POV it
seems to make sense to me.

  yes it would go against all standard practice and logic behind XML.

Just the same as above I'd like them to stay in &#x0000; form in one (or more)
text nodes.

  makes no sense either ! How would you save that text node ? as 
which is not what you have in your input, 
  libxml2 is an XML parser, it behaves like an XML parser, sorry what you're
asking for makes no sense from an XML parsing perspective.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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