K
Keith Davies
Hi All,
I've got a document containing a internal lookups (I want to show a
relationship hierarchy, starting at an arbitrary point, or series of
points).
It's easy if I know what item IDs I want to refer to during processing,
I can put in a @refid, @refids, or child elements listing the IDs to
process. No big deal. I'd *rather*, however, be able to specify an
XPath and have that resolved during transformation.
<show-tree refid='some-id' />
easy
<show-tree refids='some-id another-id' />
<show-tree>
<ref refid='some-id' />
<ref refid='another-id' />
</show-tree>
also easy.
<show-tree xpath='//element[type="some-type"]' />
I can't figure out. Ideally, something like
<xsl:template match='show-tree'>
<xsl:variable name='nodes' select='{@xpath}' />
<!-- do stuff with nodes -->
</xsl:template>
would be lovely, but select doesn't seem to like this.
I'm using Saxon for my transformations. I'm willing to use extensions,
though I'd rather not... but I'll accept expediency over purity.
Can anyone please provide some illumination or answers? I probably
*can* build a selection mechanism into my schema, but XPath is made for
this sort of thing; I'd like to be able to it rather than some ad hoc
construction if I can.
Thank you,
Keith
I've got a document containing a internal lookups (I want to show a
relationship hierarchy, starting at an arbitrary point, or series of
points).
It's easy if I know what item IDs I want to refer to during processing,
I can put in a @refid, @refids, or child elements listing the IDs to
process. No big deal. I'd *rather*, however, be able to specify an
XPath and have that resolved during transformation.
<show-tree refid='some-id' />
easy
<show-tree refids='some-id another-id' />
<show-tree>
<ref refid='some-id' />
<ref refid='another-id' />
</show-tree>
also easy.
<show-tree xpath='//element[type="some-type"]' />
I can't figure out. Ideally, something like
<xsl:template match='show-tree'>
<xsl:variable name='nodes' select='{@xpath}' />
<!-- do stuff with nodes -->
</xsl:template>
would be lovely, but select doesn't seem to like this.
I'm using Saxon for my transformations. I'm willing to use extensions,
though I'd rather not... but I'll accept expediency over purity.
Can anyone please provide some illumination or answers? I probably
*can* build a selection mechanism into my schema, but XPath is made for
this sort of thing; I'd like to be able to it rather than some ad hoc
construction if I can.
Thank you,
Keith