OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Re: [Sax-devel] XInclude and SAX Incompatibility

[ Lists Home | Date Index | Thread Index ]

> > What do you mean? Unparsed entity and Notation declarations are reported
> > before the EndDTD event, so you know which ones are declared before
> > the first StartElement call.
> Perhaps I didn't explain well enough. Suppose you had two xml files,
> foo.xml and bar.xml.
> foo.xml:
> <!DOCTYPE x [
> <!ELEMENT x (include)>
> <!ELEMENT include EMPTY>
> <!ATTLIST include
>       href  CDATA #REQUIRED>
> ]>
> <x>
>     <include href="bar.xml"/>
> </x>
> bar.xml:
> <!DOCTYPE stuff [
> <!ENTITY foobar "hello world">
> <!ELEMENT stuff (#PCDATA)>
> ]>
> <stuff>&foobar;</stuff>
> The document after processing would have the same infoset as if foo.xml
> was:
> <x>
>     <stuff>&foobar;</stuff>
> </x>
> When this is parsed, all of the DTD events from foo.xml are sent, and then
> an EndDTD event.  When we encounter the include, we start parsing bar.xml,
> and merging it into the same information set as foo.xml.  It's not
> important that we send most of the DTD events -- XInclude doesn't specify
> that the document type information needs to correct.  However, it is
> important that the foobar entity is added to the [entities] property of the
> result infoset, because at some point &foobar; will need to be resolved.

OK, I understand your problem better now - although the above is not an unparsed
entity problem. I assume you just wanted to demonstrate the point.

I know nothing about XInclude, but I would think that it is quite problematic
to merge schema/doctype information from two different documents.
Conflicting declarations? Are the two infosets supposed to depend on each other? 

Is it not possible to process both files independently (using separate parsers)?
Why does your process need to retain the unparsed entity declaration?
Once bar.xml is parsed (separately) and the ENTITY attribute has been reported
(within the context of that parse), should the unparsed entity declaration
not be discarded? Or do you say that the rest of foo.xml might depend on that declaration?

> So
> we need to put an UnparsedEntityDecl event into the stream.  But this
> UnparsedEntitiyDecl event can't be sent, because we already sent an EndDTD
> event on the stream, at the end of the DTD for foo.xml.

I guess I would need to know XInclude to be able to really understand your concerns.
Sorry. :-)



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS