Subject: Re: [xsl] Position X Sort-> Thanks!! From: "Paulo Henrique S. Bermejo" <bermejo@xxxxxxxxxxx> Date: Thu, 27 Sep 2001 18:39:05 -0300 |
Very good!!! Thanks Chris, Wendell, and all !!! This is exactly what I want to make. Cheers, Paulo. ----- Original Message ----- From: Chris Bayes To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent: Thursday, September 27, 2001 6:04 PM Subject: RE: [xsl] Position X Sort-> Please urgent! Maybe this <xsl:template match="ORIGINAL"> <xsl:for-each select="TEST"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:value-of select="."/> <xsl:variable name="var_pos" select="count(preceding-sibling::*)+1"/> <xsl:value-of select="document('')/ADDS/ADD[$var_pos]" /> </xsl:for-each> </xsl:template> Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Paulo Henrique S. Bermejo > Sent: 27 September 2001 21:47 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] Position X Sort-> Please urgent! > > > Yes Chris, > > My stylesheet give just exactly this ("Form wrong"). > > Form wrong: > ------------- > 5A > 4B > 3C > 2D > 1E > > But I need of this: > ----------------- > Form needed: > 5E > 4D > 3C > 2B > 1A > > The my problem isn't with sort, and yes with the > "position()". My stylesheet make equal the "Form wrong". When > I sort my xmloriginal, it take the position of xml sorted, > and I need to get the position whitout sort (in original > formate). Chris, I think that will be necessary put a > "attribute" in XMLORIGINAL.XML that say me the order > original. I don't make this still, because will be necessary > to change DTD and the date exportation of my aplication, and > the DTD (Curriculum Academic Latin American - used in Brazil > for Education's Ministry ) is very big. > > Case exist other form, say me. > > Thankkkss!!! > > > ----- Original Message ----- > From: Chris Bayes > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Sent: Thursday, September 27, 2001 5:10 PM > Subject: RE: [xsl] Position X Sort-> Please urgent! > > > Sorry Paulo, > I don't understand that response. You want to sort your output right? > > <ORIGINAL> > <TEST>1</TEST> > <TEST>4</TEST> > <TEST>5</TEST> > <TEST>2</TEST> > <TEST>3</TEST> > </ORIGINAL> > > Added to > > <ADDS> > <ADD>A</ADD> > <ADD>E</ADD> > <ADD>B</ADD> > <ADD>C</ADD> > <ADD>D</ADD> > </ADDS> > > Gives > > 5E > 4D > 3C > 2B > 1A > > Is't that what you wanted??? > > Ciao Chris > > XML/XSL Portal > http://www.bayes.co.uk/xml > > > > -----Original Message----- > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Paulo > > Henrique S. Bermejo > > Sent: 27 September 2001 20:36 > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: Re: [xsl] Position X Sort-> Please urgent! > > > > > > Ok Chris, > > But this can't occur ever. > > This example my xmloriginal and my xmladd are in order, but > in cases > > they aren't. I think that I would need get a position in a original > > formate of xml (without consider the sort). > > > > > > > > ----- Original Message ----- > > From: Chris Bayes > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Sent: Thursday, September 27, 2001 3:53 PM > > Subject: RE: [xsl] Position X Sort-> Please urgent! > > > > > > Paulo, > > You might want something like > > <xsl:template match="ORIGINAL"> > > <xsl:for-each select="TEST"> > > <xsl:sort select="." data-type="number" order="descending"/> > > <xsl:value-of select="."/> > > <xsl:variable name="var_pos" select="position()"/> > > <xsl:for-each select="document('XMLADD.XML')//ADDS/ADD"> > > <xsl:sort select="." data-type="text" order="descending"/> > > <xsl:if test="position()=$var_pos"><xsl:value-of > > select="."/></xsl:if> > > </xsl:for-each> > > </xsl:for-each> > > </xsl:template> > > > > Ciao Chris > > > > XML/XSL Portal > > http://www.bayes.co.uk/xml > > > > > > > -----Original Message----- > > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Paulo > > > Henrique S. Bermejo > > > Sent: 27 September 2001 19:21 > > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > > Subject: [xsl] Position X Sort-> Please urgent! > > > > > > > > > Hi all, > > > > > > I'm with problems with my transformation and I need to give > > my project > > > in next week, and need to make others things. Well... I've 2 xml > > > documents and 1 xsl document. The first doc xml > > (XMLORIGINAL.XML) The > > > second xml document > > > (XMLADD.XML) have informations about first document. The > relashion > > > this elements is for position, but I need to print this > > context using > > > the sort, and I'm having problems with this. Exists a > > formal of to get > > > a position of element in original formate? My example: > > > > > > <!-- XMLORIGINAL.XML --> > > > <?xml-stylesheet type="text/xsl" href="XSLORIGINAL.XSL"?> > <ORIGINAL> > > > <TEST>1</TEST> > > > <TEST>2</TEST> > > > <TEST>3</TEST> > > > <TEST>4</TEST> > > > <TEST>5</TEST> > > > </ORIGINAL> > > > > > > > > > <!-- XMLADD.XML --> > > > <ADDS> > > > <ADD>A</ADD> <!-- This element if referent the 1º <TEST> > > element --> > > > <ADD>B</ADD> <!-- This element if referent the 2º <TEST> > > element --> > > > <ADD>C</ADD> <!-- This element if referent the 3º <TEST> > > element --> > > > <ADD>D</ADD> <!-- This element if referent the 4º <TEST> > > element --> > > > <ADD>E</ADD> <!-- This element if referent the 5º <TEST> > > element --> > > > </ADDS> > > > > > > <!-- XSLORIGINAL.XSL --> > > > <xsl:template match="ORIGINAL"> > > > <xsl:for-each select="TEST"> > > > <xsl:sort select="." data-type="number" order="descending"/> > > > <xsl:value-of select="."/> > > > <xsl:variable name="var_pos" select="position()"/> > > > <xsl:value-of > > > select="document('XMLADD.XML')/ADDS/ADD[$var_pos]"> > > > </xsl:for-each> > > > </xsl:template> > > > > > > > > > I need to print so: > > > ------------------ > > > 5E > > > 4D > > > 3C > > > 2B > > > 1A > > > > > > And my result is: > > > ------------------ > > > 5A > > > 4B > > > 3C > > > 2D > > > 1E > > > > > > If I can't to print so, then exist another form???? > > > > > > > > > Thanks all, > > > > > > > > > Paulo. > > > > > > > > > XSL-List info and archive: > > http://www.mulberrytech.com/xsl/xsl-list > > > > > > > > > > > > XSL-List info > > and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > > > > > > > XSL-List info > and archive: http://www.mulberrytech.com/xsl/xsl-list > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Position X Sort-> Please , Chris Bayes | Thread | Re: [xsl] Position X Sort-> Please , Wendell Piez |
RE: [xsl] Position X Sort-> Please , Chris Bayes | Date | [xsl] "apply-templates" doesn't wor, Greg Martel |
Month |