Hi,

> So it seems that the entities are being resolved before the include takes 
> place?

Yes, that is the case.  Entities are resolved by the XML parser, and XML 
parsing must take place before an XInclude can proceed.  It is mentioned at the 
end of the last bullet in this section:

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

Bob Stayton
Sagehill Enterprises
[email protected]


  ----- Original Message ----- 
  From: Benno Wolf 
  To: [email protected] 
  Sent: Wednesday, March 16, 2011 7:54 AM
  Subject: [docbook-apps] xinclude and olinking with entities


  Hello,
  I do have a problem when assembling new documents with xincludes, turning 
external olinks to internal links by using entity-references, as it is 
described here:


  http://www.sagehill.net/docbookxsl/modular-olinks.html




  I put a reference to an external entity-declaration in a master document, 
i.e. one with includes, like that:


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE book[
    <!ENTITY % entity SYSTEM "entities.ent" >
    %entity;
    ]>


  and have within that entities.ent - file all entities resolved to the master 
document, say master.xml:


    <?xml version="1.0" encoding="utf-8"?>
    <!-- this is the entity-mapping for generating a frame document -->
    <!ENTITY thisgoal "master">
    <!ENTITY thatgoal "master">
    <!ENTITY anothergoal "master">


  If the olinks in a included document are set like that:


<olink  targetptr="targetindoc"  targetdoc="&thisgoal;" />then everything works 
fine since &thisgoal; is resolved to master.




  But when I now include a part of that document into another one in a 
different folder, say master_2.xml and make for that another entities.ent file 
in that same different folder:


    <?xml version="1.0" encoding="utf-8"?>
    <!-- this is the entity-mapping for generating a frame document -->
    <!ENTITY thisgoal "master_2">
    <!ENTITY thatgoal "master_2">
    <!ENTITY anothergoal "master_2">


  then the entities in the included file are still resolved according to the 
entities.ent where they are originally declared, which I find strange.


  I thought the entities would then be resolved according to the declaration of 
the including file, so that the olinks are correctly transformed to internal 
links.


  So it seems that the entities are being resolved before the include takes 
place?




  Any help is appreciated.


  cheers
  Benno

Reply via email to