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: xinclude: first attempt...


xinclude can - allegedly - save the day when a network resource is not
available.
so I gave it a try:

I replaced
===================================================================
-  <!ENTITY gpl-text SYSTEM "http://www.gnu.org/licenses/gpl.xml";>
...
-&gpl-text;
===================================================================
with
===================================================================
+<xi:include href="http://www.gnu.org/licenses/gpl.xml";>
+ <xi:fallback><appendix id="gpl"><title>GNU GPL</title>
+   <para>network error: cannot download GNU GPL</para></appendix>
+</xi:fallback></xi:include>
===================================================================

now the document does not validate either with onsgmls:

onsgmls -s -e -g -c/usr/share/sgml/xml.soc impnotes.xml
onsgmls:impnotes.xml:191:17:E: there is no attribute "href"
onsgmls:impnotes.xml:191:17: open elements: book part[1] (appendix[1])
onsgmls:impnotes.xml:191:54:E: element "xi:include" undefined
onsgmls:impnotes.xml:191:54: open elements: book part[1] (appendix[1])
onsgmls:impnotes.xml:192:13:E: element "xi:fallback" undefined
onsgmls:impnotes.xml:192:13: open elements: book part[1] xi:include[1]
onsgmls:impnotes.xml:196:54:E: element "xi:include" undefined
onsgmls:impnotes.xml:196:54: open elements: book part[1] (appendix[1])
onsgmls:impnotes.xml:197:13:E: element "xi:fallback" undefined
onsgmls:impnotes.xml:197:13: open elements: book part[1] xi:include[1]

or with xmllint:

xmllint --xinclude --noout --valid --postvalid --timing --noent impnotes.xml
impnotes.xml:191: namespace error : Namespace prefix xi on include is not defined
<xi:include href="http://www.gnu.org/licenses/fdl.xml";>
                                                      ^
impnotes.xml:191: element include: validity error : No declaration for attribute href of element include
<xi:include href="http://www.gnu.org/licenses/fdl.xml";>
                                                      ^
impnotes.xml:192: namespace error : Namespace prefix xi on fallback is not defin
ed
 <xi:fallback><appendix id="gfdl"><title>GNU FDL</title>
             ^
impnotes.xml:194: element fallback: validity error : No declaration for elementfallback
</xi:fallback></xi:include>
              ^
impnotes.xml:194: element include: validity error : No declaration for element include
</xi:fallback></xi:include>
                           ^
impnotes.xml:196: namespace error : Namespace prefix xi on include is not defined
<xi:include href="http://www.gnu.org/licenses/gpl.xml";>
                                                      ^
impnotes.xml:196: element include: validity error : No declaration for attribute href of element include
<xi:include href="http://www.gnu.org/licenses/gpl.xml";>
                                                      ^
impnotes.xml:197: namespace error : Namespace prefix xi on fallback is not defined
 <xi:fallback><appendix id="gpl"><title>GNU GPL</title>
             ^
impnotes.xml:199: element fallback: validity error : No declaration for elementfallback
</xi:fallback></xi:include>
              ^
impnotes.xml:199: element include: validity error : No declaration for element include
</xi:fallback></xi:include>
                           ^
impnotes.xml:201: element part: validity error : Element part content does not follow the DTD, expecting (beginpage? , partinfo? , (title , subtitle? , titleabbrev?) , partintro? , (appendix | chapter | toc | lot | index | glossary | bibliography | article | preface | refentry | reference)+), got (title appendix include include )
</part>
       ^
Parsing took 1863 ms
Xinclude processing took 159 ms
Element part content does not follow the DTD, expecting (beginpage? , partinfo?, (title , subtitle? , titleabbrev?) , partintro? , (appendix | chapter | toc |lot | index | glossary | bibliography | article | preface | refentry | reference)+), got (title appendix include include )
No declaration for element include
No declaration for attribute href of element include
No declaration for element fallback
No declaration for element include
No declaration for attribute href of element include
No declaration for element fallback
Document impnotes.xml does not validate
Validating took 275 ms
Freeing took 880 ms


added xmlns:xi="http://www.w3.org/2001/XInclude"; to <xi:include> does
not buy much:

xmllint --xinclude --noout --valid --postvalid --timing --noent impnotes.xml
impnotes.xml:192: element include: validity error : No declaration for attribute xmlns:xi of element include
            xmlns:xi="http://www.w3.org/2001/XInclude";>
                                                      ^
impnotes.xml:192: element include: validity error : No declaration for attribute href of element include
            xmlns:xi="http://www.w3.org/2001/XInclude";>
                                                      ^
impnotes.xml:195: element fallback: validity error : No declaration for element fallback
</xi:fallback></xi:include>
              ^
impnotes.xml:195: element include: validity error : No declaration for element include
</xi:fallback></xi:include>
                           ^
impnotes.xml:198: element include: validity error : No declaration for attribute xmlns:xi of element include
            xmlns:xi="http://www.w3.org/2001/XInclude";>
                                                      ^
impnotes.xml:198: element include: validity error : No declaration for attribute href of element include
            xmlns:xi="http://www.w3.org/2001/XInclude";>
                                                      ^
impnotes.xml:201: element fallback: validity error : No declaration for elementfallback
</xi:fallback></xi:include>
              ^
impnotes.xml:201: element include: validity error : No declaration for element include
</xi:fallback></xi:include>
                           ^
impnotes.xml:203: element part: validity error : Element part content does not follow the DTD, expecting (beginpage? , partinfo? , (title , subtitle? , titleabbrev?) , partintro? , (appendix | chapter | toc | lot | index | glossary | bibliography | article | preface | refentry | reference)+), got (title appendix xi:include xi:include )
</part>
       ^
Parsing took 2237 ms
http://www.gnu.org/licenses/fdl.xml:1: validity error : Validation failed: no DTD found !
<appendix id="gfdl">
                   ^
http://www.gnu.org/licenses/gpl.xml:1: validity error : Validation failed: no DTD found !
<appendix id="gpl">

(the last 2 errors appear to indicate that included documents are
required to have a DTD - fine, I can ask the FSF people to add the DTD -
although, IIUC, this will break everything for the entity users)

apparently I did not quite understood
http://www.w3.org/TR/xinclude/
http://www.sagehill.net/docbookxsl/ModularSections.html


PS. this is probably not docbook-specific, but I know of no other
community that is as helpful...

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.savegushkatif.org> <http://ffii.org/> <http://www.jihadwatch.org/>
<http://www.mideasttruth.com/> <http://truepeace.org> <http://www.camera.org>
Only the mediocre are always at their best.



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