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: Re: [docbook-apps] FAILLED : Entity in db5 with xinclude ...


Hi Bruno,
This is not an issue of DB4 versus DB5.  If you use the articleinfo entity 
declaration and reference it in the DB5 document, it will work as it does 
in DB4 documents.

The problem is replacing a system entity reference with an XInclude.   A 
parser treats system entity references as part of the same document.  The 
declaration of the "years" entity in the main document is applied to all 
content pulled in by a system entity reference.  In fact, it is not 
possible to declare any entities inside a file used as a system entity, 
because a system entity cannot have a DOCTYPE declaration.

XInclude works differently.  An XIncluded document is handled as a separate 
document that is merged into the main document as an XML Info Set (there is 
a W3C standard for Info Set). All entity references in the XIncluded 
document must be resolved before the Info Set is merged.

So you have to add a DOCTYPE declaration to your articleinfo XML file, and 
it must declare any entities that are referenced in the file.  It is common 
practice when using XIncludes to define a single entities declaration file 
as you have done, and have all main files and modules reference that file 
in their DOCTYPE declaration.  That way there is no conflict between 
entities.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Bruno GUEGAN" <bruno_guegan@yahoo.fr>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, December 20, 2006 9:43 PM
Subject: [docbook-apps] FAILLED : Entity in db5 with xinclude ...


Hello,

I am sorry but I think of having done what it was necessary to look at well
the code…

All my entities are in this file :
./src-cours/C-signaux-entity.xml

And it's parse before ...

If i use DB4 and :
<!ENTITY % myentities SYSTEM "./src-cours/C-signaux-entity.xml">
%myentities;

<!ENTITY articleinfo SYSTEM "./src-cours/C-signaux-articleinfo.xml">

Its good, but with DB5 and Xinclude it's failled ...

======================= main xml file =======================
<?xml version='1.0' encoding='iso-8859-15'?>
<!DOCTYPE article [
        <!ENTITY version "5.0b6">
        <!ENTITY % myentities SYSTEM "./src-cours/C-signaux-entity.xml">
        %myentities;
]>
<article xmlns="http://docbook.org/ns/docbook";
         xmlns:xl="http://www.w3.org/1999/xlink";
         xmlns:mml="http://www.w3.org/1998/Math/MathML";
         xmlns:xi="http://www.w3.org/2001/XInclude";
         version="5.0" xml:lang="fr">

<xi:include xmlns:xi='http://www.w3.org/2001/XInclude' 
encoding="ISO-8859-15"
href="./src-cours/C-signaux-articleinfo.xml"/>
</article>
======================= =======================

And in my : ./src-cours/C-signaux-articleinfo.xml i have some entity ...
=============  ./src-cours/C-signaux-articleinfo.xml  =============
<info xmlns="http://docbook.org/ns/docbook"; version="5.0"><title>BTS-IRIS] 
Les
signaux</title>

<author><personname><firstname>Bruno</firstname><surname>Guégan</surname></personname></author>
      <authorinitials>BG</authorinitials>

      <copyright>
        <year>&years;</year>

...
...
======================= =======================

The problem is that &years; is define in my 
./src-cours/C-signaux-entity.xml
but its don't work :

Error on line 6 column 15 of
file:/home/bruno/Travail/DocBook5.0/C-prog_systeme_linux/C-signaux-classiques/src-cours/C-signaux-articleinfo.xml:
  Error reported by XML parser: The entity "years" was referenced, but not
declared.

I use :
java -cp 
"/usr/share/java/xslthl.jar:/usr/share/java/saxon.jar:/home/bruno/Travail/DocBook5.0/libs/docbook-xsl-1.71.1/extensions/saxon65.jar:/usr/share/java/xercesImpl.jar" 
 -Dxslthl.config=file:///home/bruno/Travail/DocBook5.0/libs/docbook-xsl-1.71.1/highlighting/xslthl-config.xml -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfigurationcom.icl.saxon.StyleSheet -o/home/bruno/Travail/DocBook5.0/_out/C-signaux/fo/C-signaux.foC-signaux.xml /home/bruno/Travail/DocBook5.0/styles/_mystyle_fo.xslAny ideas ?Best regards,Bruno--Les choses ne changent pas, change ta façon de les voir, cela suffit.Lao Tseu---------------------------------------------------------------------To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.orgFor additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



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