LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2007, 09:50 PM   #1
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Rep: Reputation: 30
Setting attribute using xerces DOM in java


Hello,
I am working on xerces parser in java to generate an xml document. Everything is fine with it except that if I add three attributes to a node, they will be shown in alphabetic order, not in the order that I created the attributes.

I used two different ways of creating attribute, but non of them worked fine.

First way:
PHP Code:
fac_item.setAttribute("lastName",lastname);     // Attach lastname attribute to Faculty element
fac_item.setAttribute("firstname",firstname);    // Attach firstname attribute to Faculty element
fac_item.setAttribute("departmentID",dept_id);        // Attach dept_id attribute to Faculty element 
This code produces departmentID first, then firstname and finally lastname, while I want it in the order I wrote the code.

I used the setAttributeNode method way of creating an attribute, but it produced the same output, too.

Any idea how I can change the order?

Thanks in advance.
 
Old 10-27-2007, 09:58 PM   #2
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Original Poster
Rep: Reputation: 30
Please ignore my previous post. I just realized that attribute order is not important in XML.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Axis and Xerces traene Programming 2 09-14-2007 11:48 AM
Java difficulties (setting up a java work box) toaster.waffle Programming 3 03-10-2006 07:54 AM
Installing xerces-c, Help needed Jorek Linux - Newbie 3 10-19-2005 02:10 PM
Xerces: upgrading version 1 to 2 jbsarma Linux - Newbie 2 08-24-2005 02:15 PM
Attribute setting in ftpd swmok Linux - Software 1 05-19-2004 01:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration