Topic - some xrl magic needed
Topic - some xrl magic needed Topic - some xrl magic needed
from forum Solutions Developer
 forum index   my profile   search 
 new topic  post reply 
moderators: pjr tab
some xrl magic needed
Joined: 22-April-2007
Posts: 79
Location: Belgium
Posted: 18-September-2008 14:44
Greetings all,

I have the following xsl statement :

<xsl:copy-of select="document('xrl:datastore_assettypes')/nvp" />

This works fine and so does the following :
<xsl:copy-of select="document('http://10.111.8.161:1070/ConfigStaging/datastore/assettypes')/nvp" />

which is the expanded version of the above statement.

This also works ...

<xsl:copy-of select="document('http://10.111.8.161:1070/ConfigStaging/datastore/assettypes?assettype={assettype}')/nvp" />


And you'll probably guess my question now ... how do I pass the parameter when I'm using the xrl: (the first statement) ? Whatever I try fails.

Note that I do have a solution which uses xrl:include instead of xsl:copy-of, but in this case I can't use xrl:include.

Any tips ?
Regards,
Tom
Joined: 25-May-2007
Posts: 30
Posted: 18-September-2008 19:20
One way would be to pass a literal nvp document as a data: url to the xrl: uri -
<xsl:value-of select="document('xrl:assets+param@data:,%3Cnvp%3E%3Cassettype%3E{type}%3C/assettype%3E%3C/nvp%3E')/path" />

However, that might get tripped up if the value you pass in isn't xml-clean.

A different possibility is to change your datastore_resources accessor to take netkernel's native "+name@value" arguments instead of url "?name=value" parameters wrapped up in a nvp document.  So your external uri would be
http://10.111.8.161:1070/ConfigStaging/datastore/assettypes+assettype@type

and your xrl uri would be
xrl:datastore_assettypes+assettype@type
A possible issue with this is that various things (like xrl and dpml) may attempt to treat the value as a uri and source it instead of treating it as a literal value.  This is one of nk's frustrating inconsistencies;  you can usually get around that by making it a data: url.
and magic was provided ... thank you
Joined: 22-April-2007
Posts: 79
Location: Belgium
Posted: 19-September-2008 05:31
Greetings,

I went with the first solution. The magical data: uri. Since I already bumped (several times) into the problem you describe for the second solution I'll take my chances with the possible xml-issue.

Regards and thank you very much,
Tom
 new topic  post reply  To find out about new replies to this post as they occur
please subscribe to one of these feeds:
AtomRSS moderate 
© 2003-2006, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.