Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: How to get node in the order the xml is given >Thread Next - Re: How to get node in the order the xml is given Re: How to get node in the order the xml is givenTo: NULL Date: 6/28/2009 5:41:00 AM hahaha Martin.Sorry for being a pain,
Sorry but i know more than tha tutorial you sent.
I don't think you really understand what 'm trying to achieve
When you said i can use xsl:for-each to be process xml in document
order.
What i'm after is instead of using xsl:apply-templates to match
elements how can i use xsl:for-each
I know i can do
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
<xsl:for-each select=3D"catalog/cd">
<tr>
<td><xsl:value-of select=3D"title"/></td>
<td><xsl:value-of select=3D"artist"/></td>
</tr>
</xsl:for-each>
But regarding my own xml the <cd> won't be constant
So i could have
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<dvd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</dvd>
<bluray>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</bluray>
</catalog>
How can i use xsl:for-each
to process the document order as they come.
I know i'm missing something ....
Thanks Martin
On Jun 26, 9:59=A0pm, "Neil Smith [MVP Digital Media]" <n...@nospam.com>
wrote:
> This is the most basic google query possible, so I don't expect you'll
> get much spoon feeding for research you can do yourself.
>
> Here's an example :http://www.w3schools.com/xsl/and note the phrase
> "Click on the "Try it Yourself" button to see how it works."
>
> Or even anything from this search (to save you having to type it in
> yourself, in case that's too hard to achieve) :
>
> http://www.google.co.uk/search?q=3Dbasic+xsl+tutorial+xsl%3Afor-each
>
> Cheers - Neil
>
> On Thu, 25 Jun 2009 23:54:42 -0700 (PDT), naijacoder
>
> <luro...@gmail.com> wrote:
> >> > I'm writing up a xsl against a xml file
> >> > But the requirement is that they want me to display the nodes accord=
ing to
> >> > the order the elements are being presented in the xml file.
> >> > Any ideas how i can do this and is it possible?
>
> >> Simply process nodes with xsl:apply-templates or xsl:for-each, they wi=
ll
> >> =A0 be processed in document order, as long as you don't have an xsl:s=
ort
>
> =A0:
> ------------------------------------------------
> Digital Media MVP : 2004-2009http://mvp.support.microsoft.com/mvpfaqs
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
