XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Checking for Values in an Arra... (3)
-> + Adding embedded functions (11)
-> + multiple DTPs at the same leve... (2)
-> + java.lang.OutOfMemoryError: Ja... (3)
-> + xml validation against wsdl (2)
-> + Using same Xquery (4)
-> + Changing name value pairs to t... (4)
-> + removing unwanted attributes r... (4)
-> + Repeated Crashing of System (2)
-> + Create multiple XML Files (5)
-> + Best xQuery engine? (2)
-> - Xquery outputs XML attributes ... (4)
-> ->Xquery outputs XML attrib...
-> ->Xquery outputs XML attrib...
-> ->Xquery outputs XML attrib...
-> + DataDirect SequeLink as a DB-t... (2)
-> + Using same xquery for 2 xml fi... (5)
-> + Performance of XQuery (2)
-> + fail to use Saxon Process for ... (4)
-> + Conditional statements in xque... (2)
-> + Option Declaration Using Saxon (2)
-> + Multiple option declarations (2)
-> + Importing modules with a Custo... (3)
-- Previous [241-260] [261-280] [281-300] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Dominic VieiraSubject: Xquery outputs XML attributes sorted by attribute name
Author: Dominic Vieira
Date: 31 Jan 2008 01:43 PM
Is there a setting or reason when using attributes in xquery the xml output displays the attributes in ascending order?

Sample xquery code snippet;
<Test>
{
for $Record3 at $i in doc('file:///c:/userfield.xml')/Records/Record
where (($Record3/batch_number = $Record2/batch_number) and ($Record3/tran_number = $TranNo)) and ($Record3/docformat_id = $Record5/docformat_id)
return
<TtestField test6="test6" test4="test4" test7="test7"/>
}
</Test>

When the code is executed the following is output;
<Test>
<TestField test4="test4" test6="test6" test7="test7"/>
</Test>

Notice the order in which the attribute displays has changed from what is written in the code? In code it is test6, test4, test7. The output sorts the attributes; test4, test6, test7. I've hardcoded the values in the sample but using actually data "{$datafield} presents the same issue.

Thanks.

Postnext
Minollo I.Subject: Xquery outputs XML attributes sorted by attribute name
Author: Minollo I.
Date: 31 Jan 2008 01:55 PM
What XQuery processor are you using? I don't see that behavior using DataDirect XQuery, but I do see it using Saxon.

BTW, the order of attributes is completely irrelevant in the XML InfoSet... so, what you are describing is just an entirely legitimate serialization choice.

Postnext
Dominic VieiraSubject: Xquery outputs XML attributes sorted by attribute name
Author: Dominic Vieira
Date: 31 Jan 2008 03:27 PM
I've tried using the built-in and saxon processor. Is there a way to turn it off?

Posttop
Minollo I.Subject: Xquery outputs XML attributes sorted by attribute name
Author: Minollo I.
Date: 31 Jan 2008 03:33 PM
"it" being? The ordering of attributes? Not that I know of; you may want to ask saxonica dot com about Saxon.

As I said, DataDirect XQuery doesn't seem to re-order them in the cases I checked; DataDirect XQuery is bundled with all Stylus Studio Enterprise Suites.

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.