This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Re: XSL customization


On Mon, Apr 28, 2003 at 05:14:10AM -0400, Daniel Veillard wrote:
> On Sun, Apr 27, 2003 at 04:01:37PM -0700, Bob Stayton wrote:
> > On Sun, Apr 27, 2003 at 03:42:14PM -0400, Sam Steingold wrote:
> > > Thanks Bob, you are most helpful!
> > > 
> > > > * In message <20030427111042 dot A19360 at sco dot com>
> > > > * On the subject of "Re: Re: XSL customization"
> > > > * Sent on Sun, 27 Apr 2003 11:10:42 -0700
> > > > * Honorable Bob Stayton <bobs at sco dot com> writes:
> > > >
> > > > > 2. I want <literal role="foo">...</literal> to transform to
> > > > >    <tt role="foo">...</tt>.
> > > >  
> > > > <tt role="{ at role}"><xsl:apply-templates/></tt>
> > > 
> > > great.  why my html output now has
> > >         <tt xmlns="" role="type">
> > > and
> > >         <i xmlns="http://www.w3.org/1999/xhtml";>
> 
>    Because your extension asked to ouptut the tt element in *no* namespace
> and you have xmlns="http://www.w3.org/1999/xhtml"; in scope ! As a result
> to generate what you asked for libxslt *must* unbind the default namespace
> generate your <tt> in no namespace, and reactivate the default namespace in
> the subtree.
>    In a nutshell xsltproc does what you ask for, it's a bug in your stylesheet
> apparently, make sure that in your stylesheet extension, the tt element
> pertains to the XHTML namespace.

OK, now I see the problem.
When the DocBook XHTML stylesheet files are generated
from the HTML stylesheet files using html2xhtml.xsl,
the xmlns="http://www.w3.org/1999/xhtml"; attribute is added
to all literal element templates.  So this means any
customization file should also add the same namespace
attribute to any literal output elements.

So Sam needs to change his stylesheet file as follows:

<xsl:template match="literal[ at role = 'type' or @role = 'sexp']">
 <tt xmlns="http://www.w3.org/1999/xhtml"; role="{ at role}"><xsl:apply-templates/></tt>
</xsl:template>

I still wonder if he means to use the invalid 'role' attribute
in <tt> instead of 'class'.  It needs to be 'class' if
CSS is going to have an effect.
-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs at sco dot com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]