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
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
setAttributesets an attribute for the given element.Attribute is an XML attribute, so, if you have
and you call
setAttribute, specifying thatattrshould have the value ofval, then it will convert the above toaddContentappends all children in the given collection to the end of the content list.So, if you specify your children, then they will be added between the
>and the<sign of the element, likewhere ... represents whatever content you have defined.