Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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 User
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 User
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 Merks
Messages: 26054
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>
Previous Topic:finding elements or attributes based on Types
Next Topic:Annoucement: EMF and XSD CVS Repositories
Goto Forum:
  


Current Time: Sat Sep 20 01:56:24 GMT 2014

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

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