Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: search and replace [Thread Next] Re: search and replaceTo: NULL Date: 2/6/2007 3:46:00 PM If it really is an XML ID (declared as such in the DTD or schema), you may be able to speed that up by replacing //excel_database[@id=current()/text()]/@name with id(current())/@name (Take the value of the current node, do a table lookup to find the element which carries that id value, take its name attribute.) The advantage is that this avoids having to search the whole document for the desired entry; the disadvantage is that unless it's properly declared it doesn't work. If you have to use the search approach, you may want to consider modifying it: //excel_database[@id=current()][1]/@name ... assuming that the ID is unique, this generates the same result but avoids wasting time searching for another instance. BTW, testing current()/text() checks whether a single text=-node child has that value -- which may or may not be what you want if there's markup inside the current() node. If you want the string value of the whole node, you can just test it directly or use the string() function (which comes out to the same thing). -- Joe Kesselman / Beware the fury of a patient man. -- John Dryden | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
