[jdom-interest] setAttributes method

Ed Maher ed.maher at euromainbt.co.uk
Tue Oct 12 02:04:15 PDT 2004


Given that getAttributes returns a 'live' list, is should not be necessary to call setAttributes at all.
Indeed, calling setAttributes is causing your attribute list to be cleared.
Please take a look at the JavaDoc for these methods for a definitive explanation.

To achieve what you want, I think you can just remove the setAttributes call, and all should be ok.

Hope that helps.

  ----- Original Message ----- 
  From: Mauricio García 
  To: jdom-interest at jdom.org 
  Sent: Tuesday, October 12, 2004 1:56 AM
  Subject: [jdom-interest] setAttributes method

  Hi ,

  I've tried to use a List object to set the order of the attributes of my 
  element.  For example I have the next code:

  List list = elem.getAttributes();
  Attribute attrib = new 

  But, when get the output of my element I can see it has no attributes, but 
  the list had 2 attributes.  Console shows me:

  [Attribute: xsi:schemaLocation="http://www.mmm.cl/SiiDte EnvioDTE_v10.xsd"], 
  [Attribute: version="1.0"]
  [Element: <EnvioDTE [Namespace: http://www.mmm.cl/SiiDte]/>]

  What can I do?  Does not the Element's method "setAttributes" work?

  Note: when I use: 
  it works!  But I need this attribute be the first.

  Express yourself instantly with MSN Messenger! Download today it's FREE! 

  To control your jdom-interest membership:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://servlets.com/pipermail/jdom-interest/attachments/20041012/b7613d69/attachment.htm

More information about the jdom-interest mailing list