|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
xsl:value-of select with $varibles
I have problem with returning the value from a specific element from a varible and I would like som help. This is my xslt:
Code:
my variable model:
<model xmlns = "http://www.w3.org/2002/xforms">
<instance>
<ecommerce>
<method />
<number>190</number>
....
<xsl:template match="input">
<input type="text" id="{@ref}" name="{@ref}"
// Problem row !!!
value="<xsl:value-of select="$model/model/instance//{@ref}"/>"
/>
</xsl:template>
I would like to get the value from $model/model/instance/ any element matching {@ref} but I don't know how to write it. edit 1: If I'm writing Code:
value="<xsl:value-of select="$model"/>" I'll get value="190" for all elements edit 2: I have tried to move the varible into the orignal xml-file but it doesn't work either. I think there might be a problem with the xpath expression and the dynamic @ref. Is there a workaround for the problem? Best Regards, Örjan |
|
#2
|
|||
|
|||
|
<xsl:template match="input">
<xsl:variable name="AttValue"><xsl:value-of select="$model/model/instance//{@ref}"/></xsl:variable> <input type="text" id="{@ref}" name="{@ref}" > <xsl:attribute name="value"> <xsl:value-of select="$AttValue"/> </xsl:attribute> </input> </xsl:template> |
|
#3
|
|||
|
|||
|
I'm afraid it doesn't work
and I think it depends on that xpath 1.0 cannot take dynamic expressions like {@ref}.My problem is that I would like to transform a xform document to xhtml but since it's not possible to parse to branches a the same time eg. model&control it's hard if not impossible to make the transformation with xslt. I'm curious if you have any other ideas of transforming xforms to xhtml. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > xsl:value-of select with $varibles |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|