Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Sort Issue After spawning new nodes

From: Bruce@-----------.---------.---
To: NULL
Date: 9/10/2008 7:22:00 AM

Hello, I have a dataset for which one column has a multivalue (semi-colon 
delimited) text field.  I have to break this out into unique rows (imagine 
this being like an inner join on a look up table) so that the following:

<Row @item1="Label" @item2="aardvark;"/>
<Row @item1="Label" @item2="echidna;zebra;bear;orangutang"/>
<Row @item1="Label" @item2="kangaroo;"/>

becomes:

<Row @item1="Label" @item2="aardvark"/>
<Row @item1="Label" @item2="kangaroo"/>
<Row @item1="Label" @item2="echidna"/>
<Row @item1="Label" @item2="zebra"/>
<Row @item1="Label" @item2="bear"/>
<Row @item1="Label" @item2="orangutang"/>

Ok, so I got this work by calling a named template that recurses the string 
using substring-before and substring-after spitting out a variable that 
contains artificial nodes:

<xsl:for-each select="row">
   <xsl:variable name="breakItUp">
      .... call that template that creates the artificial nodes
   </xsl:variable>
   <xsl:for-each select="node-set(breakItUp)/newItem">
      .... write the final row out
   </xsl:for-each>
</xsl:for-each>

Since I am looping through the original rows and then as an inner loop, 
looping through these, it breaks things out properly in the end result. I'm 
leaving details out, and hoping they aren't critical to the real issue which 
is...

Now of course, real users want this sorted.  I find that I'm running into a 
block here.  Any chunk of rows that were originally brokent out of the string 
want to always sort together.  I assume xsl:sort is looking past the artifice 
of my fancy footwork and just sorting them where they REALLY are, since the 
result of all this is really just pointers pointing to pointers.  How can I 
fool xsl:sort TOO so that it allows me to sort Zebra to the end of the list?

Thanks for reading and for any thoughts that you might want to offer ;)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent