Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to get node in the order the xml is given

From: naijacoder <lurowam@-----.--->
To: 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



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