OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-tc message

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


Subject: Updated transclusion proposal


On 20.8.2014 10:13, Jirka Kosek wrote:
>>   d.  Jirka to update "DocBook Transclusions" document to reflect
>>       the new XInclude 1.1 features.
> 
> Continued, will be ready for September meeting.

Hi folks,

please find first very rough attempt to update transclusions as a layer
on top of XInclude 1.1.

Some features are missing compared to previous draft, but once XInclude
1.1 is implemented solution will be more standards-based.

				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------
Title: DocBook Transclusion

DocBook Transclusion

NaN September 2014


This document describes syntax, semantics and processing model of DocBook transclusion mechanism. Please be aware that this is early stage draft – everything described below might change or disappear completely. This proposal tries to resolve Requirements for transclusion in DocBook. DocBook TC welcomes any feedback on this draft, especially from users and developers of DocBook authoring and processing tools. Plese direct your comments to DocBook mailing list by sending email to .

Actually, for now the document is written more like tutorial. If DocBook TC decides to incorporate this into DocBook, more formal and precise specification will follow.

Note

Previous version of this draft proposed new elements ref and def for implementing transclusions. Meanwhile DocBook TC decided that transclusions should rely as much as possible on standard technologies. XInclude 1.1 added new features that allow to implement some transclusion features on top of the XInclude. As a result transclusions were completely redesigned to be layered on top of XInclude 1.1.

This resulted in a loss of some features, notably:

  • It's no longer possible to locally redefine text replacement (see example).

  • anything else?

The following namespace bindings are assumed if namespace prefix is used in the text of this document:

db

DocBook namespace (http://docbook.org/ns/docbook)

xi

XInclude namespace (http://www.w3.org/2001/XInclude)

Transclusion processing

XInclude 1.1 [XI11] in section 4.3 Attribute Copying when processing XML defines new feature which can be used for passing around attributes that control transclusion processing.

Processing model of XInclude 1.1 based transclusion is simple. First XInclude processing is done. Then before normal DocBook processing additional DocBook transclusion step is applied which can modify some attributes.

DocBook transclusion processor must support the following attributes:

db:id

Specifies ID for transcluded content. If there is xml:id attribute present it's value must be replaced by the value of db:id attribute.

If db:id is present, but empty, then xml:id must be removed from the element.

Should we define what to do with db:id after transclusion? Like remove/keep/don't care.

db:idfixup

This attribute controls how IDs are going to be adjusted during transclusion.

none

No ID adjustment is done.

This is default behavior if attribute is not specified. This must be default in order to keep compatibility with XInclude.

strip

All IDs on element descendants are stripped.

prefix

All IDs on element descendants are prefixed with a value specified in db:prefix attribute.

auto

All IDs on element descendants are prefixed with a value which is unique for each element[1]

db:prefix

Prefix to use when db:idfixup="prefix".

db:linkscope

This attribute defines how refences has to be corrected.

user

No IDREF adjustment is done

local

All IDREFs in element are prefixed by user specified prefix (when db:idfixup="prefix") or auto-generated prefix (when db:idfixup="auto").

Using this value with other db:idfixup values is an error.Maybe raising error is too strict approach.

near

All IDREFs in element are adjusted to point to the closest element which has a matching ID. A matching ID doesn't mean string equality between ID and IDREF values – it is sufficient if second part of ID and IDREF after removal of possibly added prefixes is matching.

When searching for the closest element ancestor elements of an element with an IDREF attribute are gradually inspected and matching ID is searched between all their descendants. If there is no matching ID, then parent is inspected and so on until match is found or document root is reached.

global

All IDREFs in element are adjusted to point to the first element in document order which has a matching ID. A matching ID doesn't mean string equality between ID and IDREF values – it is sufficient if the second part of ID and IDREF after removal of possibly added prefixes are matching.

db:*

All other attributes in DocBook namespace will be copied into the corresponding attributes in no namespace. This is especially useful for effectivity attributes.

Special ID/IDREF processing

Transcluded content can contain an xml:id attributes. If one fragment is transcluded more then once then the resulting document after transclusion will contain duplicate IDs. The same problem may arise if IDs are colliding in transcluded modules. To overcome this problem all IDs and references to them can be adjusted during the transclusion process.

How IDs are going to be adjusted during transclusion is controlled by the db:idfixup attribute on the xi:include element.

Of course if IDs are adjusted then all corresponding references has to be also corrected. This is controlled by db:linkscope attribute.

By using various combinations of db:idfixup and db:linkscope attributes we can achieve different linking behavior. The following examples show the effect of using those two attributes. Examples are transcluding the following procedure which contains one internal link and one external (points to target outside of this module).

Example 1. Module with sample procedure

<?xml version="1.0" encoding="UTF-8"?>
<procedure xmlns="http://docbook.org/ns/docbook" xml:id="paper-insert">
  <title>Inserting paper into printer</title>
  <para>This procedure is targeted to printer owners.
    If you don't have printer, consider <link linkend="buy">buying one</link>.</para>  
  <step xml:id="s1"><para>Make sure that you have paper.</para></step>
  <step><para>Insert paper into printer. If you don't have paper consult <xref linkend="s1"/></para></step>
</procedure>

Now lets assume that we want to transclude this module twice to show how we can deal with duplicate IDs problem.

Example 2. Automatic ID/IDREF adjustment

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="d2e22---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e22---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:id="d2e36---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e36---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e36---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
</book>

We have to specify db:idfixup in order to trigger automatic ID/IDREF fixup. All IDs in transcluded modules are automatically prefixed to prevent ID collisions. Then IDREFs are fixed so that links point to the nearest possible target. For example the link from step 2 to step 1 in procedure always points to the same instance of procedure. However buy link is pointing correctly to target in the main document.


Example 3. Global linkscope

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto" db:linkscope="global"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="d2e22---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e22---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:id="d2e36---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e36---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
</book>

We used db:linkscope="global" on the second transclusion. Result is that link from step 2 in the second procedure now links to step 1 in the first procedure.


Example 4. Local linkscope

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto" db:linkscope="local"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="d2e22---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="d2e22---buy">buying one</link>.</para>
      <step xml:id="d2e22---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:id="d2e36---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e36---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e36---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
</book>

We used db:linkscope="local" on the first transclusion. This means that no link from this transclusion can point outside of this transclusion. Because there was such link (buy link), thus the result of transclusion is broken because there is no corresponding target for IDREF d2e22---buy.


Example 5. Manually assigned prefix

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:id="install-proc" db:idfixup="prefix" db:prefix="install-proc_"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:id="maintain-proc" db:idfixup="prefix" db:prefix="maintain-proc_"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="install-proc_paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="install-proc_s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref
            linkend="install-proc_s1"/></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:id="maintain-proc_paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="maintain-proc_s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref
            linkend="maintain-proc_s1"/></para>
      </step>
    </procedure>
  </chapter>
</book>

If we care about the resulting IDs after transclusion we can manually assign some meaningful prefix before IDs in transcluded document.


Example 6. Disabling ID fixup

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="s1"/></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:id="paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="s1"/></para>
      </step>
    </procedure>
  </chapter>
</book>

Default behaviour of XInclude is not to do any postprocessing like DocBook transclusions. The resulting document thus contain duplicated IDs.


Example 7. Stripping IDs

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:idfixup="auto"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:idfixup="strip"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="d2e22---paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="d2e22---s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step>
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="d2e22---s1"
          /></para>
      </step>
    </procedure>
  </chapter>
</book>

We have stripped all IDs from the second transcluded procedure by db:idfixup="strip". Thus there are no duplicate IDs in the resulting document and links from second procedure always target first one. However IDs in the first procedure were automatically prefixed.


Example 8. Retaining original IDs

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:db="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <xi:include href="procedure.001.xml" db:linkscope="user"/>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <xi:include href="procedure.001.xml" db:idfixup="strip" db:linkscope="user"/>
  </chapter>
</book>

Result of transclusion:

<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
  <title>Definitive Printer Guide</title>
  <chapter xml:id="buy">
    <title>Buying printer</title>
    <para>Grab money, go to shop, ...</para>
  </chapter>
  <chapter>
    <title>Quick installation guide</title>
    <para>Carefully follow all procedures bellow.</para>
    <procedure xml:id="paper-insert"
      xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step xml:id="s1">
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="s1"/></para>
      </step>
    </procedure>
  </chapter>
  <chapter>
    <title>Maintenance</title>
    <para>Be friendly to your printer when you speak to it.</para>
    <para>If green led is blinking, please add missing paper using the following procedure.</para>
    <procedure xml:base="file:/e:/texts/docbook/tc/transclusions/procedure.001.xml">
      <title>Inserting paper into printer</title>
      <para>This procedure is targeted to printer owners. If you don't have printer, consider <link
          linkend="buy">buying one</link>.</para>
      <step>
        <para>Make sure that you have paper.</para>
      </step>
      <step>
        <para>Insert paper into printer. If you don't have paper consult <xref linkend="s1"/></para>
      </step>
    </procedure>
  </chapter>
</book>

We have stripped all IDs from the second transcluded procedure by db:idfixup="strip". Thus there are no duplicate IDs in the resulting document and links from second procedure always target first one. IDs in the first procedure were not automatically prefixed since we haven't specified db:idfixup.


Should be there option to preserve original IDs (without prefix) in output when doing prefixes?

A. Sample transclusion processor written in XSLT 2.0

Please note that this sample transclusion processor is not yet feature complete. It supports only subset of proposal.

Bibliography

[XI11] XML Inclusions (XInclude) Version 1.1. W3C Candidate Recommendation. 8 October 2013. Available at http://www.w3.org/TR/2013/CR-xinclude-11-20131008/



[1] For example XSLT based implementations can use generate-id() to generate such unique prefix.

Attachment: signature.asc
Description: OpenPGP digital signature



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