You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by zas <st...@skyguide.ch> on 2006/08/28 11:20:38 UTC

Allowed attributes

I need to find out whether it is allowed adding a certain attribute.

I compare XMLs and need to flag changed elements with an attribute.
Unfortunately some elements can have this change attribute and some cannot.

Can anybody help me.

Thanks
-- 
View this message in context: http://www.nabble.com/Allowed-attributes-tf2176156.html#a6016873
Sent from the Xml Beans - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Allowed attributes

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Say you have an element as 'XmlObject element' and you are interested in
finding out if attribute 'att' is allowed or not.

SchemaType type = element.schemaType();
boolean isAttAllowed = type.getAttributeProperty(new QName("", "att"))
!= null;

Note that this will not handle the case in which there are attribute
wildcards, if you have that (<anyAttribute>) then also take a look at
SchemaType.qnameSetForWildcardAttributes().

Radu

-----Original Message-----
From: zas [mailto:stephan.zahner@skyguide.ch] 
Sent: Monday, August 28, 2006 2:21 AM
To: user@xmlbeans.apache.org
Subject: Allowed attributes


I need to find out whether it is allowed adding a certain attribute.

I compare XMLs and need to flag changed elements with an attribute.
Unfortunately some elements can have this change attribute and some
cannot.

Can anybody help me.

Thanks
--
View this message in context:
http://www.nabble.com/Allowed-attributes-tf2176156.html#a6016873
Sent from the Xml Beans - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org

_______________________________________________________________________
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org