xsl-list
[Top] [All Lists]

Re: Complex Condition problem with Attributes

2005-09-15 05:36:22

<xsl:when test="//*[contains(name(),'DebtManagement') and
(//*[contains(name(),'DebtManagement')](_at_)action='add' or
//*[contains(name(),'DebtManagement')](_at_)action='delete')">

It failes at the position @.  But why?

Your syntax is wrong.
Either //*[contains(name(),'DebtManagement')]/@action (which is not
what you want as it would choose the attribute - that is, test if the
attribute existed.

Or //*[contains(name(),'DebtManagement')][(_at_)action] (which would choose
the element (marked with *) that contains an attribute called action).


What you want is something like:
<xsl:when test="//*[contains(name(),'DebtManagement') and
(@action='add' or @action='delete')]">

Which gives all the elements in the stylesheet that: has a name which
contains the string 'DebtManagement' and has an attribute called
action with a string value of either 'add' or 'delete'.

Regards,
Ragulf Pickaxe :-)

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



<Prev in Thread] Current Thread [Next in Thread>