A
axial
Is there a way to define a variable by resolving other variables?
I'm trying to build an "uber-variable" from user-selected components. I
have control over the XML and can change it as needed.
The user is allowed to specify one to three data fields from a list and
up to three text fields to use as the pattern for creating chapter
names:
<ChapterNameDefaults>
<Data>PartCode</Data>
<Text> </Text>
<Data>SectionNumber</Data>
<Text>.</Text>
<Data>ChapterNumber</Data>
</ChapterNameDefaults>
I need to create a "dynamically concatenated variable" that would
result if something like this was possible:
<xsl:variable name="ChapterName" select="{$PartCode}{
}{$SectionNumber}{.}{$ChapterNumber}"/>
or
<xsl:variable name="ChapterName" >
<xsl:value-of select="$PartCode"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$SectionNumber"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$ChapterNumber"/>
</xsl:variable>
which would be dynamically resolved to something like "ADR 0.1" or
"Billing 24-4" (in this example) depending on the user's selection of
variables, their resolved values, and Text.
Of course I could output a resolved ChapterName in the XML to start
with, rather than at the XSL stage, but I'd rather do it in the XSL if
possible.
Suggestions appreciated.
Thx
I'm trying to build an "uber-variable" from user-selected components. I
have control over the XML and can change it as needed.
The user is allowed to specify one to three data fields from a list and
up to three text fields to use as the pattern for creating chapter
names:
<ChapterNameDefaults>
<Data>PartCode</Data>
<Text> </Text>
<Data>SectionNumber</Data>
<Text>.</Text>
<Data>ChapterNumber</Data>
</ChapterNameDefaults>
I need to create a "dynamically concatenated variable" that would
result if something like this was possible:
<xsl:variable name="ChapterName" select="{$PartCode}{
}{$SectionNumber}{.}{$ChapterNumber}"/>
or
<xsl:variable name="ChapterName" >
<xsl:value-of select="$PartCode"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$SectionNumber"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$ChapterNumber"/>
</xsl:variable>
which would be dynamically resolved to something like "ADR 0.1" or
"Billing 24-4" (in this example) depending on the user's selection of
variables, their resolved values, and Text.
Of course I could output a resolved ChapterName in the XML to start
with, rather than at the XSL stage, but I'd rather do it in the XSL if
possible.
Suggestions appreciated.
Thx