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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: [docbook] can an anchor be a target for an olink?


Hi Nat,
There are two levels of error messages. The target database file is first opened with the XSL document() function:

  <xsl:variable name="target.database"
      select="document($target.database.filename,/)"/>

If it could not find that file, then the XSLT processor (not the stylesheet) would generate an error message about the file not found. For example, xsltproc generates an error like this:

   warning: failed to load external entity "olinkdb.xml"

If the file exists you should not see that particular error. But since the document() function can only open XML files, if there is a problem parsing the XML file, then such parsing errors should be reported as well.

The message you are seeing is coming from this test:

<xsl:when test="not($target.database/*)">
 <xsl:message>
 <xsl:text>Olink error: could not open target database '</xsl:text>

This tests whether the target database file that it opened has a root element. If the document() function failed earlier (with its message), then you will also get this message because the resulting variable is empty and has no root element.

So do you see any error message upstream from the first one you showed here?

Can you open the target database file with an XML editor without parsing errors?

Are we dealing with Windows paths here?  Any other details of your setup?

--
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

On 1/15/2014 3:18 PM, natk wrote:
Which brings me to ask, why am I getting that error? I get the following
trace with olink.debug switched on:

Olink error: could not open target database '/Absolute/path/to/file'
Olink debug: root element of target.database is 'stylesheet'.
Olink debug: cases for targetdoc='TargetDoc' and targetptr='anchor' in
language 'en'.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang 'en'.
Olink debug: cases for targetdoc='TargetDoc' and targetptr='anchor' in
language ''.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang ''.
Error: unresolved olink: targetdoc/targetptr = 'TargetDoc/anchor'.

If I try and list my target database file then it is present on the file
system.

Do the stylesheets give this error when they can't find the file (which
should not be happening), or if they cannot parse the file. If it is the
second case, how do I determine what the error is?)

Nat


On Thu, Jan 16, 2014 at 9:18 AM, natk <nkershaw@gmail.com
<mailto:nkershaw@gmail.com>> wrote:

    Ok, thanks for that, I am getting processing errors (Olink error:
    could not open target database) and I thought this might be the
    reason. It doesn't sound like it though.

    Nat




    On Thu, Jan 16, 2014 at 6:53 AM, Bob Stayton <bobs@sagehill.net
    <mailto:bobs@sagehill.net>> wrote:

        Hi Nat,
        olinks to anchor elements should work to form a link, the
        question is what text will it generate.  An anchor element does
        not have a title (it is defined as an empty element), so I'm not
        surprised the <ttl> element is empty.  The link text will be the
        content of the xreftext element in the database, which, for lack
        of any other text, falls back to the ancestor section title.
          You should be able to override that by adding an xreflabel
        attribute to the anchor element.

        The <ttl> element and @number attributes in the olink database
        are only used when an olink has an @xrefstyle attribute to
        select specific components like title or label.

        --
        Bob Stayton
        Sagehill Enterprises
        bobs@sagehill.net <mailto:bobs@sagehill.net>


        On 1/14/2014 11:39 PM, natk wrote:

            I am generating an olink db from a docbook file which
            contains anchors.

            e.g.

            <section id="id1">
                <title>Title</title>
                <table border="1">
            ...
                  <tbody>
                  <tr>
                     <td><anchor id="id2"/>Text</td>
            ....

            The olinkdb file getting generated from this does not
            produce a title:

            <obj element="anchor"
                   href="File.html#id2"
                   number="" targetptr="id2">
                   <ttl>???TITLE???</ttl>
                   <xreftext>Section 1.1.3, “Section Title”</xreftext>
            </obj>

            Are anchors allowed as targets for olinks? If so, what do I
            need to change?

            I am using the maven-docbkx-plugin with version 1.76.1 of
            the stylesheets.

            Nat










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