prasanna wrote:
004c01c10f20$1f82cb00$3b91a8c0@workgroup">
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".
 
U could use a node attrib. representation to this issue.

i.e.

<attributes>
    <attribute ATTR_NAME="name"/>
    <attribute ATTR_NAME="age"/>
<attributes/>

person.getAttributes( ).item( getMyAttribute(0) ).getNodeName()

where  getMyAttribute(int index) ; is a function U define ..... guess how ;-)

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to