ferjani
ferjani

Reputation: 99

XOM + java retrieve a non-element value

here i'm trying to recover the extension value (the AnyType), which is not an element, so the "element.getchild()" and co do not work. Do you have an idea how to fix the problem ? Thanks.

<xsd:extension base="AnyType">
    <xsd:attribute name="Critical" type="xsd:boolean" use="required"/>
</xsd:extension>

Upvotes: 1

Views: 123

Answers (1)

Alex Bishop
Alex Bishop

Reputation: 483

Are you trying to get the value of the base attribute ("AnyType" in this case)? Use the Element.getAttributeValue(String) method:

String baseAttrValue = element.getAttributeValue("base");

Upvotes: 2

Related Questions