List Info

Thread: FAILLED : Entity in db5 with xinclude ...




FAILLED : Entity in db5 with xinclude ...
user name
2006-12-21 07:40:25
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
bobssagehill.net


----- Original Message ----- 
From: "Bruno GUEGAN" <bruno_gueganyahoo.fr>
To: <docbook-appslists.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.or
g/ns/docbook"
         xmlnsl=&qu
ot;http://www.w3.org/
1999/xlink"
         xmlns:mml="http://www.w
3.org/1998/Math/MathML"
         xmlnsi=&qu
ot;http://www.w3.o
rg/2001/XInclude"
         version="5.0" xml:lang="fr">

<xi:include xmlnsi='http://www.w3.org/200
1/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.or
g/ns/docbook"
version="5.0"><title>BTS-IRIS] 
Les
signaux</title>

<author><personname><firstname>Bruno</f
irstname><surname>Guégan</surname></perso
nname></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-s
ignaux-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/extens
ions/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.ap
ache.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-unsubscribelists.oasis-open.orgFor
additional commands, e-mail: docbook-apps-helplists.oasis-open.org


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )