Woops... I just realised that this is an XSLT question rather than
a FOP question. Must have mixed up the mailinglists I guess ..
However, I'd be grateful if someone can give me a clue into the right
direction ...

CHeers,

Michiel


$ -----Original Message-----
$ From: Michiel Verhoef [mailto:[EMAIL PROTECTED]]
$ Sent: donderdag 28 juni 2001 9:01
$ To: '[EMAIL PROTECTED]'
$ Subject: Dynamic select in xsl:for-each?
$ 
$ 
$ Hi all,
$ 
$ I need to be able to define a select attribute in an xsl:for-each
$ dynamically. This is because I need to use the content of an XML
$ element in this select and I can't use anything with "<" inside
$ an XML tag.
$ 
$ I've tried the method below, which I used before when 
$ defining attributes
$ runtime with values based on data. However, I used to do this 
$ in output
$ tags such as HTML's <a> when defining the href attribute. Not 
$ in runtime
$ code.
$ 
$ <!-- more code here $menu-item has been defined here as well.. -->
$ <xsl:for-each>
$    <xsl:attribute name="select">
$       /Page/Results/ToolbarView[Type='<xsl:value-of 
$ select="$menu-item"/>']
$    </xsl:attribute>
$    <xsl:value-of select="$menu-name"/>.add(new 
$ WebFXMenuItem("<xsl:value-of
$ select='Code'/>", "javascript:alert(\"Under Construction\")", 
$ "Display data
$ in EUR"));
$ </xsl:for-each>
$ 
$ <!-- more code here -->
$ 
$ This is an example of the XML that I am using.
$ <Page>
$ <Results>
$    <ToolbarView>
$       <Type>weight</Type>
$       <Relation>current</Relation>
$       <Code>KG</Code>
$       <Value>Kilogram</Value>
$    </ToolbarView>
$    <ToolbarView>
$          <Type>weight</Type>
$          <Relation>choice</Relation>
$          <Code>PLD</Code>
$          <Value>Pld</Value>
$    </ToolbarView>
$    <!-- etc. -->
$ </Results>
$ </Page>
$ 
$ In a way I am not surprised this doesn't work, because I am trying to 
$ define my code runtime, which XSL probably isn't designed to handle.
$ 
$ The general idea is to define menubar items based on the XML 
$ data. We're
$ using some 
$ kind of WebFX Menu library found by my collegue (works great 
$ BTW) and I am
$ the lucky
$ one who is supposed to figure out what goes wrong. Anybody 
$ any ideas how to
$ handle this?
$ 
$ Thanks in advance,
$ 
$ Michiel
$ 
$ ---------------------------------------------------------------------
$ To unsubscribe, e-mail: [EMAIL PROTECTED]
$ For additional commands, email: [EMAIL PROTECTED]
$ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to