Next in thread → Next in month →

Re: [docbook-apps] Re: XSL customization

From
Bob Stayton <>
Date
2003-04-29T17:10:43+00:00
ID
Thread
Re: [docbook-apps] Re: XSL customization
On Tue, Apr 29, 2003 at 12:56:18PM -0400, Sam Steingold wrote:
> > * In message <>
> > * On the subject of "Re: [docbook-apps] Re: XSL customization"
> > * Sent on Mon, 28 Apr 2003 09:49:54 -0700
> > * Honorable Bob Stayton <> writes:
> >
> > So Sam needs to change his stylesheet file as follows:
> > 
> > <xsl:template match="literal[@role = 'type' or @role = 'sexp']">
> >  <tt xmlns="http://www.w3.org/1999/xhtml" role="{@role}"><xsl:apply-templates/></tt>
> > </xsl:template>
> 
> adding  xmlns="http://www.w3.org/1999/xhtml"  to each and every tag is
> a mouthful (e.g., my user.footer.navigation is a table with 13 elements...)
> is there a cheaper way?

I'm quite sure that controlling verbosity was not
one of the design goals of XML.  8^)

But there is a cheaper way.  I think you can set the default
namespace of your customization layer to the XHTML namespace.
Then you don't have to put it on all elements.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml"
                version="1.0">

The second xmlns has no prefix, which means any other elements
in the stylesheet file are considered to be in that default
namespace.  That seems to work.

I'm not sure why the xhtml stylesheet doesn't just do it
that way.
-- 

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: 
Next in thread → Next in month →