[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] epub3 + adding customized attribute and value to p tag?
OK, that's more clear. The import statement indicates
that you are using the namespaced stylesheets, and the use of @xml:id in the
match attribute indicates that your document is DocBook 5. So any element
names used in the stylesheet must be in the DocBook namespace, and so must be
preceded by the namespace prefix:
<xsl:template match="d:chapter[@xml:id = 'mypreface']/d:para"
mode="class.attribute" >
<xsl:param name="width" select="local-name(.)"/> <xsl:attribute name="width">50px</xsl:attribute> </xsl:template> Then it should output the width attribute.
I should point out that a width attribute on <p> is not
valid HTML5 and will likely not pass epubcheck3, if that matters.
From: Robert Nagle
Sent: Monday, January 14, 2013 9:02 PM
To: Bob
Stayton
Cc: apps docbook
Subject: Re: [docbook-apps] epub3 + adding customized attribute and
value to p tag? Oops, I pasted things incorrectly again! (But again, when I tried
the correct form, the output would generate, but the chapter with the
xml:id="mypreface" would NOT add a 'width = "50px"' value.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://docbook.org/ns/docbook" xmlns:date="http://exslt.org/dates-and-times" xmlns:saxon="http://icl.com/saxon" exclude-result-prefixes="d date saxon" version="1.0"> <xsl:import href=""/> <xsl:param name="use.id.as.filename">1</xsl:param> <xsl:template match="chapter[@xml:id = 'mypreface']/para" mode="class.attribute" > <xsl:param name="width" select="local-name(.)"/> <xsl:attribute name="width">50px</xsl:attribute> </xsl:template> </xsl:stylesheet> On Mon, Jan 14, 2013 at 10:58 PM, Robert Nagle <idiotprogrammer@gmail.com> wrote:
-- Robert Nagle 6121 Winsome Ln #56C, Houston TX 77057-5581 (H) 713 893 3424/ (W) 832-251-7522 Carbon Neutral Since Jan 2010 http://www.robertnagle.info |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]