473,796 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

order-by is an invalid attribute for the "xsl:for-each" element

i put order-by here, but i got the invalid attribut error, what's
missing? thanks

-----------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>

<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">

<xsl:param name="FirstLett er"></xsl:param>

<xsl:template match="customer list">
<html>
<body>
<table border="1" frame="box">
<tr>
<TH>Customer</TH>
<TH>Number</TH>
<TH>Address</TH>
</tr>
<xsl:for-each select="custome r[substring(@cust omer_name,1,1)
= $FirstLetter]" order-by="@customer_n uame">
<tr>
<td>
<a
href="customerd etails.aspx?cus tomer_number={@ customer_number }">
<xsl:value-of select="@custom er_name" />
</a>
</td>
<td>
<xsl:value-of select="@custom er_number"/>
</td>
<td>
<xsl:value-of select="@addres s"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

Aug 1 '06 #1
3 5637
i fond i miss

<xsl:sort select ="@customer_nam e" order ="ascending"/>

Aug 1 '06 #2


Wang Xiaoning wrote:
i put order-by here, but i got the invalid attribut error, what's
missing? thanks
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:for-each select="custome r[substring(@cust omer_name,1,1)
= $FirstLetter]" order-by="@customer_n uame">
Here is the definition of for-each in XSLT 1.0:
<http://www.w3.org/TR/xslt#for-each>
Where do you see an order-by attribute there?

If you want to sort then you need to use e.g.
<xsl:for-each select="custome r[substring(@cust omer_name,1,1)
= $FirstLetter]">
<xsl:sort select="@custom er_name" />
</xsl:for-each>

See <http://www.w3.org/TR/xslt#sorting>.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 1 '06 #3
you are right, thanks

Aug 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3386
by: Igor | last post by:
Is there any way to resort and xml document using xslt based on element position. For example if I have xml like this: <root> <element> 1st thing </element> <element> 2nd thing </element> <element> 3rd thing </element> </root> would it be possible using xslt only to reverse it into:
2
1557
by: Soren Kuula | last post by:
Hi, I'm trying to teach myself a little XSL. I have made up an XML model of a consed list, like : <list> <car>a</car> <cdr> <list> <car>b</car>
5
2536
by: Tom Alsberg | last post by:
Hi there... I'm recently trying to get a bit acquainted with XML Schemas and XSL. Now, I have a few questions about XSL stylesheets and templates: * Is there a way to "enter" a child element of the currently matched element in the template, so that XPath expressions inside would be relative to that node? Specifically, I want to do this, in order to be able to issue xsl:call-template to apply some templates to some
8
1774
by: Matej Cepl | last post by:
Hello, does anybody have %subj%? I would like to generate some very simple HTML (XHTML?) file from OOImpress, so that I can send it to the friend for review and not bother her with all images, layouts, and the other junk (moreover, she probably never heard about OO.o). Powerpoint of the cursed memory used to have export of outline to RTF. Is there something similar for OOImpress (certainly, I do not care about RTF, OOWriter or HTML would...
4
1369
by: n.phelge | last post by:
I'm trying to validate XML which doesn't include a namespace, so I've written a schema and I'm attempting to add a namespace to the original XML using XSLT. The original XML looks like this: <orderlist> <order> <header> <ordernum>1313</ordernum> </header> </order>
6
2170
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows XP Pro SP 1, .Net Framework 1.1) and on our production server (Windows 2K SP 4, .Net Framework 1.1). I have simplified the code and data to isolate the problem. When I use the xsl:strip-space (Line 12) declaration in conjunction with the xsl:sort...
5
6963
by: johanneskrueger | last post by:
Hello, I'm currently using <xsl:copy-of select="document(...)/svg:svg"/to embed an SVG file into an XHTML file. I already defined the SVG namespace and assigned svg as its prefix in my XSLT 1.0 sheet. What commands instead of copy-of could I use in order to get the prefix with every element from the external file, e.g. <svg:svg>, <svg:lineetc. instead of just <svgand <line>, as it is noted in the external file?
2
3432
by: James Equalizer | last post by:
hello all, In XSL what would be the easiest way to remove only the <information> element of my xml file, but at the same time keeping the child elements and its contents? Source xml file: <envelope> <body> <information> <lang>en</lang> </information>
2
24730
by: daydreaming | last post by:
Hi again, I have one more question to inquiry from you guys that if I want to want to use XSLT copying from xml containing namespace to a new xml without namespace. How can I do it. I have written XSLT for this routine, but it still did not work as what I want yet, so can anyone give me some suggestion to work through it. Thank you in advance. Source XML file. <?xml version="1.0"?> <order xmlns="http://test.com/OrderAdd"...
0
9533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.