I have what should be a simple question, but I've been struggling so let
me ask the collective...

I have a list of attribute names which I want to compare with the
current document, and if the attribute is not in the list, strip it from
the document. Sort of a filter below the regular filter.

I have a loop do-for-each(XPath("./*")) which is iterating through the
document. I have a driver scoped node-set variable which was built from
a token-split which has the list in it from the mapping table. So far so
good.

I can iterate through the list now and if the attribute name in the
document is not in the list I can strip it out. This works, however it's
woefully ugly (and slow). This will introduce 1.5 seconds per user add,
not a good thing. An XPath expression should be able to do this, I
should be able to test whether a value exists in a node set...this is
simple XPath but it's escaping me.

My loop puts the attribute name in a local variable named ATTR-NAME.
The node set containing the list of allowed attributes is ATTR-FILTER.
So I tried this:

count($ATTR-FILTER[text()=$ATTR-NAME])>0

I swear I've done a predicate like this before, but this always returns
false

I tried this:

count($ATTR-FILTER[contains(.,$ATTR-NAME)])>0

this kind-of works, except that it seems to be matching by whether the
attribute name is contained in any of the text in the filter variable,
which won't work, because an attribute name like "title" might match
something like "DirXML-En*title*mentRef".

Any ideas?


--
rrawson
------------------------------------------------------------------------
rrawson's Profile: http://forums.novell.com/member.php?userid=4898
View this thread: http://forums.novell.com/showthread.php?t=355398