You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Philip Crotwell <cr...@seis.sc.edu> on 2000/07/20 16:17:16 UTC

XSL DocBook Stylesheets 1.15 and xalan_1_1

Hi

I'm trying to use the docbook stylesheet from nwalsh.com but am having
2 possibly unrelated problems with xalan.

First I get errors like:
java org.apache.xalan.xslt.Process -IN docbook/test/docbook40.xml -XSL
docbook/html/docbook.xsl -OUT docbook40.html
========= Parsing file:/home/crotwell/XML/docbook/html/docbook.xsl
==========
Parse of file:/home/crotwell/XML/docbook/html/docbook.xsl took 3083
milliseconds
========= Parsing file:/home/crotwell/XML/docbook/test/docbook40.xml
==========
Parse of file:/home/crotwell/XML/docbook/test/docbook40.xml took 8256
milliseconds
=============================
Transforming...
Parser error: Element type "internationalization" must be declared.
Parser error: Element type "localization" must be declared.
[Error] attribute language not found in element type localization
Parser error: Attribute "language" must be declared for element type
"localization".
Parser error: Element type "gentext" must be declared.
[Error] attribute key not found in element type gentext
Parser error: Attribute "key" must be declared for element type "gentext".
[Error] attribute text not found in element type gentext
Parser error: Attribute "text" must be declared for element type
"gentext".
...
Parser error: Element type "dingbat" must be declared.
[Error] attribute key not found in element type dingbat
Parser error: Attribute "key" must be declared for element type "dingbat".
[Error] attribute text not found in element type dingbat
Parser error: Attribute "text" must be declared for element type
"dingbat".
...

I assume these are missing tags. Should they be in the docbook xsl xml or
are they defined elsewhere and I don't have everything installed
correctly?


The second error at the bottom is:

XSL Error: pattern = '($node/docinfo
|$node/chapterinfo
|$node/appendixinfo
|$node/prefaceinfo                                      |$node/bookinfo
|$node/setinfo                                      |$node/articleinfo
|$node/artheader                                      |$node/sect1info
|$node/sect2info                                      |$node/sect3info
|$node/sect4info                                      |$node/sect5info
|$node/refsect1info
|$node/refsect2info
|$node/refsect3info
|$node/bibliographyinfo
|$node/glossaryinfo                                      |$node/indexinfo
|$node/refentryinfo                                      |$node/partinfo
|$node/referenceinfo)[1]'
unknown axis: 29, source tree node: #document
XPATH: pattern = '($node/docinfo
|$node/chapterinfo
|$node/appendixinfo
|$node/prefaceinfo                                      |$node/bookinfo
|$node/setinfo                                      |$node/articleinfo
|$node/artheader                                      |$node/sect1info
|$node/sect2info                                      |$node/sect3info
|$node/sect4info                                      |$node/sect5info
|$node/refsect1info
|$node/refsect2info
|$node/refsect3info
|$node/bibliographyinfo
|$node/glossaryinfo                                      |$node/indexinfo
|$node/refentryinfo                                      |$node/partinfo
|$node/referenceinfo)[1]'
unknown axis: 29
Xalan: was not successful.
XSLProcessor: done

Has anyone else been able to get docbook to work with xalan_1_1?

Thanks,
Philip




Re: XSL DocBook Stylesheets 1.15 and xalan_1_1

Posted by Gary L Peskin <ga...@firstech.com>.
Philip --

This is a bug in Xalan.  Here is a fix:

The following changes should make your example work by fixing this
problem with union:

Index: SimpleNodeLocator.java
===================================================================
RCS file:
/home/cvspublic/xml-xalan/src/org/apache/xalan/xpath/SimpleNodeLocator.java,v
retrieving revision 1.23
diff -r1.23 SimpleNodeLocator.java
234a235
>     int endOfUnion = xpath.getNextOpPos(opPos);
239c240,241
<     while(xpath.m_opMap[opPos] > 0)
---
>     // while(xpath.m_opMap[opPos] > 0)
>     while (opPos < endOfUnion)
====================================================================

In other words, in org.apache.xalan.xpath.SimpleNodeLocator, method
union add the line:

     int endOfUnion = xpath.getNextOpPos(opPos);

after 

     XNodeSet resultNodeSet = null;

at the beginning of the method.

Then, change the while from

     while(xpath.m_opMap[opPos] > 0)

to

     while(opPos < endOfUnion)

HTH,
Gary

Philip Crotwell wrote:
> 
> Hi
> 
> I'm trying to use the docbook stylesheet from nwalsh.com but am having
> 2 possibly unrelated problems with xalan.
> 
> First I get errors like:
> java org.apache.xalan.xslt.Process -IN docbook/test/docbook40.xml -XSL
> docbook/html/docbook.xsl -OUT docbook40.html
> ========= Parsing file:/home/crotwell/XML/docbook/html/docbook.xsl
> ==========
> Parse of file:/home/crotwell/XML/docbook/html/docbook.xsl took 3083
> milliseconds
> ========= Parsing file:/home/crotwell/XML/docbook/test/docbook40.xml
> ==========
> Parse of file:/home/crotwell/XML/docbook/test/docbook40.xml took 8256
> milliseconds
> =============================
> Transforming...
> Parser error: Element type "internationalization" must be declared.
> Parser error: Element type "localization" must be declared.
> [Error] attribute language not found in element type localization
> Parser error: Attribute "language" must be declared for element type
> "localization".
> Parser error: Element type "gentext" must be declared.
> [Error] attribute key not found in element type gentext
> Parser error: Attribute "key" must be declared for element type "gentext".
> [Error] attribute text not found in element type gentext
> Parser error: Attribute "text" must be declared for element type
> "gentext".
> ...
> Parser error: Element type "dingbat" must be declared.
> [Error] attribute key not found in element type dingbat
> Parser error: Attribute "key" must be declared for element type "dingbat".
> [Error] attribute text not found in element type dingbat
> Parser error: Attribute "text" must be declared for element type
> "dingbat".
> ...
> 
> I assume these are missing tags. Should they be in the docbook xsl xml or
> are they defined elsewhere and I don't have everything installed
> correctly?
> 
> The second error at the bottom is:
> 
> XSL Error: pattern = '($node/docinfo
> |$node/chapterinfo
> |$node/appendixinfo
> |$node/prefaceinfo                                      |$node/bookinfo
> |$node/setinfo                                      |$node/articleinfo
> |$node/artheader                                      |$node/sect1info
> |$node/sect2info                                      |$node/sect3info
> |$node/sect4info                                      |$node/sect5info
> |$node/refsect1info
> |$node/refsect2info
> |$node/refsect3info
> |$node/bibliographyinfo
> |$node/glossaryinfo                                      |$node/indexinfo
> |$node/refentryinfo                                      |$node/partinfo
> |$node/referenceinfo)[1]'
> unknown axis: 29, source tree node: #document
> XPATH: pattern = '($node/docinfo
> |$node/chapterinfo
> |$node/appendixinfo
> |$node/prefaceinfo                                      |$node/bookinfo
> |$node/setinfo                                      |$node/articleinfo
> |$node/artheader                                      |$node/sect1info
> |$node/sect2info                                      |$node/sect3info
> |$node/sect4info                                      |$node/sect5info
> |$node/refsect1info
> |$node/refsect2info
> |$node/refsect3info
> |$node/bibliographyinfo
> |$node/glossaryinfo                                      |$node/indexinfo
> |$node/refentryinfo                                      |$node/partinfo
> |$node/referenceinfo)[1]'
> unknown axis: 29
> Xalan: was not successful.
> XSLProcessor: done
> 
> Has anyone else been able to get docbook to work with xalan_1_1?
> 
> Thanks,
> Philip