Re: [xsl] is this valid <xsl:template match="@id"> ?

Subject: Re: [xsl] is this valid <xsl:template match="@id"> ?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Dec 2002 19:16:19 -0500
Saravanan,

At 06:43 PM 12/30/2002, you wrote:
I would like to create a template that matches attribute id in all elements

<xsl:template match="@id">

this is not working with MSXML... is it correct to use such syntax ?

Yes, it is correct.


The problem is probably that your attribute nodes are never getting selected for processing; accordingly, the template is never matched and never run.

In the template(s) for the element(s) that hold the attributes, try writing

<xsl:apply-templates select="@*"/>

and see whether that helps. This instruction tells the processor to pick up the attributes on the element and find and process templates for them, too.

You might want to read up also on the built-in default templates in XSLT. By default, they do not select attributes for processing, which is why templates matching attributes don't seem to work.

If this isn't clear, please post again with (brief) examples of source data, your stylesheet, and desired output; no doubt someone can identify exactly the instruction you need very quickly.

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 ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread