Subject: Re: [xsl] build a select clause or dynamic URI's From: "M. David Peterson" <m.david@xxxxxxxxxx> Date: Tue, 09 Nov 2004 16:21:46 -0800 |
I summarise what I need as wanting to go from a string value in an attribute to having the nodeset it refers to. So, given an href like "../../../gml:position" I can write a generic template to invoke the original gml:position template.
I've experimented with the document function and just had someone else suggest it may help but I'm not sure how to use document to refer to a different location in the current source.
The only real chance you have of being able to do any sort of pseudo dynamic XPath expression is if, for example, there is only one ancestor gml:position for any given element. If this were the case you could use a recursive template to strip away the the dots and slashes (for that matter you could use the translate function to replace the . and / with nothing and then simply use the ancestor axis and the name() or local-name() functions to access the ancestor with a name or local-name = to the remaining string.... e..g <xsl:apply-templates select="ancestor::*[name() = translate(@xlink:href, './', '')]"/>. Still not an ideal situation I realize but if there is limitations to the ancestor count of a particular elements name then you may have a fighting chance with something like this...
Say we have some XML with a relative ref back in the file, like: <featureMember> <GeochemSpecimen gml:id="WA_1_139459"> <gml:name>139459</gml:name> <gml:position xlink:href="urn:x-seegrid:definition:gml:NilReason:unknown"/> <material>rock</material> <relatedObservation> <GeochemMeasurement gml:id="WA_1_139459_Ag">
<gml:position xlink:href="../../../gml:position"/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] build a select clause or dyna, Andy Dent | Thread | Re: [xsl] build a select clause or , Andy Dent |
[xsl] build a select clause or dyna, Andy Dent | Date | Re: [xsl] build a select clause or , Andy Dent |
Month |