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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] xsltproc XInclude questions

On Tue, Dec 16, 2003 at 04:11:29PM -0800, Bob Stayton wrote:
> These questions are intended primarily for Daniel Veillard,
> the developer of xsltproc.  But if anyone else knows the
> answers feel free to jump in.
> I just built the latest version of xsltproc (1.1.1), and now I get
> warnings that I am using a deprecated XInclude namespace
> (http://www.w3.org/2001/XInclude), and that now I should
> be using http://www.w3.org/2003/XInclude.  I checked
> the latest XInclude spec, the Working Draft from 10 November 2003,
> and indeed it says the namespace has been changed.


> That leads me to wonder how much of the 10 November
> Working Draft has been implemented in the latest version
> of XInclude.

  it should be conformant,

> For example, is the xpointer attribute supported now?

  yes it should

> If so, is there any description of how much of the xpointer
> syntax is supported (recognizing that XPointer is still
> in working draft stage).

  As before, the full set, except you may hit some bugs if using
very complex xpointer() expression using parts outside the xpath subset.
Simply because it never went to REC, so little people using it, and
hence it is not as stable as other parts. See the test/XPointer regression
tests to get an idea of what has been tested.

> Another question is about entity resolution.  As I read the
> XInclude spec, the processor merges the "info set" from the included
> resource.  Reading the Info Set recommendation, it seems
> that any entities in the included content are resolved
> (if possible) before being merged.  For example:

   yes and by default XSLT replaces entities by their content.

> Main document contains:
> ----------------------------------------
> <DOCTYPE book SYSTEM "docbook.dtd" [
> <!ENTITY title "The Main Book">
> ]>
> <book>
> ...
> The book title is: &title;.
> ...
> <xi:include href="chapter1.xml"/>
> -----------------------------------------
> chapter1.xml contains:
> ------------------------------------------
> <DOCTYPE chapter SYSTEM "docbook.dtd" [
> <!ENTITY title "The First Chapter">
> ]>
> <chapter>
> ...
> The chapter title is: &title;.
> -------------------------------------------
> When the main document is processed, the result will include:
> "The book title is The Main Book"
> "The chapter title is The First Chapter".
> Is that correct? 

  yes, that should work that way. The douments are parsed first
with entities being expanded (that's due to XSLT) and then the
resulting infosets are merged.

> And there will be no warning of conflict
> over the use of the &title; entity, right?

  You may have a problem there. Check the spec, apparently I can't
load http://www.w3.org/TR/xinclude myself right now.

> What happens if a 'title' entity is not declared  in the
> DOCTYPE of chapter1.xml?

  you get an error at the XML parsing level before XInclude processing.

> Then the entity is unresolved.  Is it included as an entity
> that is then resolved to "The Main Book", or is it just
> blank since it did not resolve?

  Independant of XInclude, it's an XML/XSLT problem. Depending
on the context you may have a fatal error or a recoverable error.


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] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]