Home > Software design >  Difference between setattribute and addContent in jdom? I dont understand what is the difference
Difference between setattribute and addContent in jdom? I dont understand what is the difference

Time:03-23

Could someone explain what is the difference between setattribute and addContent in Jdom, when I use this for an element, could someone explain the difference?

I have read the API but I was unable to understand that

CodePudding user response:

setAttribute sets an attribute for the given element.

enter image description here

enter image description here

So, if you specify your children, then they will be added between the > and the < sign of the element, like

<elem>...</elem>

where ... represents whatever content you have defined.

  • Related