Re: [xsl] Sorting and attributes

Subject: Re: [xsl] Sorting and attributes
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Mon, 17 Dec 2001 12:11:07 -0800 (PST)
Jeni,
I might not have phrased my question clearly.

I am getting this result for each PERSNAME:

<LI>Abbott, Frank     : 100$a</LI>

But I was not sure the syntax was giving me the attribute for the
particular PERSNAME each time. I did check some of them, but was
unsure in this multistructured xml if I would get the right ones
since I asked for //PERSNAME (there being some for C02 and C03 levels
differentiated by the attribute alone which I did not use as a filter
but instead requested as output).

One thing that seems to plague me is the multistructure of my EAD
xml. I cannot change the structure, but it makes it difficult to
write style sheets with confidence at this stage for elements that
appear in both parent and child nodes.

Thanks for your help.

Mike F.

--- Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> wrote:
> Hi Mike,
> 
> > Here is my xsl:
> >
> > <xsl:for-each select="//C02//PERSNAME">
> >   <xsl:sort select="."/>
> >     <LI>
> >       <xsl:value-of select="."/>
> >       <xsl:text>     : </xsl:text>
> >       <xsl:value-of select="./@ENCODINGANALOG"/>
> >     </LI>
> > </xsl:for-each>
> >
> > I have over 3000 entries, I just want to know if I am getting the
> > output I think I am getting.
> 
> Can't you tell by looking at the output whether you are getting the
> output you think you are getting?!? :) If not, perhaps you should
> try
> working on a sample file containing fewer entries to start with?
> 
> All I can tell you is what the above does:
> 
>   It finds all the PERSNAME elements that are within a CO2 element
>   within the document.
> 
>   It sorts the PERSNAME elements alphabetically by their string
> value
>   (their content).
> 
>   It creates a <LI> element for each PERSNAME in sorted order.
> 
>   Within the LI element it gives the value of that PERSNAME
> element,
>   followed by six spaces, followed by the value of the
> ENCODINGANALOG
>   attribute on that PERSNAME element.
> 
> The value of the ENCODINGANALOG attribute does not affect the order
> in
> which the PERSNAME elements are processed.
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread