RE: [xml] Substitution of nested entity references



Hello Daniel, hello all,

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: Wednesday, April 17, 2002 10:11 AM
To: Henke, Markus
Cc: 'xml gnome org'
Subject: Re: [xml] Substitution of nested entity references

<snip />

Start from the attribute() function in SAX.c, there there is
the call which takes the attribute value with the entities still
references and build a node list from them. That's where you should
look at, in xmlStringGetNodeList().
  Preserving entities references in attribute values introduce a 
serious amount of complexity in that proces :-\

Daniel


Well, that task is actual challenging my modest abilities... :)
I guess i'm lack of some very internals of libxml.
However, i don't want to give up without a fight, maybe we can
clarify some points i'm thinking about!?

- Is it necessary (and possible (how)) to track the "state"
  of an entity reference, that is, if the reference is
  already parsed, e.g. as part of an element content?

- An entity that occurs as part of element content is parsed
  using "xmlParseReference(xmlParserCtxtPtr ctxt)" in parser.c,
  which also contains the logic to build the entitiy declaration
  and the appropriate child node list.
  What's the reason that an entity reference that's found in an
  attribute value is handled different?
  Is it worth to think about to reuse that logic to parse entity
  refs in attribute values (and if so, how can we get the parser
  context in "xmlStringGetNodeList())?
  Is "xmlParseReference()" called for any appearance of an entity
  reference or just once per reference?
  If the latter, how is it achieved?

- Why the child node list for entity declarations isn't build
  while the doctype declaration is parsed?

- Where do we come from, where will we go? And are the stars
  just pinprints in the cloak of night...  8)

That's may enough for now (although there's more...), maybe
some naive questions, but i'm a bit confused now from debugging
through libxml much too long...  =)

TIA, Markus 





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