Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 25961 invoked by uid 500); 25 Dec 2002 18:04:53 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 25950 invoked from network); 25 Dec 2002 18:04:53 -0000 From: "William Brogden" To: Subject: RE: Cocoon reversing element attributes at output? Date: Wed, 25 Dec 2002 11:02:33 -0600 Message-ID: <000801c2ac37$6e08bb80$6701a8c0@bigcow> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C2AC05.236E4B80" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-reply-to: <00d101c2ac0a$19e23220$a800000a@lisa> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0009_01C2AC05.236E4B80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit -----Original Message----- From: Anna Afonchenko [mailto:anna@ubaccess.com] Sent: Wednesday, December 25, 2002 5:38 AM To: cocoon-users Subject: Cocoon reversing element attributes at output? Hi All. I am writing xsl file that will catch some nodes (according given XPath) and will output these nodes as a string. Here is the code snippet that outputs the matching node: < =" " > So, if, for example, the node is caught, then it will be output as is. When I was running this xsl using batch file, everything was OK. Now I am running it using Cocoon, and although I get correct nodes caught, for each node all attributes are output in the reverse order, e.g. for the previous example the result in Cocoon is This is not a disaster, but it is rather frustrating, because I would want to copy this node and search it in the code, but if the attributes are reversed, I wouldn't be able to do it. Does anybody know why Cocoon reverses attributes order when outputting a node? Thank you very much for help. Anna The SAX event for the start of an element carries attributes in an Attributes collection. The JavaDocs say "the order of attributes in the list is unspecified and may vary from implementation to implementation." Therefore you can't rely on the order being preserved. wbrogden@bga.com Author of Soap Programming with Java - Sybex; ISBN: 0782129285 Coauthor of Cocoon 2 Programming - Sybex; ISBN: 0782141315 ------=_NextPart_000_0009_01C2AC05.236E4B80 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
-----Original = Message-----
From: Anna=20 Afonchenko [mailto:anna@ubaccess.com]
Sent: Wednesday, = December 25,=20 2002 5:38 AM
To: cocoon-users
Subject: Cocoon = reversing=20 element attributes at output?

Hi All.
I am writing xsl file that will = catch some=20 nodes (according given XPath) and will output these nodes
as a string.
Here is the code snippet that = outputs the=20 matching node:
<xsl:text>&lt;</xsl:text>
<xsl:value-of=20 select=3D"concat(name(),' ')"/>
<xsl:for-each=20 select=3D"@*">
   =20 <xsl:value-of select=3D"name()"/>
   =20 <xsl:text>=3D"</xsl:text>
   =20 <xsl:value-of select=3D"."/>
   =20 <xsl:text>" </xsl:text>
</xsl:for-each>
<xsl:text>&gt;</xsl:text>
 
So, if, for example, the node = <img=20 src=3D"some.gif" alt=3D""/> is caught, then it will be output as=20 is.
When I was running this xsl using = batch file,=20 everything was OK.
Now I am running it using Cocoon, = and although=20 I get correct nodes caught, for each node all attributes are output in = the=20 reverse order, e.g. for the previous example the result in Cocoon=20 is
<img alt=3D""=20 src=3D"some.gif"/>
This is not a disaster, but it is = rather=20 frustrating, because I would want to copy this node and search it in = the code,=20 but if the attributes are reversed, I wouldn't be able to do=20 it.
 
Does anybody know why Cocoon = reverses=20 attributes order when outputting a node?
 
Thank you very much for = help.
Anna 
 
The=20 SAX event for the start of an element carries attributes in an=20 Attributes
collection. The JavaDocs say "the order of attributes in the = list=20 is unspecified and may vary
from=20 implementation to implementation."  Therefore you can't rely on = the=20 order
being preserved.
 

wbrogden@bga.com
Author of Soap Programming with = Java -=20 Sybex; ISBN: 0782129285
Coauthor of Cocoon 2 Programming - Sybex; = ISBN:=20 0782141315

 
------=_NextPart_000_0009_01C2AC05.236E4B80--