xsl-list
[Top] [All Lists]

Re: [xsl] Aargh - wrong template applied

2006-04-19 12:27:02
Ian,

At 01:51 PM 4/19/2006, you wrote:
On Apr 19, 2006, at 12:19 AM, Michael Kay wrote:

You haven't shown your source document, but my guess is that your font
elements are in a namespace.
It's an XHTML 1.0 Transitional document, so it has the XHTML
namespace bound on the root node. So, yes, the font element is in a
namespace, but it's the same namespace as everything else in the
document.

Nonetheless Mike's tip is still a good one. If your template matching <font> is the only one that matches an element by name, while all other elements are matched with a wildcard like "node()" or "*", the 'font' template is the only one that needs to match its namespace as well.

Now we know what namespace the element to be matched is, what does the template look like?

You'll need to have match="h:font", with "h" bound to "http://www.w3.org/1999/xhtml"; since that's the namespace the font element is in. (Or use another prefix of your choice.)

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--