This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
AW: XSL equivalent to SQL "unique"
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: AW: [xsl] XSL equivalent to SQL "unique"
- From: "Nestel, Frank" <frank dot nestel at coi dot de>
- Date: Wed, 18 Apr 2001 10:29:06 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hmm,
looks like I've got a syntax or rtf/node-set problem, all methods
descibed there would apply easily if I had entries like
<set name="1">
<entry name="a">v1</entry>
<entry namw="b">v2</entry>
</set>
but all my trials to convert from the below format to that
seem to end at the result-tree-fragment/noed-set boundary. E.g.
I'd like to write
<xsl:variable name="all">
<xsl:for-each select="set/*">
<name><xsl:value-of select="name()"/></name>
</xsl:for-each>
</xsl:variable>
to convert below data into above format in the variable $all.
But the result is a result tree fragment which cannot be processed
by another for-each loop. I cannot figure a workaround for the
obstacle.
Of course one could it with two xslt steps, but this would be
very inconvenient in the framework I currently use...
Still puzzled,
Frank
> -----Ursprüngliche Nachricht-----
> Von: Xuegen Jin [mailto:xjin_imi@yahoo.com]
> Gesendet am: Mittwoch, 18. April 2001 01:10
> An: xsl-list@lists.mulberrytech.com
> Betreff: RE: [xsl] XSL equivalent to SQL "unique"
>
> You can use the so-called Muenchian Method to solve your problem. Jeni
> Tennison has a very nice explanation about this method on her
> web site:
> http://www.jenitennison.com/xslt/grouping/muenchian.html
>
>
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> Nestel, Frank
> Sent: Tuesday, April 17, 2001 1:09 PM
> To: 'xsl-list@lists.mulberrytech.com'
> Subject: [xsl] XSL equivalent to SQL "unique"
>
>
>
> Hi,
>
> I've spent some time to figure out an easy way to solve the following
> problem and failed, maybe some Guru can give me a clue?
>
> Having XML input like
>
> <set name="1">
> <a>v1</a>
> <c>v2</c>
> <d>v3</d>
> </set>
> <set name="2">
> <a>v4</a>
> <b>v5</b>
> <e>v6</e>
> </set>
> <set name="3">
> <b>v7</b>
> <f>v8</f>
> </set>
>
> I need to render a quadratic schema like
>
> a b c d e f
> 1 v1 v2 v3
> 2 v4 v5 v6
> 3 v7 v8
>
> in HTML, i.e., I need output like
>
> <table>
>
> <tr><td></td><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td
> ><td>f</td></t
> r>
>
> <tr><td>1</td><td>v1</td><td></td><td>v2</td><td>v3</td><td></
> td><td></td></
> tr>
>
> <tr><td>2</td><td>v4</td><td>v5</td><td></td><td></td><td>v6</
> td><td></td></
> tr>
>
> <tr><td>3</td><td></td><td>v7</td><td></td><td></td><td></td><
> td>v8</td></tr
> >
> </table>
>
> Of course all dimensions are variable dependand on underlying
> data. I thought, the problem boils down to obtaining the a list like
>
> <n>a</n><n>b</n><n>c</n><n>d</n><n>e</n><n>f</n>
>
> in a variable from the initial input. But I failed to obtain
> that, though
> I'm fairly sure it has to "be there" :-(
>
> Any help?
>
> Thank you very much,
> Frank
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list