Shawn Milochik wrote:
What I want to do is check whether a node with multiple children, all
containing attribute "name," happens to have a child where the "name"
attribute is "address1."
<xsl:if test="*[(_at_)name = 'address1']">
XML:
<dataElement type="address" name="addrProjectOwner"
dbfield="projOwnerAddress">
<addrField name="orgName" />
<addrField name="address1" />
<addrField name="address2" />
<addrField name="city" />
<addrField name="state" />
<addrField name="zip" />
</dataElement>
XSLT (please help fix):
(At this point I'm iterating through all <dataElement> nodes in the XML)
<xsl:if test="@type='address'">
<xsl:if test="if an addrField in my children has name 'address1''">
<xsl:if test="addrField[(_at_)name = 'address1']">
<input type="text" id="txtAddress1" />
</xsl:if>
<xsl:if test="if an addrField in my children has name 'salami''">
<input type="text" id="txtSalami" />
</xsl:if>
</xsl:if>
You might however want to factor out stuff into templates e.g.
<xsl:template match="dataElement[(_at_)type = 'address']/addField[(_at_)name =
'address1']">
<input type="text" id="txtAddress1"/>
</xsl:template>
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
--~------------------------------------------------------------------
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>
--~--