Hi all,
 
How to get attributes from a XmlObject DomNode? 
 
I have the following schema:
 
 <xs:complexType name="cardType">
        <xs:sequence>
            <xs:element name="available-credit" type="xs:int"/>
            <xs:element name="credit-used" type="xs:int"/>
        </xs:sequence>
        <xs:attribute name="name" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:NMTOKEN">
                    <xs:enumeration value="MasterCard"/>
                    <xs:enumeration value="Visa"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="number" type="xs:string" use="required"/>
    </xs:complexType>
 
I use xmlbean to geneated the type jars and parse the belowing xml to be
a CardType instance, when I want to get the attributes from XmlObject
dom node, I get null(expect name and number attribute), from the
internal node impl(_textsource) I find it's a document fragment
(org.apache.xmlbeans.impl.store.Xobj$DocumentFragXobj), in
org.w3c.dom.Node api, get attribute form document fragment  should be
null, so are there some other way to get those attributes? (I don't know
the exactly attributes the currenly XmlObject has) 
 
<xml-fragment name="Visa" number="1111">
  <available-credit>1000</available-credit>
  <credit-used>2000</credit-used>
</xml-fragment>
 
 
Thanks a lot!
Terry
 
 

Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

Reply via email to