Sorry but this kind of support (programming XXE) is reserved to our
customers.
If you were one of our customers, I would have answered this to you:
Attributes are not objects. Object Attribute is just a very simple data
container (typically returned by iterators) bundling
element+attribute_name+attribute_value. It does not represent the actual
attribute, which is an entry in a private hashtable of Element.
Therefore try:
---
statusAttribute.element.putAttribute(statusAttribute.name, "000_111_000");
---
Stefan Lenselink wrote:
> I have this code (below) which is running inside a command but it won't
> have any effect!! (actualy it does but not permanent....)
>
> When I do a System.out.println(statusAttribute.value) I will see the
> value which i entered but when I check the attribute editor the old
> value is still in it and also when I save the file the value won't be
> saved with the attribute included.
>
> -------Code-------
> XPath xp = XPath.fromString("/article/@status",* **null*);
> Object[] obj = xp.select(doc.getRootElement());
> Attribute statusAttribute = (Attribute) obj[(obj.length - 1)];
> statusAttribute.value = "000_111_000";
> -------Code--------
>
> P.S. the obj is not null. Obj.length is always 1 so the item from the
> Object array is the item at position 0.
>
> What is wrong with te code? I looks like the "master model" won't be
> updated when I alter the value. This is obvious because the value is a
> Public string variable which is accessed directly