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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: [docbook] XInclude problem


George,

I don't understand your explanation. I accept that the trick with 
xinclude.mod is necessary to enable parsing the DocBook documents with 
XIncludes. I also understand the Oxygen team had to workaround the 
Xerces weaknesses. And I don't understand the phrase:

"... is to pass the document through a copy stylesheet that eventually 
adds also the DocBook doctype declaration and validate that result."

What do you mean? I thought the modified xinclude.mod shipped with 
Oxygen was that workaround. What do I need to perform what you 
suggested? Can you provide with the detailed procedure and additional 
files (if necessary)?

Does it mean that Oxygen (or its components) only partially support 
XIncludes? Or does it support XInclude only in certain cases? Can you 
put more light on it, George?

Thanks,

Zbyszek

George Cristian Bina wrote:

> Hi,
>
> It is not a Saxon or Xalan problem, they are XSLT processors, the 
> validation is done with an XML Parser which in this case is Xerces.
>
> The issue is not specific to oXygen, it has to do with the way Xerces 
> 2.6.2 processes the DTD plus XInclude validation. Xerces validates the 
> document *with XInclude elements* against the DTD. It does not do a 
> validation of the document with the XInclude resolved against the DTD. 
> That is why one needs the xinclude.mod module, to add the XInclude 
> elements to the DTD.
> In order to have the document valid one has to make the DTD accept the 
> desired document structure. We took Bob's xinclude.mod and changed it 
> a little to workaround some problems found in Xerces.
> In order to validate the document with XInclude expanded against the 
> full DocBook DTD (no XInclude customization) the current workaround is 
> to pass the document through a copy stylesheet that eventually adds 
> also the DocBook doctype declaration and validate that result.
>
> The transformation works with any of Xalan or Saxon as after parsing 
> Xerces gives the document with XInclude resolved, but it performs 
> validation on each document against its own DTD.
>
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
>
> Bob Stayton wrote:
>
>> Since the validation and transformation works for me using XInclude, 
>> and it
>> works for you using Saxon in Oxygen, I think that indicates the files
>> themselves are ok.  I think you should submit this problem with Xalan 
>> to the
>> Oxygen support list.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> DocBook Consulting
>> bobs@sagehill.net
>>
>>
>> ----- Original Message ----- From: "Zbyszek Cybulski" 
>> <z.cybulski@gmail.com>
>> To: "Bob Stayton" <bobs@sagehill.net>
>> Cc: <docbook@lists.oasis-open.org>
>> Sent: Wednesday, July 06, 2005 2:03 PM
>> Subject: Re: [docbook] XInclude problem
>>
>>
>> Bob,
>>
>> There are two errors while validating the master document.
>> The first error is as follows:
>> Unexpected element "xi:include". The content of the parent element
>> type must match
>> "(sectioninfo?,(title,subtitle?,titleabbrev?),(toc|lot|index|glossary|biblio 
>>
>> graphy)*,
>> (((calloutlist|glosslist|itemizedlist|orderedlist|segmentedlist|simplelist|v 
>>
>> ariablelist|caution|important|note|tip|warning|literallayout|programlisting| 
>>
>> programlistingco|screen|screenco|screenshot|synopsis|cmdsynopsis|funcsynopsi 
>>
>> s|classsynopsis|fieldsynopsis|constructorsynopsis|destructorsynopsis|methods 
>>
>> ynopsis|formalpara|para|simpara|address|blockquote|graphic|graphicco|mediaob 
>>
>> ject|mediaobjectco|informalequation|informalexample|informalfigure|informalt 
>>
>> able|equation|example|figure|table|msgset|procedure|sidebar|qandaset|task|an 
>>
>> chor|bridgehead|remark|highlights|abstract|authorblurb|epigraph|indexterm|be 
>>
>> ginpage|xi:include)+,
>> (refentry*|section*|simplesect*))|refentry+|section+|simplesect+),(toc|lot|i 
>>
>> ndex|glossary|bibliography)*)".
>> This error refers to the line where the last XInclude is placed
>> (reference to f3.xml).
>>
>> The next one:
>> The content of element type "section" must match
>> "(sectioninfo?,(title,subtitle?,titleabbrev?),
>> (toc|lot|index|glossary|bibliography)*,
>> (((calloutlist|glosslist|itemizedlist|orderedlist|segmentedlist|simplelist|v 
>>
>> ariablelist|caution|important|note|tip|warning|literallayout|programlisting| 
>>
>> programlistingco|screen|screenco|screenshot|synopsis|cmdsynopsis|funcsynopsi 
>>
>> s|classsynopsis|fieldsynopsis|constructorsynopsis|destructorsynopsis|methods 
>>
>> ynopsis|formalpara|para|simpara|address|blockquote|graphic|graphicco|mediaob 
>>
>> ject|mediaobjectco|informalequation|informalexample|informalfigure|informalt 
>>
>> able|equation|example|figure|table|msgset|procedure|sidebar|qandaset|task|an 
>>
>> chor|bridgehead|remark|highlights|abstract|authorblurb|epigraph|indexterm|be 
>>
>> ginpage|xi:include)+,
>> (refentry*|section*|simplesect*))|refentry+|section+|simplesect+),
>> (toc|lot|index|glossary|bibliography)*)".
>> This refers to the last line of the master document, the closing section
>> tag.
>>
>> I use Oxygen 5.1, Xalan or Saxon 6.5.3 (both shipped with Oxygen) as
>> the XSLT processor, on Windows. What's interesting, the validation
>> using Xalan fails while the transformation works perfectly (the same
>> for the Saxon validation).
>>
>> Master document is as follows:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
>>                          "http://www.docbook.org/xml/4.3/docbookx.dtd"; [
>> <!ENTITY % xinclude SYSTEM "/d:/Program
>> Files/Oxygen/frameworks/docbook/dtd/xinclude.mod" >
>> %xinclude;
>> <!ENTITY % local.common.attrib "xml:base CDATA #IMPLIED" >
>> ]>
>> <section>
>>     <title>Section Title</title>
>>     <para>Text </para>
>>     <xi:include href="f1.xml" 
>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>     <xi:include href="f2.xml" 
>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>     <section>
>>         <title>Subsection Title</title>
>>         <para>Text Text Text Text Text Text Text Text Text Text Text
>> Text Text Text Text Text Text Text Text Text.</para>
>>     </section>
>>     <xi:include href="f3.xml" 
>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>> </section>
>>
>> f1.xml, f2.xml, and f3.xml are identical:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
>>                          "http://www.docbook.org/xml/4.3/docbookx.dtd";>
>> <section>
>>     <title>Section Title</title>
>>         <para>Text 33333333333</para>
>> </section>
>>
>> For the XML parser the following features are enabled in the Oxygen 
>> editor:
>>
>> http://apache.org/xml/features/validation/schema
>> http://apache.org/xml/features/validation/schema-full-checking
>>
>> as well as XInclude processing.
>>
>> I hope you'll be able to reproduce the problem.
>>
>> Best regards,
>> Zbyszek
>>
>>
>> On 7/6/05, Bob Stayton <bobs@sagehill.net> wrote:
>>
>>> If all of these XIncludes are readable  files whose root elements are
>>
>>
>> section elements, then this document should  validate.  I just tried 
>> it and
>> could not duplicate your problem.  Can  you describe how you are 
>> validating,
>> including the versions of the tools you are  using, as well as the error
>> message you are getting?
>>
>>> Bob Stayton
>>> Sagehill Enterprises
>>> DocBook Consulting
>>> bobs@sagehill.net
>>>
>>>
>>>
>>>
>>> ----- Original Message ----- From:    Zbyszek    Cybulski
>>> To: docbook@lists.oasis-open.org
>>> Sent: Tuesday, July 05, 2005 12:20    AM
>>> Subject: [docbook] XInclude problem
>>>
>>> Hi all,
>>>
>>> I got a problem with XInclude. I have a    document, root element is
>>
>>
>> <section>:
>>
>>> <?xml version="1.0"    encoding="UTF-8"?>
>>> <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook    XML    V4.3//EN"
>>>                         "http://www.docbook.org/xml/4.3/docbookx.dtd";>
>>> <section    id="summary_rep"> <!-- this is the root -->
>>>     <title>Summary Report</title>
>>>  <para>bla bla    bla.</para>
>>>
>>>  <xi:include href="F_subscr_info.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_net_info.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_net_status.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_desktop_status.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>  <section    id="summary_chrono">
>>>           ...
>>>  </section>
>>> </section>
>>>
>>> and this document    validates and XInclude works perfectly. Note that
>>
>>
>> included documents have also    <section> as the root element.
>>
>>> But I also have a different    document:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE    section PUBLIC "-//OASIS//DTD DocBook XML    V4.3//EN"
>>>                         "http://www.docbook.org/xml/4.3/docbookx.dtd";>
>>> <section    id="summary_rep"> <!-- this is the root -->
>>>     <title>Summary Report</title>
>>>  <para>bla bla    bla.</para>
>>>
>>>  <xi:include href="F_subscr_info.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_net_info.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_net_status.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>     <xi:include href="F_desktop_status.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>>  <section    id="summary_chrono">
>>>           ...
>>>  </section>
>>> <xi:include href="F_mail.xml"
>>
>>
>> xmlns:xi="http://www.w3.org/2001/XInclude";></xi:include>
>>
>>> </section>
>>>
>>> I    can't validate this document though the included one is similar to
>>
>>
>> those in    the above example. The error message says the last xinclude
>> element is unknown    and the content of the section must match... 
>> and here
>> goes the list of allowed    elements. Those xincludes at the top are
>> resolved but that at the bottom    isn't. What's wrong with this 
>> document
>> and why xinludes aren't allowed in the    place I chose.
>>
>>> Tks,
>>>
>>> Zbyszek
>>>
>>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-help@lists.oasis-open.org
>>
>



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