Scott Daley wrote:
>
> I am trying to use xpath in generating the content as part of a CSS
> rule. I have worked out how to select the data I want from within the
> same document but am having troubles with getting it from a different
> XML document.
>
> Here's what I have done.
>
> /* works - display name element of element with id A104 in external
> document */
> /* content:
> xpath("document('file:///home/daleys/.xxe2/config/tdor/data_items.xml')//datait...@id='A104']/nme");
>
> */
>
> The problem I have is that instead of the [...@id='A104'] being hard-coded
> (as in the example above), I want this to come from an attribute of the
> document I am rendering with CSS. How do I get the context of the
> selected CSS node into the XPath expression that has its context with
> another document? ie something equivelent to "id of external document
> node = attribue of css selected node".
Standard XSLT function current() should do the trick.
Example: Let's say 'A104' comes from attribute named 'foo' of the
element being styled with the CSS (AKA the target of the CSS rule).
---
content:
xpath("document('file:///home/daleys/.xxe2/config/tdor/data_items.xml')//datait...@id=current()/@foo]/nme")
---