Re: [xml] xmlCopyDtd() does not copy the children of the DTD node...



On Thu, Jan 24, 2002 at 05:44:50PM +0000, Anthony Jones wrote:
The patch for this is just about complete and tested - however, I've
noticed a small problem: According to the documentation, xmlEntity nodes do
not have children, but they actually do, eg:

$ ./xmllint --debug test/xml1 
DOCUMENT
version=1.0
URL=test/xml1
standalone=true
  DTD(test)
    ENTITYDECL(example), internal
     content=<p>An ampersand (&#38;) may be escaped  ...
      ELEMENT p
        TEXT
          content=An ampersand (&) may be escaped  numeric...
  ELEMENT test
    ENTITY_REF(example)
      INTERNAL_GENERAL_ENTITY example
      content=<p>An ampersand (&#38;) may be escaped  ...


Presumably it is the documentation that is incorrect, and xmlCopyEntity
should really copy the node's children as well?

  That's where things can start to get really messy...
Depending on your application you may want to copy the subtree or share it.
If you're copying to another document you need to copy. If within the
same document boundaries, one may need to copy entities content because
the intent is really to replicate it, but one may want to keep a single
instance so that editing inside the entity is shared. It may also depend
if the entity in internal or external.
  
  Copying entities is not a simple replication like most other nodes,
it may end-up being far more complex depending on the application needs.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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