xsl-list
[Top] [All Lists]

Re: [xsl] Simple template matching problem

2007-05-07 14:57:27
You suspect correct. You match for "Records/Record", which translates
as: "Any element 'Record' that has a parent of 'Records' ". However, you
seem to think of it as "Any element 'Records' with one or more 'Record'
elements as children".

What you need is: match="Records[Record]" (you need a predicate, not a
child specification).

I suppose I thought that Record[DATA_TYPE='x'] would override
Records/Record because it was more specific. Obviously my ideas about
xsl's ability to pick templates border on prescient.

> <xsl:template match="Records/Record">
>    <xsl:apply-templates select="$invTable[COLUMN_NAME='beginDate']">
>         <xsl:with-param name="value" select="//beginDate" />

btw, why do you need this? First of all, it is not there in the source,
secondly (assuming your sample source is different than your real
source), if the data is there, you can get it from the matching
templates as well (or the matching templates have different sources, but
the same elements, in which case I recommend that you switch modes as
well, to keep from accidental infinite recursion).

Not really sure what you mean here. Yes, this is a much abbreviated
snippet from the actual xsl. Why do I need what, exactly?

-Steve

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