Re: [docbook-apps] Issue with page number format, when toc is relocated

2013-10-31 Thread Erik Leunissen

On 31/10/13 19:54, Bob Stayton wrote:

Hi Erik,
You'll need to customize the template named 'page.number.format' from
fo/pagesetup.xsl.  It has an xsl:choose with a case for the TOC when the
context element is a book (so the TOC is generated without a toc
element), so you need to add a case for a toc element when present:

i



And once more, this resolved the issue.

What also worked in my case, but may blow up other documents, is simply 
replacing the existing:


  i

with:

  i



Thanks again,

Erik.


-
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] cmdsynopsis omits xml:id

2013-10-31 Thread Bob Stayton
Hi Tim,
By default, the $generate.id.attributes param in the html stylesheet is set to 
zero (it generates the old named anchor elements instead).  If you set that to 
1, then you should get an id output on cmdsynopsis.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net


From: Tim Arnold 
Sent: Tuesday, October 29, 2013 10:59 AM
To: DocBook Apps 
Subject: [docbook-apps] cmdsynopsis omits xml:id


hi, when I convert DocBook 5 using the 1.77 html (chunk) stylesheets, the 
cmdsynopsis element is rendered as a div, but the xml:id is omitted. Is this a 
bug or am I misunderstanding? I would have expected the xml:id to come through 
as an id in the html. 


Test document:
http://docbook.org/ns/docbook";
 version="5.0" xml:id="abc">
  The Chapter
  
The Section

  
The Command
variable-list
;
  

  



with this command line:
xsltproc /path/to/docbook/xsl-1.77.1/html/chunk.xsl test.xml



the cmdsynopsis element results in this block of html (I expected the id "abe" 
on the div):
 
   
 The Command
 variable-list   ;
   
 


thanks,
--Tim



Re: [docbook-apps] smart quotes are acting stupid in Firefox & IE; why?

2013-10-31 Thread Jirka Kosek
On 31.10.2013 19:28, Bob Stayton wrote:
> I just tested again with xhtml/docbook.xsl, and you are correct that
> Saxon does not output that  tag when output method="xml", but
> xsltproc does with that stylesheet.  But xsltproc does so only when the
> XHTML DTD is specified. 

Hmm, that's interesting behaviour although probably not conforming to
XSLT 1.0 specification. I wasn't aware of that, I'm not using xsltproc
on regular basis.

> When the DTD reference is removed, as in xhtml5,
> then xsltproc does not.  If xsltproc is being used for xhtml5 output,
> then I think you would have to resort to manually adding that meta tag
> to the 'user.head.content' template.

Yep, but one has to take care to specify there same encoding as in
xsl:output/$chunker.output.encoding, otherwise output will be displayed
as mess again.

Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@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 conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


Re: [docbook-apps] Issue with page number format, when toc is relocated

2013-10-31 Thread Bob Stayton

Hi Erik,
You'll need to customize the template named 'page.number.format' from 
fo/pagesetup.xsl.  It has an xsl:choose with a case for the TOC when the 
context element is a book (so the TOC is generated without a toc element), 
so you need to add a case for a toc element when present:


i

Bob Stayton
Sagehill Enterprises
b...@sagehill.net

--
From: "Erik Leunissen" 
Sent: Thursday, October 31, 2013 11:27 AM
To: 
Subject: [docbook-apps] Issue with page number format, when toc is relocated


I've positioned the toc of a book after the preface (through processing
of an empty toc element in the xml source).

That works, except that the page number sequence is as follows:

(i, ii,) iii, iv, 5, 1, 2, 3, etc ...
  ^

where:

  - pages i and ii are suppressed in the output, as expected.
  - page iii is the preface
  - page iv is blank (double sided document)
  - page 5 is the toc
  - content follows after page 5 (numbering restarted as expected)

The unexpected behaviour is that the switch from roman to arabic
numerals has started too early, at the toc on page 5.

Attached you find an xml source and corresponding customization which
exercise this behaviour (using xsltproc and fop1.1 to produce PDF).

I'd like to prevent this behaviour but am clueless about where to attack
this phenomenon.

Any pointers/direction are greatly appreciated.

Erik Leunissen.







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



-
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] smart quotes are acting stupid in Firefox & IE; why?

2013-10-31 Thread Bob Stayton

Hi Jirka,
I just tested again with xhtml/docbook.xsl, and you are correct that Saxon 
does not output that  tag when output method="xml", but xsltproc does 
with that stylesheet.  But xsltproc does so only when the XHTML DTD is 
specified. When the DTD reference is removed, as in xhtml5, then xsltproc 
does not.  If xsltproc is being used for xhtml5 output, then I think you 
would have to resort to manually adding that meta tag to the 
'user.head.content' template.


Bob Stayton
Sagehill Enterprises
b...@sagehill.net

--
From: "Jirka Kosek" 
Sent: Thursday, October 31, 2013 10:22 AM
To: "Bob Stayton" 
Cc: "Stefan Knorr" ; ; 
"Robert Nagle" 
Subject: Re: [docbook-apps] smart quotes are acting stupid in Firefox & IE; 
why?


On 28.10.2013 17:11, Bob Stayton wrote:

But I also found that when processing with the xhtml5 stylesheet instead
of xhtml, that  element is *not* output automatically (and the
epub3 stylesheet is based on xhtml5).   I thought that was odd, since
the xhtml5 stylesheet imports from the xhtml directory.  By
experimentation, I found that the crucial difference is that the xhtml5
stylesheet does not set the doctype attributes in the xsl:output
element, because the XHTML5 standard does not support a DTD.  Apparently
xsltproc and Saxon relied on the doctype attributes to generate that
encoding meta element.


That's not entirely true.  tag is generated when output method is
html or xhtml (). XSLT 1.0 doesn't
support xhtml output method so xml method is used instead which doesn't
generate  tag.

If original poster is using Saxon, then best solution is to use
saxon:xhtml as an output method -- this makes xhtml output method
available in XSLT 1.0 as well.

Jirka



-
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] Issue with page number format, when toc is relocated

2013-10-31 Thread Erik Leunissen
I've positioned the toc of a book after the preface (through processing 
of an empty toc element in the xml source).


That works, except that the page number sequence is as follows:

(i, ii,) iii, iv, 5, 1, 2, 3, etc ...
  ^

where:

  - pages i and ii are suppressed in the output, as expected.
  - page iii is the preface
  - page iv is blank (double sided document)
  - page 5 is the toc
  - content follows after page 5 (numbering restarted as expected)

The unexpected behaviour is that the switch from roman to arabic 
numerals has started too early, at the toc on page 5.


Attached you find an xml source and corresponding customization which 
exercise this behaviour (using xsltproc and fop1.1 to produce PDF).


I'd like to prevent this behaviour but am clueless about where to attack 
this phenomenon.


Any pointers/direction are greatly appreciated.

Erik Leunissen.

http://docbook.org/ns/docbook";
  xmlns:xlink="http://www.w3.org/1999/xlink";
  xmlns:xi="http://www.w3.org/2001/XInclude";
  xmlns:svg="http://www.w3.org/2000/svg";
  xmlns:m="http://www.w3.org/1998/Math/MathML";
  xmlns:html="http://www.w3.org/1999/xhtml";
  xmlns:db="http://docbook.org/ns/docbook";>
  
Some book


  ErikLeunissen

  

  


today


  

  
Preface

preface body
  

  

  
Introduction


  Problem description

  some para.

  



user-toc.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] smart quotes are acting stupid in Firefox & IE; why?

2013-10-31 Thread Jirka Kosek
On 28.10.2013 17:11, Bob Stayton wrote:
> But I also found that when processing with the xhtml5 stylesheet instead
> of xhtml, that  element is *not* output automatically (and the
> epub3 stylesheet is based on xhtml5).   I thought that was odd, since
> the xhtml5 stylesheet imports from the xhtml directory.  By
> experimentation, I found that the crucial difference is that the xhtml5
> stylesheet does not set the doctype attributes in the xsl:output
> element, because the XHTML5 standard does not support a DTD.  Apparently
> xsltproc and Saxon relied on the doctype attributes to generate that
> encoding meta element.

That's not entirely true.  tag is generated when output method is
html or xhtml (). XSLT 1.0 doesn't
support xhtml output method so xml method is used instead which doesn't
generate  tag.

If original poster is using Saxon, then best solution is to use
saxon:xhtml as an output method -- this makes xhtml output method
available in XSLT 1.0 as well.

Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@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 conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


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

2013-10-31 Thread Jirka Kosek
On 31.10.2013 17:36, Bob Stayton wrote:
> 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.

There is no need to create manually DTD with just entity definitions.
Such entity definitions are already premade and available online, see:
http://docbook.org/docs/howto/#faq-authoring-general-entities

and

http://www.w3.org/2003/entities/2007doc/Overview.html


Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@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 conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


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

2013-10-31 Thread Bob Stayton

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 ).


Bob Stayton
Sagehill Enterprises
b...@sagehill.net


From: Carlos Araya
Sent: Wednesday, October 30, 2013 1:24 PM
To: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Should xmllint successfully validate docbook 5 
containing XIncludes?



Have you tried using the namespace declaration in your document?


Something like this:



   xmlns:xlink='http://www.w3.org/1999/xlink' 
xmlns:mathml="http://www.w3.org/TR/MathML2/dtd/mathml2.dtd";

   version="5.0" xml:lang="en">Title of your document

This should replace the entity declaration and still let your mathml 
validate.

HTH,Carlos



On Tue, Oct 29, 2013 at 2:53 AM, Jon Leech  wrote:

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


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 ⌊ 
.
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 



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