xsl-list
[Top] [All Lists]

RE: Problems sorting data

2005-07-04 06:34:02
Hi,

I've created the XML below and now I need to present the data in an 
orderly fashion. More precisely I need to have the data sorted by the 
'idstring' member. I've done some googling and this is the 
best I could 
come up with, but the data is still not sorted. The data is 
presented, 
though, so obviously I'm doing something right.
What is wrong with this sorting and what can I do to fix it?


XSLT:

<xsl:template match="report">

      <xsl:template match="contents">

The data shouldn't be presented, your XSLT processor should throw a fatal 
error, as xsl:template cannot appear inside another xsl:template.

Cheers,

Jarno

--
Solitary Experiments: Fast Forward (Total Rewnd)

      <xsl:apply-templates>
              <xsl:sort select="member[(_at_)name='idstring']"/>
      </xsl:apply-templates>
      </xsl:template>

</xsl:template>

<xsl:template match="object[(_at_)type='standard']">
      <xsl:value-of select="member[(_at_)name='idstring']"/>
      <xsl:value-of select="member[(_at_)name='id']"/>
      <xsl:value-of select="member[(_at_)name='title']"/>
</xsl:template>



XML:

<report>
<contents>

      <object type="standard">
              <member name="id">
                      <long>1234</long>
              </member>
              <member name="idstring">
                      <string>Unique1</string>
              </member>
              <member name="title">
                      <string>Temporary</string>
              </member>
      </object>

      <object type="standard">
              <member name="id">
                      <long>5678</long>
              </member>
              <member name="idstring">
                      <string>Unique2</string>
              </member>
              <member name="title">
                      <string>Foobar</string>
              </member>
      </object>

</contents>
</report>


-- 

Glenn Thomas Hvidsten

=============  CORENA Norge AS  =============
== Dyrmyrgt. 35, N-3611 Kongsberg, NORWAY  ==
== Tlf: +47 3271 7234, Fax: +47 3271 7201  ==
== CORENA Home Page: http://www.corena.com ==
=============================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>