Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » How to find out when an attribute is a ref or not?
How to find out when an attribute is a ref or not? [message #36434] Thu, 22 January 2004 11:57 Go to next message
Eclipse UserFriend
Originally posted by: niemaz.xrce.xerox.com

Hi,
I'm stuck with this problem : I'd like to find out when an attribute is a
reference (of type) or has real content ... tried everything I could
around isAttributeDeclarationReference() methods like but in vain ;-(
Any ideas?

Thanx,

--mike

<xs:simpleType name="st2">
<xs:restriction base="xs:string">
<xs:enumeration value="air"/>
<xs:enumeration value="land"/>
<xs:enumeration value="any"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="iti" type="st2" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>bla 111</xs:documentation>
</xs:annotation>
</xs:element>

<xs:element name="utu">
<xs:complexType>
<xs:attribute name="att1" type="st2"/>
</xs:complexType>
</xs:element>

<xs:element name="loc">
<xs:complexType>
<xs:attribute name="at3">
<xs:simpleType name="st3">
<xs:restriction base="xs:string">
<xs:enumeration value="air"/>
<xs:enumeration value="land"/>
<xs:enumeration value="any"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Re: How to find out when an attribute is a ref or not? [message #36525 is a reply to message #36434] Thu, 22 January 2004 13:51 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Mike,

If isAttributeDeclarationReference returns true, it's a reference, otherwise,
it's not. Similary, if x.getResolvedAttributeDeclaration returns something
other than x itself, it's a reference, otherwise, it's not. What are you
trying to do beyond that? (Note that there are no attribute references in
your sample below.)


mike wrote:

> Hi,
> I'm stuck with this problem : I'd like to find out when an attribute is a
> reference (of type) or has real content ... tried everything I could
> around isAttributeDeclarationReference() methods like but in vain ;-(
> Any ideas?
>
> Thanx,
>
> --mike
>
> <xs:simpleType name="st2">
> <xs:restriction base="xs:string">
> <xs:enumeration value="air"/>
> <xs:enumeration value="land"/>
> <xs:enumeration value="any"/>
> </xs:restriction>
> </xs:simpleType>
>
> <xs:element name="iti" type="st2" maxOccurs="unbounded">
> <xs:annotation>
> <xs:documentation>bla 111</xs:documentation>
> </xs:annotation>
> </xs:element>
>
> <xs:element name="utu">
> <xs:complexType>
> <xs:attribute name="att1" type="st2"/>
> </xs:complexType>
> </xs:element>
>
> <xs:element name="loc">
> <xs:complexType>
> <xs:attribute name="at3">
> <xs:simpleType name="st3">
> <xs:restriction base="xs:string">
> <xs:enumeration value="air"/>
> <xs:enumeration value="land"/>
> <xs:enumeration value="any"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:attribute>
> </xs:complexType>
> </xs:element>
Re: How to find out when an attribute is a ref or not? [message #583115 is a reply to message #36434] Thu, 22 January 2004 13:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Mike,

If isAttributeDeclarationReference returns true, it's a reference, otherwise,
it's not. Similary, if x.getResolvedAttributeDeclaration returns something
other than x itself, it's a reference, otherwise, it's not. What are you
trying to do beyond that? (Note that there are no attribute references in
your sample below.)


mike wrote:

> Hi,
> I'm stuck with this problem : I'd like to find out when an attribute is a
> reference (of type) or has real content ... tried everything I could
> around isAttributeDeclarationReference() methods like but in vain ;-(
> Any ideas?
>
> Thanx,
>
> --mike
>
> <xs:simpleType name="st2">
> <xs:restriction base="xs:string">
> <xs:enumeration value="air"/>
> <xs:enumeration value="land"/>
> <xs:enumeration value="any"/>
> </xs:restriction>
> </xs:simpleType>
>
> <xs:element name="iti" type="st2" maxOccurs="unbounded">
> <xs:annotation>
> <xs:documentation>bla 111</xs:documentation>
> </xs:annotation>
> </xs:element>
>
> <xs:element name="utu">
> <xs:complexType>
> <xs:attribute name="att1" type="st2"/>
> </xs:complexType>
> </xs:element>
>
> <xs:element name="loc">
> <xs:complexType>
> <xs:attribute name="at3">
> <xs:simpleType name="st3">
> <xs:restriction base="xs:string">
> <xs:enumeration value="air"/>
> <xs:enumeration value="land"/>
> <xs:enumeration value="any"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:attribute>
> </xs:complexType>
> </xs:element>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:finding elements or attributes based on Types
Next Topic:Annoucement: EMF and XSD CVS Repositories
Goto Forum:
  


Current Time: Wed Apr 24 14:57:33 GMT 2024

Powered by FUDForum. Page generated in 0.03267 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top