You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by prasanna <pr...@netteam.net> on 2001/07/18 02:25:16 UTC
very urgent
Hi,
Im making use of Apache Xerces C.
Im interested in getting the attribute names and values in the order in which they are described in XML.
The method getAttributes( ) of DOM_Node class returns a DOM_NamedNodeMap class,
I retirve the attribute names and values using the item( ) method of this class.
However the attributes get arrange in ascending order, what I want is that the attributes to remain arranged in order in which they are in the XML.
Is it possible to do it?
eg:
<person name="ppp" age="34">
The attributes get arranged in ascending order, so if I write this code
its a pseudo code:
person.getAttributes( ).item( 0 ).getNodeName() ----> would give me "age" rather than "name", because internally things get arranged into ascending order on namednodemap.
I want is that
person.getAttributes( ).item( 0 ).getNodeName() ----> should give me "name".
I hope im clear.
Prasanna Bhale
Net Team Inc.
2101, Arena Blvd.
Suite 100
Sacramento CA - 95834
Main #: 916.566.1120
Fax #: 916.566.1188
Attributes are unordered (formerly Re: very urgent)
Posted by Derek Harmon <lo...@msn.com>.
Prasanna Bhale wrote,
> However the attributes get arrange in ascending order, what I want is
> that the attributes to remain arranged in order in which they are in the
> XML.
Each element can be associated with an unordered collection of attributes.
There is no difference in the information conveyed by,
<elem a='7' b='8' />
and
<elem b='8' a='7' />
The answer then, is that it is not possible (in XML).
Derek Harmon
_
P.S., It's unwise to attach return receipts to messages posted on
mailing lists. If 10% of the people reading this list click "Sure, I
read it," your Inbox will explode. :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org