[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook] Xi:includes and Entity Parameters
Sounds like a job for catalog files: http://www.sagehill.net/docbookxsl/Catalogs.html With a catalog file, you map any public or system identifier to a local copy. The location of the resource can be relative to the catalog file. David > -----Original Message----- > From: Dermot O'H [mailto:dermot.ohalloran@gmail.com] > Sent: Monday, June 29, 2009 11:39 AM > To: docbook@lists.oasis-open.org > Subject: [docbook] Xi:includes and Entity Parameters > > > Hi all, > > I've got a DocBook guide comprised of chapters maintained in > individual files that are imported using xi:includes: > > <book> > <title>My Book</title> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-1.xml"/> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-2.xml"/> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-3.xml"/> > </book> > > As you can see, all included files are in the guide's own > root directory. > I've also defined shared text entities within a file called > entities.ent located in the guide's root directory aswell: > > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" > "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ > <!ENTITY % myents SYSTEM "entities.ent" > %myents; ]> > > <book> > <title>My Book</title> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-1.xml"/> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-2.xml"/> > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="chapter-3.xml"/> > </book> > > Each xi:include file must contain the above parameter entity > declaration and reference in its DOCTYPE - this is fine by me > as it's only in a few cases and is very manageable. > > Now, I also wish to xi:include a common chapter located > within a global directory. I do this as follows: > > ... > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > href="../../global/common-chapter.xml"/> > ... > > The problem is that if I try to reference one of the entities (e.g. > &productname; ) within the common-chapter.xml file it will > not resolve due to the way xi:inlcude works: the > common-chapter.xml file will expect the entities.ent file to > be located within its root directory.(i.e. > "../../global/entities.ent") and not in the guide's root > directory (where the entities.xml file does reside). > > Is there a way around this problem? I am restricted to using > relative paths due to our build system and the different OS > environments it works in. It's not possible for me to > reference an entities file via an absolute path such as > http://myserver/entities.ent. Again, this is due to our build > system and the way we use version control. > > Is there some way to stop the included common-chapter.xml > from resolving the entities.ent file relative to its location > and use the location of the root guide instead? Or perhaps an > alternative method of importing a global file that resolves > entities based on the guide doing the importing? > > Thanks! > > D. > -- > View this message in context: > http://www.nabble.com/Xi%3Aincludes-and-Entity-Parameters-tp24 102062p24102062.html > Sent from the docbook General mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-help@lists.oasis-open.org > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]