RE: Attributes from a different namespace

You can't write type="java:IsBridge" because java:IsBridge is an attribute,
not a type.
 
I'm not sure what you wanted it to mean.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Sent: 06 March 2007 08:50
To: xmlschema-dev@w3.org
Subject: Attributes from a different namespace



Hi All,

 

Iam newbie regarding xml and xsd. I am facing below issue, Can anyone please
tell me a way out.

 

I have below schema - java1.xsd

 


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

<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Prakash
Bettadapur (private) -->

<java:schema xmlns="http://www.cisco.com/efg/abc/java" 

xmlns:java="http://www.w3.org/2001/XMLSchema" 

attributeFormDefault="unqualified" elementFormDefault="qualified" 

targetNamespace="http://www.cisco.com/efg/abc/java">

      <java:simpleType name="javaTypeOfReference">

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

                  <java:enumeration value="Set"/>

                  <java:enumeration value="Bag"/>

                  <java:enumeration value="List"/>

            </java:restriction>

      </java:simpleType>

      <java:attribute name="IsBridge" type="java:boolean"/>

</java:schema>

 

 

I have imported above xsd into below schema - base1.xsd, a snippet of which
is as shown below

 


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

<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Prakash
Bettadapur (private) -->

<xs:schema 

xmlns="http://www.cisco.com/efg/abc" 

xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified" elementFormDefault="qualified"

xmlns:java="http://www.cisco.com/efg/abc/java"

targetNamespace="http://www.cisco.com/efg/abc">

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

 

....................... 

<xs:complexType name="attributeType">

            <xs:sequence>

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

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

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

            </xs:sequence>

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

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


            <xs:attributeGroup ref="statusAttrGroup"/>            

            <xs:attribute name="IsHidden" type="java:IsBridge"/> ----->
Error

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

      </xs:complexType>

.......

</xs:schema>

 

Iam getting error in base1.xsd saying

Problems were detected while validating and converting the XML Schemas

  Error: XSD: Attribute reference
'http://www.cisco.com/efg/abc/java#IsBridge' is unresolved : URI
file:/D:/swayam/Polyphony/EFG_schema/abc_21.xsd Line 88 Column 3

 

Thanks

Swayam

Received on Tuesday, 6 March 2007 21:29:04 UTC