xsl-list
[Top] [All Lists]

RE: Problem matching part of a string

2005-06-02 13:43:37
I think the logic you are trying to describe is

<xsl:attribute name="claimable"
  select="some $v in $docA/vendors/vendor satisfies starts-with($v,
@name)"/>

or if you prefer 1.0 syntax

<xsl:attribute name="claimable">
  <xsl:value-of select="boolean($docA/vendors/vendor[starts-with(.,
current()/@name)])"/>
</xsl:attribute>

That may not perform well, but get it working first and then worry about
speeding it up.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Kent Seegmiller [mailto:hookjaw20(_at_)comcast(_dot_)net] 
Sent: 02 June 2005 07:24
To: XSLT
Subject: [xsl] Problem matching part of a string

OK here is my problem:
I have 2 source docs.  Doc 'A' has this:
<vendors>
  <vendor>DAN MORRISON MEAT PIES</vendor>
  <vendor>BOISE CASCADE</vendor>
  <vendor>CANDY TECH INC</vendor>
  <vendor>WF</vendor>
</vendors>

And Doc 'B' has this:

...
<vendor name="..."/>
<vendor name="..."/>
<vendor name="..."/>
<vendor name="..."/>
...

And I want to create a third xml doc using xslt2.0 that cross 
references the 
first part of @name of doc 'B' with the vendor element in doc 
'A' and if so, 
make the claimable att. 'true'. There are some 1300 vendor 
names in doc 'B' 
and there are some 100 vendors that begin with 'WF'. So I get 
this in the 
third xml.

...
<vendor name="..." claimable="true/false"/>
<vendor name="..." claimable="true/false"/>
<vendor name="..." claimable="true/false"/>
<vendor name="..." claimable="true/false"/>
...

but I am having problems with the substring function.

-Thanks, KS 



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





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