docbook-apps

  • 1.  Entity in db5 with xinclude ...

    Posted 12-20-2006 11:00
    Hello,

    I want to do that :
    ======================= main xml file =======================



    %myentities;
    ]>
    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"/>

    ======================= =======================

    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">

    <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.XIncludeParserConfiguration
    com.icl.saxon.StyleSheet -o /home/bruno/Travail/DocBook5.0/_out/C-signaux/fo/C-signaux.fo
    C-signaux.xml /home/bruno/Travail/DocBook5.0/styles/_mystyle_fo.xsl

    Any ideas ?

    Best regards,
    Bruno

    --
    Celui qui ne prévoit pas les choses lointaines s'expose à des malheurs
    prochains.
    Confucius



  • 2.  RE: [docbook-apps] Entity in db5 with xinclude ...

    Posted 12-20-2006 18:43
    > -----Original Message-----
    > From: Bruno GUEGAN

    [...]

    > 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-sig
    > naux-classiques/src-cours/C-signaux-articleinfo.xml:
    > Error reported by XML parser: The entity "years" was
    > referenced, but not
    > declared.


    This seems to be an example of a pitfall described in "The Complete Guide":

    "If there are any entity references in the included content that are not
    declared in the included file, then the include will fail. In other words,
    you can't rely on the entity declarations in the main document to expand
    entity references in the included text. The text in the included document is
    parsed before it is included, and any entity references must resolve there."


    (http://www.sagehill.net/docbookxsl/ModularDoc.html#XincludeTextEntities)

    /MJ