
Hi, I can't validate xref's when using XInclude. Though as I understand it should be possible with Apache Xerces-J. Comment out xref's and all is valid. When I transform the document the xref's (uncommented), are resolved correctly. Validation returns: "An element with the identifier "docbookxsl" must appear in the document. preface.xml" Any ideas? Following is relevant info from files. BOOK.XML --------------------------- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ <!ENTITY % xinclude SYSTEM "/home/sean/apps/oxygen/docbook/dtd/xinclude.mod"> %xinclude; <!ENTITY % global_ents SYSTEM "global.ent"> %global_ents; ]> <!-- I use a combination of XInclude and Entities --> <book> ... <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml"> <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">FIX ME</xi:fallback> </xi:include> ... <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="biblio.xml"> <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">FIX ME</xi:fallback> </xi:include> </book> XREF IN PREFACE.XML --------------------------- <para>The first, "Docbook - The Definitive Guide" <xref linkend="docbookxsl"/> is about the Docbook Document Type Definition (DTD).</para> <para>The second, "Docbook XSL - The Complete Guide" <xref linkend="docbooktdg"/> is about the Docbook Stylesheets (XSL's).</para> BIBLIOENTRY in BIBLIO.XML --------------------------- <biblioentry id="docbookxsl"> <authorgroup> <author> <firstname>Bob</firstname> <surname>Stayton</surname> </author> </authorgroup> ... </biblioentry> <biblioentry id="docbooktdg"> <authorgroup> <author> <firstname>Norman</firstname> <surname>Walsh</surname> </author> <author> <firstname>Leonard</firstname> <surname>Muellner</surname> </author> </authorgroup> ... </biblioentry> .......................... Oxygen 4.2 Apache Xerces-J 2.6.2 Apache Xalan Java 2.5.1 SAXON 6.5.3 Apache FOP 0.20.5 OASIS DocBook XML DTD 4.2 DocBook XSL 1.64.1 -- Sean Wheller sean@enbaya.co.za http://www.enbaya.co.za

Hi Sean, The samples are incomplete and do not allow to reproduce the problem. However I guess that the problem comes from how Xerces validates the documents with XInclude: - each of the included documents is validated against its specified DTD - the main document is validated against its specified DTD but without taking into account the included content (that is it validates the xi:include tag itself, it does not replace the xi:include with the included document for validation). In your case linkend is defined as IDREF and there is an error if there is no corresponding ID attribute with the same value in the document. In order to actually validate a document with XInclude against the Docbook DTD one has to pass the document through a copy transformation that will create a single document with all the XInclude elements replaced with the actual content. Best Regards, George ----- Original Message ----- From: "Sean Wheller" <sean@enbaya.co.za> To: <oxygen-user@oxygenxml.com> Sent: Monday, September 27, 2004 11:46 PM Subject: [oXygen-user] Validate xref when XInclude
Hi,
I can't validate xref's when using XInclude. Though as I understand it should be possible with Apache Xerces-J. Comment out xref's and all is valid. When I transform the document the xref's (uncommented), are resolved correctly.
Validation returns:
"An element with the identifier "docbookxsl" must appear in the document. preface.xml"
Any ideas?
Following is relevant info from files.
BOOK.XML --------------------------- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % xinclude SYSTEM "/home/sean/apps/oxygen/docbook/dtd/xinclude.mod"> %xinclude; <!ENTITY % global_ents SYSTEM "global.ent"> %global_ents; ]> <!-- I use a combination of XInclude and Entities --> <book> ... <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml"> <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">FIX ME</xi:fallback> </xi:include> ... <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="biblio.xml"> <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">FIX ME</xi:fallback> </xi:include> </book>
XREF IN PREFACE.XML --------------------------- <para>The first, "Docbook - The Definitive Guide" <xref linkend="docbookxsl"/> is about the Docbook Document Type Definition (DTD).</para>
<para>The second, "Docbook XSL - The Complete Guide" <xref linkend="docbooktdg"/> is about the Docbook Stylesheets (XSL's).</para>
BIBLIOENTRY in BIBLIO.XML ---------------------------
<biblioentry id="docbookxsl"> <authorgroup> <author> <firstname>Bob</firstname> <surname>Stayton</surname> </author> </authorgroup> ... </biblioentry> <biblioentry id="docbooktdg"> <authorgroup> <author> <firstname>Norman</firstname> <surname>Walsh</surname> </author> <author> <firstname>Leonard</firstname> <surname>Muellner</surname> </author> </authorgroup> ... </biblioentry>
.......................... Oxygen 4.2 Apache Xerces-J 2.6.2 Apache Xalan Java 2.5.1 SAXON 6.5.3 Apache FOP 0.20.5 OASIS DocBook XML DTD 4.2 DocBook XSL 1.64.1
-- Sean Wheller sean@enbaya.co.za http://www.enbaya.co.za _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
George Cristian Bina
-
Sean Wheller