[xslt] <xi:include> has no namespace in external entity



Platform: debian testing/unstable (sarge),
	  DocBook XML 4.2
	  DocBook XSL 1.60.1
	  xsltproc 1.0.27

Is XInclude of text files supposed to work from an external entity
used in an XML document?  If the answer is yes, I can whip up a simple
test case of where it doesn't work, and report a bug.  If the answer
is no, I will try to use XInclude all the way.

I'm trying to replace the use of the DocBook XSL include extensions
with XInclude to include text files into <programlisting>, as outlined
in Bob Stayton's book[1], so that I can use xsltproc instead of Saxon.

However I run into problems where I have used external entities to
make documents modular.  The <xi:include> element doesn't work, when
used in an external entity.  I get the message:

extsection.xml:7: warning: Namespace prefix xi is not defined
  <programlisting><xi:include href="testfile1.txt" parse="text"/></programlisti

To make psgml accept the <xi:include> element, I have made the
following changes to the DocBook XML DTD in the internal subset.  This
works for psgml, and seems to work for <xi:include> used from the top
level document:

<!DOCTYPE article
  PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"; [
  <!ENTITY example.section SYSTEM "extsection.xml">

  <!-- Add <xi:include> to <programlisting> to be able to use -->
  <!-- xsltproc instead of Saxon or Xalan, when including     -->
  <!-- programlisting from external files                     -->
  <!ENTITY % local.article.attrib
    "xmlns:xi CDATA #FIXED 'http://www.w3.org/2001/XInclude'" >
  <!ENTITY % local.para.char.mix
    "|xi:include" >
  <!ELEMENT xi:include EMPTY >
  <!ATTLIST xi:include
     href CDATA #REQUIRED
     parse (xml|text) "xml"
     encoding CDATA #IMPLIED >
]>

Thanx!


- Steinar


[1] <URL:http://www.sagehill.net/xml/docbookxsl/SolveProblems.html#ProgramListings >




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]