AW: [xsl] Muenchean grouping as template...

Subject: AW: [xsl] Muenchean grouping as template...
From: Nikolas.Nehmer@xxxxxxxxxxx (Nikolas Nehmer)
Date: Mon, 16 Feb 2004 20:06:49 +0100
Thanks a lot for your hints. I'm more or less new to XML, coming from
the OO world (Java,...) so I am happy about every help.

Best regards,

|-----Ursprüngliche Nachricht-----
|Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
|list@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Andreas L. Delmelle
|Gesendet: Montag, 16. Februar 2004 19:31
|An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|Betreff: RE: [xsl] Muenchean grouping as template...
|> -----Original Message-----
|> From: Nikolas Nehmer
|> But i need to pass the nodeset on which the transform should be done
|> to the default visualizer, maybe with a param.
|> But the key for my muenchen grouping will be defined before ...
|I see (from the other thread) that you already managed to solve your
|problem, but anyway...
|Yes, indeed the key will be defined *before* ... but as indicated, and
|your trial-and-error in the other thread has shown you, you can change
|context in which it operates. In your case, the context was changed to
|node offering a match only on the root element of your source XML, so
|output was not as intended, but it remains a *feature* after all.
|(you might wanna check Dave Pawson's FAQ under 'Keys',
|there's a few very interesting examples and demos there to show you
|keys do and how to use them
|Once you get the hang of it, you'll be surprised at how many for-each's
|choose/when/otherwises can be avoided by a proper combination of
|generate-id() and xsl:variable...)
|On to your stylesheet (which seemed to be moving into the right
|apart from a few minor, yet very important details)
|>   <tr>
|>     <xsl:for-each select="$unique-elements">
|>      <xsl:variable name="elements-by-name"
|>         select="key('elementtags-by-name', name(.))"/>
|> 	 <td>
|>        <xsl:choose>
|>          <xsl:when test="@href">
|>            <xsl:apply-templates
|>               select="$elements-by-name[name() = name(.)]"
|>               mode="association_aggregation"/>
|(BUZZ!!!) _Almost_ right...
|Try select="$elements-by-name[name(.)=name(current())]
|As I understand, . returns you the current node in the current context.
|Context here is XPath (everything between [ ]), while current() gives
|the current node in XSLT context (determined by surrounding
|apply-templates/for-each/...) even inside angled brackets. In this
|current() would return you the node being processed in the context of
|Further hint:
|It seems like you could do with the local-name() function to strip the
|namespace prefixes (no choose/when/otherwise needed):
|<xsl:template match="*" mode="header">
|  <th><xsl:value-of select="local-name(.)" /></th>
| XSL-List info and archive:

 XSL-List info and archive:

Current Thread