This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Nested/embedded/self-referential path expressions.
- From: "Edward L. Knoll" <ed dot knoll at cosd dot fedex dot com>
- To: XSL Post <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 11 Jul 2002 12:37:00 -0600
- Subject: [xsl] Nested/embedded/self-referential path expressions.
- Organization: WSCR
- Reply-to: xsl-list at lists dot mulberrytech dot com
I am attempting to construct a path expression for a template which only
accepts the specified element if an element exists with the same name in
another portion of the document. What I currently have (which works) is
represented abstractly as the following:
<xsl:template match="Row/*">
<xsl:variable name="MyName" select="name()" />
<xsl:if test="/Table/Columns/*[name()=$MyName">
....
</xsl:if>
</xsl:template>
What I want to do is combine the if with the "match=..." clause of the
template. The problem is that I need to reference the "name()" of the
context/element with the "name()" in a different context/element. The
logical expression would be somethink like the following:
<xsl:template match="Row/*[/Table/Columns/*[{inner context name}={outer
context name}]]">
Can/how do I reference a element/component of the outer context for
comparison in the inner context?
Thanks,
Ed Knoll
--
Edward L. Knoll Phone (work) : (719)484-2717
e-mail (work) : f49660c@cosd.fedex.com
e-mail (business): eknoll@sf-inc.com
e-mail (personal): edward@elknoll.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list