[docbook-apps] Multiple named references to a single refentry page?

2014-07-24 Thread Jon Leech

The GL man pages I maintain have a number of pages that describe several
closely-related commands, e.g. 
https://www.opengl.org/sdk/docs/man/html/glEnable.xhtml
which describes the commands glEnable, glDisable, glEnablei, and glDisablei. 
We'd like
to be able to refer to this page by any of these names from other pages, e.g.

The commands 
citerefentryrefentrytitleglEnable/refentrytitle/citerefentry
and citerefentryrefentrytitleglDisable/refentrytitle/citerefentry may be
used to enable and disable blending.

However, a page has only one refentrytitle and citerefentry doesn't know 
anything
about the others, so doing this just results in a bogus link to glDisable.xhtml
in the generated output (see 
https://www.opengl.org/sdk/docs/man/html/glBlendFunc.xhtml).

Is there an alternate way to refer to the same refentry by multiple names, 
e.g.
by the multiple refname tags which are allowed?

Thanks,

Jon Leech

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



[docbook-apps] Table frame partly disappears for cells with morerows=1

2013-11-23 Thread Jon Leech

I'm trying to generate a table where each cell has full borders. This works OK 
until
I try generate a header cell spanning two rows with entry morerows=1, in 
which case
no border seems to be generated at the bottom of the cell. The cell borders are 
being
defined by setting table.frame.border.thickness and table.cell.border.thickness 
each
to 2px in the stylesheet customization, and default.table.frame to all. 
Liberal
use of rowsep=1 in the table entry elements seems to make no difference. Am 
I
missing something here or is there possibly a bug in the stylesheets?

Interestingly a body cell with morerows=1 does generate the bottom border, this
only seems to happen for head cells.

This is using XSL-NS 1.78.1 and generating output index.xhtml via

xsltproc --noout --nonet --xinclude test.xsl test.xml

Minimal case attached including rendered results.

Thanks,
Jon
refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=abs
refmeta
refentrytitleabs/refentrytitle
/refmeta
refsect1
informaltable
tgroup cols=3
colspec/
colspec/
colspec/
thead
row
entry morerows=1 head,cell(morerows=1) /entry
entryhead,cell/entry
entry morerows=1 head,cell(morerows=1)/entry
/row
row
!-- First  third columns filled by morerows above --
entryhead,cell/entry
/row
/thead
tbody
row
entry morerows=1cell(morerows=1)/entry
entry morerows=1cell(morerows=1)/entry
entrycell/entry
/row
row
!-- First two columns filled by morerows above --
entrycell/entry
/row
row
entrycell/entry
entrycell/entry
entrycell/entry
/row
/tbody
/tgroup
/informaltable
/refsect1
/refentry


index.xhtml
Description: application/xhtml


test.pdf
Description: Adobe PDF document


test.xsl
Description: application/xslt

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

[docbook-apps] generate.citerefentry.link customization not emitting refentrytitle contents in XSL-NS stylesheets

2013-11-08 Thread Jon Leech

I've got a Docbook 5 refentry page including


citerefentryrefentrytitleglDepthRange/refentrytitle/citerefentry

and a stylesheet customization of ...xsl-ns/current/xhtml5/onechunk.xsl
including

xsl:param name=citerefentry.link select='1'/xsl:param
xsl:template name=generate.citerefentry.linkxsl:value-of 
select=refentrytitle/xsl:text.xhtml/xsl:text/xsl:template

When I process this with e.g.

xsltproc testref.xsl testref.xml

the generate.citerefentry.link template is run, but does not emit the
refentrytitle contents in testref.xhtml. I expect to see

a class=citerefentry href=glDepthRange.xhtmlspan class=citerefentryspan 
class=refentrytitleglDepthRange/span/span/a

but in fact get

...href=.xhtml...

Did something change about the way this template should be coded between
the XSL and XSL-NS stylesheets? When I change the stylesheet in testref.xsl to
the old ...release/xsl/current/xhtml5/onechunk.xsl, the generated link
comes out correctly. This is using the the 1.78.1 releases of both XSL and
XSL-NS, as packaged by Debian.
Thanks,
Jon Leech



testref.xhtml
Description: application/xhtml


testref.xsl
Description: application/xslt
refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=testref
refnamediv
	refnametestref/refname
	refpurposetest citerefentry/refentrytitle/refpurpose
/refnamediv
refsect1 xml:id=seealsotitleSee Also/title
	para
	citerefentryrefentrytitleglDepthRange/refentrytitle/citerefentry
	/para
/refsect1
/refentry


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Re: [docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer

2013-11-05 Thread Jon Leech

On 11/04/2013 08:55 PM, Alexey Neyman wrote:

Not exactly. The namespaces in XML are identified by URI, not by prefix. In
other words, the same prefix (an empty prefix in your case) can refer to
different URIs in different XML documents.

Thus, the stylesheet you're customizing declares empty (default) namespace
prefix to point to http://www.w3.org/1999/xhtml URI. When you add a
customization layer, you didn't specify the prefix for the default namespace,
so XSLT processor assumed the script/ element belongs to a namespace with no
URI. As its parent element had default namespace pointing to a different URI,
it redeclared the default namespace for script/ to an empty string.

You can add the xmlns=http://www.w3.org/1999/xhtml; declaration to the
xsl:stylesheet/ element in your customization layer to avoid declaring it on
each element.


Thanks, Alexey. That helps simplify the XSL I'm writing and also helps in
getting my head around this stuff after about a 6 year gap.
Jon Leech


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



[docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer

2013-11-04 Thread Jon Leech

I'm attempting to customize

http://docbook.sourceforge.net/release/xsl-ns/current/xhtml5/onechunk.xsl

to insert MathJax script elements in the head of my output documents,
by defining the user.head.content template to include my script elements:

xsl:template name=user.head.content exclude-result-prefixes=
script type=text/x-mathjax-config
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
/script
script type=text/javascript

src=http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML;
/script
/xsl:template

This does output the script tags when put through xsltproc (and also
echoes part of the generated document to stdout for reasons I'm unclear on,
but that's a separate weird thing). The problem is that it also adds an
unwanted xmlns= attribute in the output elements:

script xmlns= type=text/x-mathjax-config
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
/script
script xmlns= type=text/javascript 
src=http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/

The xmlns= then prevents the MathJax scripts from executing
correctly. I am trying to figure out how to suppress it. Adding
exclude-result-prefixes=
to the xsl:stylesheet element of my customization layer changes
nothing. This kind of makes sense, since the attribute says it
takes a whitespace-separated list of names, while the name I'm
trying to suppress is the empty string. But that seems to be the
extent of the control available over namespaces in the output,
so I'm at a loss now.

I've attached a test document and stylesheet that behave as
described when run with the xsl-ns stylesheets rev 1.78.1 and

xsltproc --nonet --xinclude test.xsl test.db

I'm guessing I've run into some sort of conceptual misunderstanding
of how XSLT treats namespaces, but haven't been able to find the right
documentation to clear it up, yet.

Thanks,
Jon Leech
refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=test
refmeta
refentrytitlegltest/refentrytitle
manvolnum3G/manvolnum
/refmeta
refnamediv
refnamegltest/refname
refpurposeset the viewport/refpurpose
/refnamediv
refsynopsisdiv
funcsynopsis
funcprototype
funcdefvoid functionglTest/function/funcdef
paramdefGLint parameterx/parameter/paramdef
/funcprototype
/funcsynopsis
/refsynopsisdiv
/refentry


test.xsl
Description: application/xslt

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Re: [docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer

2013-11-04 Thread Jon Leech

On 11/04/2013 05:49 PM, Jon Leech wrote:

 This does output the script tags when put through xsltproc (and also
echoes part of the generated document to stdout for reasons I'm unclear on,
but that's a separate weird thing). The problem is that it also adds an
unwanted xmlns= attribute in the output elements:


Partly answering my own question: after some semi-guesswork
pattern-matching I discovered that if I add
 xmlns=http://www.w3.org/1999/xhtml;
to the script elements in my test.xsl, the generated script
elements have no namespace. I even sort of understand
why this happens now.
Still no idea why xsltproc is echoing part of my generated
.xhtml file to stdout, though. I assume something in the stylesheet
is actually responsible for this.
Jon Leech


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] db4-upgrade.xsl dropping

2013-11-03 Thread Jon Leech

On 11/02/2013 04:53 AM, Thomas Schraitle wrote:

Hi Jon,

Am Samstag, 2. November 2013, 03:08:33 schrieb Jon Leech:

[...]
  the resulting Docbook 5 file drops the title element from the
refsynopsisdiv section (but not from the converted refsect1 section).
[...]
# Release: $Id: db4-upgrade.xsl 7660 2008-02-06 13:48:36Z nwalsh $


This is a very old version. The current version is:

# Release: $Id: db4-upgrade.xsl 9783 2013-08-21 21:40:54Z rlhamilton $

If I try your document with version 9783 it works.


Thank you. That does help with this particular problem but introduces
a new one: varlistentry elements containing e.g.
termparameterx/parameter/term
in the DB4 source are converted to
termx/term

The changes between the revs 7660 and 9783 of db4-upgrade.xsl were
large and it's not easy to figure out why this behavior change
occurred, given my limited understanding of XSL. I suspect I'll be
better off accepting the issues from one or the other version and
fixing them up after the translation.

Jon Leech




-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] db4-upgrade.xsl dropping

2013-11-03 Thread Jon Leech

On 11/03/2013 04:56 AM, Thomas Schraitle wrote:

Could you add the following 3 lines into the latest db4-upgrade.xsl stylesheet
and try it again?

-
  xsl:template match=* mode=clean-terms
 xsl:apply-templates select=. mode=copy/
  /xsl:template
-

(You can add it below the xsl:template match=glossterm|term template
rule).

The above template rule just copies any element inside term unless it is a
classsynopsis, cmdsynopsis, or any other special element. These are handled
differently.

If it works for you, I can update the stylesheet in the SVN repository.


Thank you, Thomas! That lets through the various legal elements within
term and so seems to solve all the issues I've encountered to date with
the conversion. I did ask the Debian docbook5-xml package maintainers to
sync up with the Docbook top-of-trunk release, so hopefully the prepackaged
version will eventually get up to date as well.
Jon Leech



-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



[docbook-apps] db4-upgrade.xsl dropping title elements from refsynopsisdiv

2013-11-02 Thread Jon Leech

If I convert the attached Docbook 4 file via e.g.

xsltproc /usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl db4.xml  
db5.xml

the resulting Docbook 5 file drops the title element from the
refsynopsisdiv section (but not from the converted refsect1 section).
This seems like a bug in the conversion, but I wanted to check that I
wasn't missing something before filing a bug against the Sourceforge
project. The db4-upgrade.xsl version is

# Release: $Id: db4-upgrade.xsl 7660 2008-02-06 13:48:36Z nwalsh $

Thanks,
Jon Leech
?xml version=1.0 encoding=UTF-8?
!DOCTYPE book PUBLIC -//OASIS//DTD DocBook MathML Module V1.1b1//EN
  http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd;
refentry id=glGetError
refmeta
refentrytitleglGetError/refentrytitle
manvolnum3G/manvolnum
/refmeta
refnamediv
refnameglGetError/refname
refpurposereturn error information/refpurpose
/refnamediv
refsynopsisdiv
titleRefsynopsisdiv Title/title
para A paragraph /para
/refsynopsisdiv
refsect1
titleRefsect1 Title/title
para A paragraph /para
/refsect1
/refentry
!-- Converted by db4-upgrade version 1.0 --

refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=glGetError
refmeta
refentrytitleglGetError/refentrytitle
manvolnum3G/manvolnum
/refmeta
refnamediv
refnameglGetError/refname
refpurposereturn error information/refpurpose
/refnamediv
refsynopsisdiv

para A paragraph /para
/refsynopsisdiv
refsectioninfotitleRefsect1 Title/title/info

para A paragraph /para
/refsection
/refentry


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

[docbook-apps] Catalog setup issues in using MathML entity sets (was Re: Should xmllint successfully validate docbook 5 containing XIncludes?)

2013-11-01 Thread Jon Leech

On 10/31/2013 09:36 AM, Bob Stayton wrote:
 Hi Jon,
 I think Carlos meant to use the official MathML namespace instead of a DTD 
reference:

   xmlns:mathml=http://www.w3.org/1998/Math/MathML;

 It seems loading the MathML DTD confused Jing. The DocBook 5 RelaxNG
 schema permits elements in the MathML namespace, but it does not try to
 validate them. But it seems your problem is recognizing the named
 character entities in the MathML DTD. If Jing does not like loading the
 entire MathML DTD as you tried, it would probably accept loading just
 the entity declarations from the DTD. You could try copying the MathML
 dtd to another file and stripping out all *but* the entity declarations.
 Those are conveniently located at the end of the DTD file. Then
 reference that file in the parameter entity in the DOCTYPE to load those
 entities.

 Then Jing should validate against the DocBook 5 RNG schema. If you
 also want to validate the embedded MathML elements, you will need a
 validator compatible with NVDL such as oNVDL (
 http://www.oxygenxml.com/onvdl.html ).

Thanks very much Bob, and Carlos. This is very helpful. If I load
just the four entity declarations I require, jing validates my DB5
source without hanging.

However, I then ran into an issue with the catalog setup. My
system's XML catalog (which includes whatever the Debian docbook and
mathml packages I have installed put there) contains the identifiers for
mathml2.dtd. Loading that also pulls in the co-resident local copies of
the entity sets I need from

http://www.w3.org/TR/xml-entity-names/#sets

But I'm no longer loading mathml2.dtd due to the aforementioned
problems with jing, and neither the public nor system identifiers
corresponding to the specific entity sets I require are in my XML
catalog. So when I try to include them individually in my documents,
with a doctype prolog such as

!DOCTYPE refentry [
!ENTITY % isoamsc PUBLIC
  -//W3C//ENTITIES Added Math Symbols: Delimiters//EN//XML
  http://www.w3.org/2003/entities/2007/isoamsc.ent;

]

they aren't found (unless I allow the processor to fetch them from the
net, which is of course very slow).

Short of tweaking the system XML catalog setup, which is not
something I can expect all of the people who will be using my documents
to understand or want to do, distributing copies of the entity sets
bundled with my Docbook source seems like the simplest way forward.

Would you agree, or am I missing some straightforward way (not
requiring root access, not OS-specific) to make XML lookups for these
specific entity sets check in the same place as mathml2.dtd, even
though their identifiers aren't in the system XML catalog?

Jon Leech


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

2013-10-29 Thread Jon Leech

On 10/28/2013 10:31 PM, Bob Stayton wrote:

The short answer is no, xmllint does not successfully validate DocBook 5 
documents that are in fact valid.

I normally use Jing to validate DocBook 5.  I've not seen it hang like you have.


Thanks, that's good to know going forward. It turns out that stripping the

!DOCTYPE refentry [
!ENTITY % mathml PUBLIC -//W3C//DTD MathML 2.0//EN
  http://www.w3.org/TR/MathML2/dtd/mathml2.dtd;
%mathml;
]

prolog from my documents will prevent jing from hanging. Unfortunately it will 
also
prevent some of them from validating, since they use MathML entities like 
lfloor; .
I filed a bug on the jing project page to ask about this but perhaps I'm missing
some other way to be able to use these entities that would work around this 
issue?

Jon Leech


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



[docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

2013-10-28 Thread Jon Leech

I'm trying to validate some documents generated by the db4-upgrade.xsl from
existing (validating) db4 documents. Validating the resulting db5 results in
mysterious errors that don't seem to correspond to actual problems. Eventually I
figured out that if I inlined content that had originally been XIncluded, the
errors went away. The especially mystifying part is that the reported errors
are in parts of the document having nothing to do with the apparently
offending xi:include element.
Should I expect xmllint to operate properly with XIncludes? xmllint doesn't
have any problems validating the original db4 documents, which also contain
XIncludes, so it seems to be somehow related to db5, but I'm out of my depth at
this point.
I've attached a (relatively) minimal case below; valid.xml inlines
the file, invalid.xml instead XIncludes it. Running

xmllint --noout --xinclude --relaxng http://docbook.org/xml/5.0/rng/docbook.rng 
valid.xml invalid.xml

results in

valid.xml validates
invalid.xml:27: element variablelist: Relax-NG validity error : Expecting 
element example, got variablelist
invalid.xml:37: element variablelist: Relax-NG validity error : Element 
refsection has extra content: variablelist
invalid.xml:34: element refsection: Relax-NG validity error : Element refentry 
has extra content: refsection
invalid.xml fails to validate

but the xi:include element in invalid.xml doesn't occur until line 48, well
after the reported errors.

I attempted using jing on these documents to try and see if this behavior
is an xmllint-specific problem, but it appears to just hang up forever (not the
case with other schema and documents I've used jing on). Are there any
other validators I should be trying on Debian 7?

Thanks,
Jon Leech

!DOCTYPE refentry [
!ENTITY % mathml PUBLIC -//W3C//DTD MathML 2.0//EN
  http://www.w3.org/TR/MathML2/dtd/mathml2.dtd;
%mathml;
]

refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=glTexImage1D
info
copyright
year1991-2006/year
holderSilicon Graphics, Inc./holder
/copyright
/info
refnamediv
refnameglTexImage1D/refname
refpurposespecify a one-dimensional texture image/refpurpose
/refnamediv
refsynopsisdiv
funcsynopsis
funcprototype
funcdefvoid functionglTexImage1D/function/funcdef
paramdefGLenum parametertarget/parameter/paramdef
/funcprototype
/funcsynopsis
/refsynopsisdiv
refsection xml:id=parametersinfotitleParameters/title/info
variablelist
varlistentry
termaterm/term
listitemparatext/para/listitem
/varlistentry
/variablelist
/refsection
refsection xml:id=descriptioninfotitleDescription/title/info
para
/para
variablelist
varlistentry
termconstantGL_RED/constant/term
listitem
para /para
/listitem
/varlistentry
/variablelist
para /para
!-- valid.xml includes the contents of baseformattable.xml inline --
para
table frame=topbotinfotitleBase Internal Formats/title/info
tgroup cols=3 align=left
colspec align=left/
colspec align=left/
colspec align=left/
thead
row
entry rowsep=1 align=leftemphasis role=bold
Base Internal Format
/emphasis/entry
entry rowsep=1 align=leftemphasis role=bold
RGBA, Depth and Stencil Values
/emphasis/entry
entry rowsep=1 align=leftemphasis role=bold
Internal Components
/emphasis/entry
/row
/thead
tbody
row
entryconstantGL_DEPTH_COMPONENT/constant/entry
entryDepth/entry
entryD/entry
/row
row
entryconstantGL_DEPTH_STENCIL/constant/entry
entryDepth, Stencil/entry
entryD, S/entry
/row
row
entryconstantGL_RED/constant/entry
entryRed/entry
entryR/entry
/row
row
entryconstantGL_RG/constant/entry
entryRed, Green/entry
entryR, G/entry
/row
row
entryconstantGL_RGB/constant/entry
entryRed, Green, Blue/entry
entryR, G, B/entry
/row
row
entryconstantGL_RGBA/constant/entry
entryRed, Green, Blue, Alpha/entry
entryR, G, B, A/entry
/row
/tbody
/tgroup
/table
/para
/refsection
/refentry
!DOCTYPE refentry [
!ENTITY % mathml PUBLIC -//W3C//DTD MathML 2.0//EN
  http://www.w3.org/TR/MathML2/dtd/mathml2.dtd;
%mathml;
]

refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=glTexImage1D
info
copyright
year1991-2006/year
holderSilicon Graphics, Inc