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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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


Subject: Re: [docbook-apps] Olinks failing -- CaseA NOT matched, No case matchedfor lang 'en'


Hi Bob et al,

Hope that I've managed to include the key to deciphering this issue 
somewhere in this big batch of data.

Bob Stayton wrote:

Most likely the problem is in setting up the olinkdb.xml.  That file 
must be manually constructed.  It references (through XInclude or system 
entity references) the target files for each book, which are generated 
by the stylesheet when the $collect.xref.targets parameter is set to 'yes'.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
> Hi,
> This should work.  Can you provide more details on your olinkdb.xml 
> file and how the individual target.db files are generated for each book?
The olinkdb.xml file was recently moved to a higher-level /etc directory 
and is now generated automatically. I've been researching how this is 
built, but haven't got it all figured out yet. Some file used to build 
this file  (sitemap?) is generated from hand-built content, rather than 
the olinkdb.xml itself. I came across this file earlier in my research 
but haven't been able to locate it again. I was going to wait to respond 
until I had all this info sorted out and diagrammed, but it is complex 
and time-consuming so I'm sending along the info I have now in hopes it 
will help. The olinkdb.xml looks like this:

<?xml version="1.0"?>
 
<!-- Generated File DO NOT EDIT -->
<targetset>
  <targetsetinfo>
Kavi Help Crossreference
</targetsetinfo>
  <sitemap>
      <dir name="members">
        <dir name="user_help">
          <dir name="html">
            <document targetdoc="MembersHelp">
        <xi:include 
href="/export/home/tburnham/tbkorg30/dev/dotorg/share/cgi-lib/python/Prod\
ucts/Members/Khelp/user_help/xml/target.db"
          xmlns:xi="http://www.w3.org/2001/XInclude"; />
      </document>
          </dir>
        </dir>
      </dir>
...
  </sitemap>
</targetset>

The main Makefiles and custom xsl files live in the top-level help 
directory:

olinkdb.xml.default
olinkdb.xml.xslt
Makefile                                
Makefile.inc                              Sets target.database.document
kavi_chunk.xsl                         New
kavi_docbook.xsl                      Unchanged
misc other custom xsls (footer, header)

Pls let me know if you need me to forward any material from any of these 
files.

In lower level directories, each application has its own help directory 
and Makefile that sets various paths. The local Makefiles point to the 
global Makefile.inc. Each lower-level application has its own xml book 
and html directory for html output. Chapters are chunks.

/usr/bin/xsltproc --xinclude --stringparam collect.xref.targets  "only" \
    
/export/home/tburnham/tbkorg30/dev/dotorg/share/cgi-lib/python/Products/DotOrg/Khelp/kavi_chunk.xsl 
index.xml
Writing target.db for book(DotOrgHelp)
perl -ni -e'print unless $.==1 and /^<!DOCTYPE/' target.db

This is taking kavi_chunk.xsl as input, and writes the target.db for the 
book.

----------------

$collect.xref.targets is set in Makefile.inc and is set to 'only'

Something interesting happened when I set this to 'yes'. The olinks 
still failed, but html files were added to /xml as well as /html.

Here is the error from running 'make target.db' in the application help 
directory (as opposed to the top-level or global help directory):

Olinks not processed: must specify a $target.database.document parameter
when using olinks with targetdoc and targetptr attributes.
Olink debug: root element of target.database '' is 'book'.
Olink debug: cases for targetdoc='DotOrgHelp' and 
targetptr='gloss_test_def' in language 'en'.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang 'en'.
Olink debug: cases for targetdoc='DotOrgHelp' and 
targetptr='gloss_test_def' in language ''.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang ''.
Error: unresolved olink: targetdoc/targetptr = 'DotOrgHelp/gloss_test_def'.

Errors from running 'make html' in this same directory look like this:

Olink debug: root element of target.database 
'/export/home/tburnham/tbkorg30/dev/dotorg/etc/olinkdb.xml' is 'targetset'.
Olink debug: cases for targetdoc='KEditorHelp' and 
targetptr='edit_content_tab_overview' in language 'en'.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang 'en'.
Olink debug: cases for targetdoc='KEditorHelp' and 
targetptr='edit_content_tab_overview' in language ''.
Olink debug: CaseA NOT matched
Olink debug: No case matched for lang ''.
Error: unresolved olink: targetdoc/targetptr = 
'KEditorHelp/edit_content_tab_overview'.

------------------------
Paths to the new olinkdb.xml are set in the Makefiles, both global and local

OLINK_DB = $(DOTORGPATH)/etc/olinkdb.xml

The are used in Makefile.inc to populate target.database.document

        --stringparam target.database.document $(OLINK_DB)

DOTORGPATH is set in top-level Makefile and in local Makefiles
In the Members/ Makefile it looks like this:
DOTORGPATH := $(shell cd ../../../../../../../../; pwd)
>
> Also, the HTML output of Kavi Member Help that you included did not 
> include the chapter content with the olink.  I see the Table of 
> Contents chunk (index.html probably), but I think you intended to show 
> the chapter chunk. I searched for "Click here to see ..." and it 
> appeared only in the source file you provided.
Here are those files:

----------index.xml-------------------

<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//en"
                  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>

  <book id="kmembers_help">
  <title>Kavi&#174; Members Help</title>
  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
    href="admin_pages/part_admin.xml">
    <xi:fallback>
      <para><emphasis>FIX ME: missing XInclude content</emphasis></para>
    </xi:fallback>
  </xi:include>

</book>

----------part_admin.xml-------------------

<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.2//en"
                  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>

<part label="VII" id="part_admin">
  <title>Kavi Members Admin Tools</title>
  <partintro>
    <para>Tools that Organization Admins use to manage users,
      companies, memberships and email notifications.</para>
  </partintro>
  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
    href="test.xml">   
    <xi:fallback>
    <para><emphasis>FIX test.xml</emphasis></para>
  </xi:fallback>
</xi:include>

 </part>
----------test.xml-------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//en"
                  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
                 
<chapter id="test">
  <title>Test Chapter</title>
  <sect1 id="test_tinclude">
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
       href="../common.xml#xpointer(id('test_include_with_gloss_ref')/*)" />
    <para>The preceding was brought to you by an include into the 
common.xml.</para>
  </sect1>
  <sect1 id="test_direct">
    <title>Test Direct Olink to Gloss</title>
     <para>Click here to see the gloss def: <olink
    targetdoc="DotOrgHelp" targetptr="gloss_test_def">
    test direct link</olink>.</para>
  </sect1>
  <sect1 id="test_other_doc">
    <title>Test Direct Olink to Other Doc</title>
     <para>Click here to see the link to kavi edit help: <olink
    targetdoc="KEditorHelp" targetptr="edit_content_tab_overview">
    test kedit link</olink>.</para>
  </sect1>

</chapter>

---------------------test.html (chapter)---------------------------
<h1 class="appname">KaviŽ Members Help</h1><div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter 1. Test Chapter</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="part_admin.html"><img 
src="/kicons/dotorg/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center">Part VII. Kavi Members Admin Tools</th>
<td width="20%" align="right"> </td>
</tr>
</table>
<hr>
</div><div class="chapter" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="test"></a>Chapter 1. Test Chapter</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="sect1"><a href="test.html#test_tinclude">Include with 
Gloss Ref</a></span></dt>
<dt><span class="sect1"><a href="test.html#test_direct">Test Direct 
Olink to Gloss</a></span></dt>
<dt><span class="sect1"><a href="test.html#test_other_doc">Test Direct 
Olink to Other Doc</a></span></dt>
</dl>
</div>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="test_tinclude"></a>Include with Gloss Ref</h2></div></div></div>
<p>Here's some plain text, and here's the link to the glossary:
       <span class="olink">test def</span>.</p>
<p>The preceding was brought to you by an include into the common.xml.</p>
<a href="#top" class="smalltext">Back to top</a>
</div>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="test_direct"></a>Test Direct Olink to Gloss</h2></div></div></div>
<p>Click here to see the gloss def: <span class="olink">
    test direct link</span>.</p>
<a href="#top" class="smalltext">Back to top</a>
</div>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="test_other_doc"></a>Test Direct Olink to Other 
Doc</h2></div></div></div>
<p>Click here to see the link to kavi edit help: <span class="olink">
    test kedit link</span>.</p>
<a href="#top" class="smalltext">Back to top</a>
</div>
</div><div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="part_admin.html"><img 
src="/kicons/dotorg/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"><a accesskey="u" 
href="part_admin.html"><img src="/kicons/dotorg/up.png" alt="Up"></a></td>
<td width="40%" align="right"> </td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Part VII. Kavi Members Admin 
Tools </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img 
src="/kicons/dotorg/home.png" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> </td>
</tr>
</table>
</div>

>
> Also, can you indicate what the old and new versions of the stylesheet 
> are, and whether you are using the namespaced stylesheets or not?

DocBook XSL version = release 1.70.1 (debian unstable package)
enough info to help. Apologies to all for the length.

$ xsltproc -version
Using libxml 20627, libxslt 10119 and libexslt 813
xsltproc was compiled against libxml 20627, libxslt 10119 and libexslt 813
libxslt 10119 was compiled against libxml 20627
libexslt 813 was compiled against libxml 20627

We don't appear to use the namespaced stylesheets.

> Thanks.
>
> Bob Stayton
> Sagehill Enterprises
> bobs@sagehill.net
>
>
> ----- Original Message ----- From: "Teya Burnham" <tburnham@kavi.com>
> To: <docbook-apps@lists.oasis-open.org>
> Sent: Wednesday, September 24, 2008 5:57 PM
> Subject: [docbook-apps] Olinks failing -- CaseA NOT matched, No case 
> matched for lang 'en'
>
>
>> The olinks in our help used to all work (in February 2008 for 
>> example). Now they all fail.
>>
>> Earlier this year we upgraded to a newer version of docbook, so 
>> perhaps some change in the xsl is causing this to happen.
>
Muchas gracias!

-- 

Teya Burnham

Product Documentation Specialist
Kavi Corporation
DDN 503.813.9378
tburnham@kavi.com

Advance the Standard!



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