Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: No placeholders for any and anyAttribute in XML though schema has them

From: "Michael Kay" <mike@--------.--->
To: "'Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\)'" <swvemuri@-----.--->, <xmlschema-dev@--.--->
Date: 3/13/2007 9:03:00 AM
I think that your problems are very specific to the XML editing tools you
are using and you would be much better off asking your questions on a forum
associated with those tools. There's nothing wrong with your schema as such.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] On
Behalf Of Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Sent: 13 March 2007 08:25
To: xmlschema-dev@w...
Subject: No placeholders for any and anyAttribute in XML though schema has
them



Hi All,

 

Iam observing a strange behaviour. Pl let me know how to solve this problem.

 

I have three schemas(xsd) Java.xsd, database.xsd, base.xsd.

Iam importing java.xsd and database.xsd into base.xsd.

 

Snippets of all these schemas are given at the end of this email.

 

For instantiating my schema Iam doing below

(a)     Iam generating ecore and genmodel using base.xsd as input.

(b)     Then Iam generating EMF edit and editor plugins.

(c)     Launching a new instance of Eclipse and there Iam instantiating my
schema.

 

 

The problem I am observing is as described below

 

Note that in base.xsd I have a sequence under referenceType. This sequence
has 

        <xs:any namespace="##other" processContents="strict" minOccurs="0"/>

          So while instantiating an XML based on base.xsd, when I right
click on referenceType,

          I did get an option by name "set"(see database.xsd).

          But the problem is the attribute in java.xsd that is "javaAccess"
and

          attribute in database.xsd that is "cascade" are not shown under
referenceType

          though in base.xsd , referenceType has below

            <xs:anyAttribute namespace="##other" processContents="strict" />

 

    

The eclipse and related plugins installation details are as given below

==================================================

I have eclipse 3.2.1(Callisto) with EMF plugins with ver 2.2.1

Iam using EMF plugins of eclipse using which Iam instantiating the schema
and here Iam seeing that

Strange behaviour.

I have installed XMLSpy">XMLSpy Enterprise Edition version 2007 sp2 and
corresponding Eclipse plugin.

am using XMLSpy">XMLSpy only for editing schemas.

 

Thanks,

Swayam

            

    

Java.xsd

------------

<?xml version="1.0" encoding="UTF-8"?>

<java:schema xmlns="http://www.cisco.com/abc/def/java"
xmlns:java="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.cisco.com/abc/def/java"
elementFormDefault="qualified" attributeFormDefault="unqualified">

 

            <java:simpleType name="JavaAccessType">

                        ..

            </java:simpleType>

<java:simpleType name="JavaDataType">

                        <java:restriction base="java:string">

                                    <java:enumeration value="boolean"/>

                                    <java:enumeration value="Boolean"/>

                                    <java:enumeration value="double"/>

                                    <java:enumeration value="Double"/>

                                    ..........

                        </java:restriction>

</java:simpleType>

 

             <java:simpleType name="Package">

                        <java:restriction base="java:string"/> 

             </java:simpleType>

             <java:attribute name="javaAccess" type="JavaAccessType"/>

             <java:attribute name="javaDataType" type="JavaDataType"/>

             <java:attribute name="package" type="Package"/>

</java:schema>

 

Database.xsd

-------------

<?xml version="1.0" encoding="UTF-8"?>

<database:schema xmlns="http://www.cisco.com/abc/def/database"
xmlns:database="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.cisco.com/abc/def/database"
elementFormDefault="qualified" attributeFormDefault="unqualified">

 

            <database:simpleType name="DBInheritanceHierarchyType">

                        .....

            </database:simpleType>

            <database:complexType name="CollectionType" abstract="true" >

                        <database:complexContent>

                                    <database:restriction
base="database:anyType">

                                                <database:attribute
name="KeyColumn" type="database:string" use="required"/>

                                                <database:attribute
name="OneToManyClassName" type="database:string" use="required"/>

                                    </database:restriction>

                        </database:complexContent>

            </database:complexType>

            <database:complexType  name="SetType">

                        <database:complexContent>

                                    <database:extension
base="CollectionType"/>

                        </database:complexContent>

            </database:complexType>

            <database:simpleType name="CascadeType">

                        <database:restriction base="database:string">

                                    <database:enumeration value="all"/>

                                    <database:enumeration value="none"/>

                                    <database:enumeration
value="save-update"/>

                                    <database:enumeration value="delete"/>

                                    <database:enumeration
value="all-delete-orphan"/>                               

                                    <database:enumeration
value="delete-orphan"/>                                    

                        </database:restriction>

            </database:simpleType>

            <database:attribute name="dBInheritanceHierarchy"
type="DBInheritanceHierarchyType"/>

<database:element name="set" type="SetType"/>

            <database:attribute name="cascade" type="CascadeType"/>

</database:schema>

 

Base.xsd

---------

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns="http://www.cisco.com/abc/def"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:java="http://www.cisco.com/abc/def/java"
xmlns:database="http://www.cisco.com/abc/def/database"
targetNamespace="http://www.cisco.com/abc/def"
elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:import namespace="http://www.cisco.com/abc/def/java"
schemaLocation="java.xsd"/>

            <xs:import namespace="http://www.cisco.com/abc/def/database"
schemaLocation="database.xsd"/>

            <xs:complexType name="referenceType">

                        <xs:sequence>  

                                    <xs:any namespace="##other"
processContents="strict" minOccurs="0"/>                     

                                    <xs:element name="description"
type="xs:string" minOccurs="0"/>

                                    <xs:element ref="assert" minOccurs="0"
maxOccurs="unbounded"/>

                                    <!--xs:element name="Set" minOccurs="1"
type="database:Set" /-->                                         

                        </xs:sequence>

                        < !--xs:attribute name="JavaAccessType"
type="java:JavaAccessType"/>

                        <xs:attribute name="Cascade"
type="database:Cascade"/-->

                        <xs:attribute name="name" type="xs:string"
use="required"/>

                        <xs:attribute name="targetIsA" type="xs:string"
use="optional"/>

                        <xs:anyAttribute namespace="##other"
processContents="strict" /> 

            </xs:complexType>

            .........

            .........

</xs:schema>

 

 

 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent