Re: [xsl] Aargh - wrong template applied

Subject: Re: [xsl] Aargh - wrong template applied
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 19 Apr 2006 15:25:37 -0400
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@xxxxxxxxxxxxxxxx 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 ======================================================================

Current Thread