Global elements are called open content properties in SDO. The 2.0.1. spec says that a property is from open content if it appears in getInstanceProperties() but not in getType.getProperties(). One way to check this: !d.getType.getProperties().contains(p). Another more efficient way is !p.getContainingType().isInstance(d). In SDO 2.1, there is going to be a new method added, to make this even easier: Property.isOpenContent().
Frank. "Yang ZHONG" <[EMAIL PROTECTED]> wrote on 09/23/2006 03:29:49 PM: > One of my assumptions was wrong: I thought XSDHelper#getGlobalProperty could > be used to help to distinguish local element from global element without > NameSpace. > > I don't think so now since a no-NameSpace global element existence does > *not* prove my Property is an element ref to that. > > I can't find a way in current API to distinguish local element from global > element without NameSpace. > It's blocking one of my work (ChangeSummary StAX writer) unless I use EMF. > > Can any one help please? > > > On 9/23/06, Yang ZHONG <[EMAIL PROTECTED]> wrote: > > > Local XML element doesn't have a NameSpace, > > neither does global XML element without NameSpace. > > It'll be nice for XSDHelper#getNamespaceURI to return "" for local XML > > element (since "" is an *invalid* NameSpace) > > and to return null for global element without NameSpace (since null is > > also used to query Types and Global Properties without NameSpace). > > Is it possible for the Java/C++/PHP specs to clarify that please? > > > > Otherwise, is it possible for the Java/C++/PHP specs to claify returning > > null or "" for both cases > > and to tip users to make another round trip such as > > XSDHelper#getGlobalProperty if necessary please? > > > > I'll blame myself if this note has ever any influence to lead either > > of the Java/C++/PHP specs to ending up with clarifying "either behavior is > > fine with each implementation". > > > > -- > > > > Yang ZHONG > > > > > > -- > > Yang ZHONG --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
