[docbook-apps] informalfigures and @label

2014-05-17 Thread Brad Scott

Hi

I have a figure with no title or caption, which I just need to be 
labelled Figure 1. I was hoping that this would do the trick:


informalfigure xml:id=a-1 label=1
mediaobject xml:id=g-1
imageobject xml:id=i-1imagedata fileref=images/file.png 
format=image/png//imageobject

/mediaobject
/informalfigure

but that doesn't autogenerate Figure 1 with the image. Does 
informalfigure need some special handling in the XSL to support this?


Thanks

Brad

-
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] EPUB: dbtimestamp PI in pubdate or date

2014-05-17 Thread Thomas Schraitle
Hi,

currently, I'm investigating EPUB(3) and dates in pubdate.

It's not unusual to have the following pubdate inside an info, using the 
default date format:

  pubdate?dbtimestamp?/pubdate

This works for HTML, FO, etc. except for EPUB. For EPUB, you get:

  WARNING: wrong metadata date format: '' in element bookinfo/pubdate. It must
  be in one of these forms: , -MM, or -MM-DD.

Well, I think the message is correct as there is really no text. It doesn't 
help to add a format pseudo attribute here:

  pubdate?dbtimestamp format=Y, m d?/pubdate

This would lead to the same message.

Digging deeper into the EPUB3 stylesheets, I assume the dbtimestamp PI isn't 
supported at all. The pubdate is used as OPF metadata in the following 
template:

 xsl:template match=date|pubdate mode=opf.metadata
   xsl:variable name=date
 xsl:call-template name=format.meta.date
   xsl:with-param name=string select=normalize-space(.)/
 /xsl:call-template
   /xsl:variable
  !-- ... ---
 /xsl:template

However, format.meta.data just checks if the given text is in the right 
format. If not, it displays the above warning message.

Now I'm wondering if this is the right approach. 8-) Shouldn't we distinguish 
between two cases:

1. date or pubdate contains only text
   We need to check, if the text is a valid date in the format needed by EPUB

2. date or pubdate contains no text, but ?dbtimestamp?
   We ignore any format pseudo attribute and return a date in the format 
   Y-m-d

I would propose the following change:

 xsl:template match=date|pubdate mode=opf.metadata
   xsl:variable name=date
 xsl:choose
  xsl:when test=processing-instruction('dbtimestamp')
xsl:call-template name=pi.dbtimestamp
  xsl:with-param name=formatY-m-d/xsl:with-param
/xsl:call-template
  /xsl:when
  xsl:otherwise
xsl:call-template name=format.meta.date
  xsl:with-param name=string select=normalize-space(.)/
/xsl:call-template
  /xsl:otherwise
/xsl:choose
   /xsl:variable
  !-- ... ---
 /xsl:template

Unfortunately, this won't work. The pi.dbtimestamp template doesn't allow a 
parameter format. Looking into the template xsl:variable is used.

Could we change pi.dbtimestamp and use xsl:param instead of 
xsl:variable?  Or is there another solution that I can't see? 


What do you think?


-- 
Gruß/Regards
  Thomas Schraitle


-
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] informalfigures and @label

2014-05-17 Thread Jirka Kosek
On 17.5.2014 8:37, Brad Scott wrote:
 but that doesn't autogenerate Figure 1 with the image. Does
 informalfigure need some special handling in the XSL to support this?

You can use figure and provide empty title

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