Hi George, Excellent point. I use the docbookxi.rng schema for exactly that reason when I use emacs nxml mode (on those rare occasions when I'm not using Oxygen:-). When I want to parse a book, I resolve all the xincludes first.
Dick ------- XML Press XML for Technical Communicators http://xmlpress.net [email protected] On Mar 6, 2013, at 3:23 PM, George Cristian Bina wrote: > Actually, the best approach will be to configure the XML parser to resolve > the XInclude so that the validation will be done on the whole content. Xerces > provides this support, if you do not get that by default then it is just a > matter of setting the XInclude aware parser configuration - one way to do > that is by setting a system property. > > I see the docbookxi.rng more useful from an authoring point of view, as it > gives to a schema-aware XML editor the XInclude elements so the editor can > propose them to the user. > > Best Regards, > George > -- > George Cristian Bina > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger > http://www.oxygenxml.com > > On 3/6/13 11:43 PM, Richard Hamilton wrote: >> Hi Carlos, >> >> The reason it fails is that the xi:include element isn't formally part of >> the DocBook schema, so when you validate against the pure DocBook schema, >> you will get these errors. >> >> The good news is that there is a RelaxNG schema that includes the xinclude >> syntax. I just tried to validate your example with that schema and it >> succeeded. Here is a link to the DocBook 5.0 RelaxNG page: >> >> http://www.docbook.org/xml/5.0/rng/ >> >> The schema you need is docbookxi.rng (there's also a .rnc version there). >> >> Best Regards, >> Dick Hamilton >> ------- >> XML Press >> New from XML Press: >> The Content Pool >> http://xmlpress.net/publications/the-content-pool >> >> On Mar 6, 2013, at 10:33 AM, Carlos Araya wrote: >> >>> Good morning: >>> >>> I have the following file that runs multiple XIncluded content. >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <book version="5.0" xml:id="ruby-on-rails-3.2-en" xml:lang="en" >>> xmlns="http://docbook.org/ns/docbook" >>> xmlns:xlink="http://www.w3.org/1999/xlink" >>> xmlns:xi="http://www.w3.org/2001/XInclude" >>> xmlns:svg="http://www.w3.org/2000/svg" >>> xmlns:m="http://www.w3.org/1998/Math/MathML" >>> xmlns:html="http://www.w3.org/1999/xhtml" >>> xmlns:db="http://docbook.org/ns/docbook"> >>> <info> >>> <title>Ruby on Rails 3.2 - Step by Step</title> >>> >>> <abstract> >>> <para>This is a step by step book to learn how to code Ruby 1.9 and >>> use Ruby on Rails 3.2 to create modern web applications.</para> >>> </abstract> >>> >>> <edition>1.0</edition> >>> >>> <author> >>> >>> <personname><firstname>Some</firstname><surname>Author</surname></personname> >>> >>> <email>[email protected]</email> >>> >>> <affiliation> >>> <orgname>AMOOMA GmbH</orgname> >>> </affiliation> >>> </author> >>> >>> <pubdate>2012</pubdate> >>> </info> >>> >>> <dedication> >>> <para>For my family.</para> >>> </dedication> >>> >>> <preface xml:id="preface"> >>> <title>Preface</title> >>> >>> <para>Content for the preface goes here...</para> >>> </preface> >>> >>> <xi:include href="installation-und-versionsauswahl.xml"/> >>> >>> <xi:include href="ruby-grundlagen.xml"/> >>> >>> <xi:include href="erste_schritte_mit_rails.xml"/> >>> >>> <xi:include href="activerecord.xml"/> >>> >>> <xi:include href="scaffolding.xml"/> >>> >>> <!-- There is more xi:included content. This was trimmed for the email --> >>> <index xml:id="stichwortverzeichnis"/> >>> </book> >>> >>> When I try to validate with Jing, I get the following errors: >>> >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:68:60: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:70:43: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:72:52: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:74:40: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:76:39: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> [java] /Users/carlos.araya/code/ruby-book/en/docbook/index.xml:78:34: >>> error: element "xi:include" not allowed here; expected the element end-tag >>> or element "acknowledgements", "appendix", "article", "bibliography", >>> "chapter", "colophon", "dedication", "glossary", "index", "part", >>> "preface", "reference" or "toc" >>> >>> I've checked both the DB5: The Definitive Guide and Bob's book and can't >>> find a reason why this would fail validation. >>> >>> Caros >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
