Discussion:
removing inline attributes from tables
Carlos Araya
2014-08-16 21:59:32 UTC
Permalink
I'm trying to cleanup my (x)html to use with epub3. One of the things I
need to do is to remove inline attributes from tables as they ware not
needed or controlled through CSS.

How do I change the default behavior for tables? Is there a way to move
this all to be CSS driven

Carlos
Bob Stayton
2014-08-18 20:17:49 UTC
Permalink
Hi Carlos,
I'm not clear what you mean by inline attributes in tables. Can you be
more specific?

Also, are you using the epub3 stylesheets in 1.78.1?

Bob Stayton
Sagehill Enterprises
Post by Carlos Araya
I'm trying to cleanup my (x)html to use with epub3. One of the things I
need to do is to remove inline attributes from tables as they ware not
needed or controlled through CSS.
How do I change the default behavior for tables? Is there a way to move
this all to be CSS driven
Carlos
Carlos Araya
2014-08-18 22:07:02 UTC
Permalink
Bob,

I mean remove inline style attributes from an element. I'm using classes
for blockquotes but it still generates a style="border: 0" for the
blockquote table.

I use 1.78.1 and snapshot and they both intorduce the inline styles.

Carlos
Post by Bob Stayton
Hi Carlos,
I'm not clear what you mean by inline attributes in tables. Can you be
more specific?
Also, are you using the epub3 stylesheets in 1.78.1?
Bob Stayton
Sagehill Enterprises
Post by Carlos Araya
I'm trying to cleanup my (x)html to use with epub3. One of the things I
need to do is to remove inline attributes from tables as they ware not
needed or controlled through CSS.
How do I change the default behavior for tables? Is there a way to move
this all to be CSS driven
Carlos
Bob Stayton
2014-08-19 22:15:30 UTC
Permalink
Hi Carlos,
There is no parameter to turn of all style attributes (but perhaps there
should be).

However, you can customize a template that will turn off almost all of
them. That template starts with:

<xsl:template match="*" mode="convert.to.style">

and is located in xhtml5/html5-element-mods.xsl. At the point where it
generates the @style attribute, you can comment out or remove that code:

<xsl:attribute name="style">
<xsl:value-of select="$style"/>
</xsl:attribute>

Here is a little background explanation, if you are interested.
Many traditional HTML attributes generated by DocBook XSL are no longer
allowed in HTML5. The xhtml5 stylesheet uses xsl:apply-imports to
generate the regular DocBook xhtml output into a variable, and then
processes that xhtml output again to deal with those attributes. It
converts many of them to CSS styles and outputs them in an @style
attribute, which is allowed. That's what this template is doing. But
in your case, you don't want any @style, so comment out those lines.

Bob Stayton
Sagehill Enterprises
Post by Carlos Araya
Bob,
I mean remove inline style attributes from an element. I'm using
classes for blockquotes but it still generates a style="border: 0" for
the blockquote table.
I use 1.78.1 and snapshot and they both intorduce the inline styles.
Carlos
Hi Carlos,
I'm not clear what you mean by inline attributes in tables. Can you
be more specific?
Also, are you using the epub3 stylesheets in 1.78.1?
Bob Stayton
Sagehill Enterprises
I'm trying to cleanup my (x)html to use with epub3. One of the things I
need to do is to remove inline attributes from tables as they ware not
needed or controlled through CSS.
How do I change the default behavior for tables? Is there a way to move
this all to be CSS driven
Carlos
Loading...