[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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


xml and x include

> > 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. :-)

Karl 


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.