One book "XSLT 2nd Edition Programmers Reference - Michael Kay" noted
that use of the id() was likely to be more efficient because it was/is
likely that procesors are likely to build an index rather than doing a
sequential search.
Thanks
Scott
Hussein Shafie wrote:
> Scott Daley wrote:
>
>> From a CSS I am having trouble combing the document() and id()
>> functions. I have them working independently, but can't find the
>> correct syntax to combine them.
>>
>> content: xpath("id(current()/@idref)/displayName"); - this works
>> content:
>> xpath("document(current()/@href)//*...@id=current()/@idref]/displayName");
>> - this works - ie the longhand version of id
>
>
> This one is OK. Why not use it?
> ("document(@href)//*...@id=current()/@idref]/displayName" should be work
> fine too.)
>
>
>
>> but I can't combine document() and id() - the following doesn't work
>> but it illustrates one of the many variants I have tried
>> content:
>> xpath("document(current()/@href)//id(current()/@idref)/displayName");
>
>
> The above one seems to be completely *illegal XPath* (disclaimer: to
> my knowledge, with XPath 1.0).
> You cannot write "...//id(...)/..." because id() is not a *node test*.
>
>
> ---
> PS: PITFALL: document() caches the returned documents and the cache is
> pretty dumb. Moreover there is currently now way to disable this cache
> (except for Spreadsheet calculations -- see
> http://www.xmlmind.com/xmleditor/_distrib/docs/help/ar01s06s01.html#spreadsheetOptions)
>
>
>
>