Creation of attributes using reference

I have defined various schemas and refernces as shown below. I want to define an attribute(about) in 3rd schema(RDF schema) for Description and refer in the first schema as rdf:about. How do i do this. Please help me out.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:dc=“http://purl.org/dc/elements/1.1/” xmlns:ncsp=“http://ncsp.forum.nokia.com/” xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs=“http://www.w3.org/2001/XMLSchema” elementFormDefault=“qualified”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“ADCNCSP”>
<tsd:collection name=“ADCNOKIA”/>
<tsd:doctype name=“ADCNCSP_ROOT”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:import namespace=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” schemaLocation=“rdf”/>
<xs:import namespace=“http://purl.org/dc/elements/1.1/” schemaLocation=“dc”/>
<xs:import namespace=“http://ncsp.forum.nokia.com/” schemaLocation=“ncsp”/>
xs:annotation
xs:documentation/
</xs:annotation>
<xs:element name=“ADCNCSP_ROOT”>
<xs:complexType mixed=“true”>
xs:sequence
<xs:element ref=“rdf:RDF”>
<xs:complexType mixed=“true”>
xs:sequence
<xs:element ref=“rdf:Description”/>
</xs:sequence>
<xs:attribute ref=“rdf:about”/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

DC Schema
<?xml version="1.0" encoding="UTF-8" ?>
- <xs:schema targetNamespace=“http://purl.org/dc/elements/1.1/” xmlns:dc=“http://purl.org/dc/elements/1.1/” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs=“http://www.w3.org/2001/XMLSchema” elementFormDefault=“qualified”>
- xs:annotation
- xs:appinfo
- <tsd:schemaInfo name=“dc”>
<tsd:collection name=“ADCNOKIA” />
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:element name=“title” type=“xs:string” />
<xs:element name=“date” type=“xs:string” />
<xs:element name=“format” type=“xs:string” />
<xs:element name=“identifier” type=“xs:string” />
<xs:element name=“language” type=“xs:string” />
<xs:element name=“subject” type=“xs:string” />
<xs:element name=“publisher” type=“xs:string” />
<xs:element name=“rights” type=“xs:string” />
</xs:schema>

NCSP schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace=“http://ncsp.forum.nokia.com/” xmlns:ncsp=“http://ncsp.forum.nokia.com/” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs=“http://www.w3.org/2001/XMLSchema” elementFormDefault=“qualified”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“ncsp”>
<tsd:collection name=“ADCNOKIA”/>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:element name=“filename” type=“xs:string”></xs:element>
<xs:element name=“filesize” type=“xs:string”></xs:element>
<xs:element name=“id” type=“xs:string”></xs:element>
<xs:element name=“notes” type=“xs:string”></xs:element>
<xs:element name=“class” type=“xs:string”></xs:element>
<xs:element name=“version” type=“xs:string”></xs:element>
<xs:element name=“versiontype” type=“xs:string”></xs:element>
</xs:schema>

RDF schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:dc=“http://purl.org/dc/elements/1.1/” xmlns:ncsp=“http://ncsp.forum.nokia.com/” xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs=“http://www.w3.org/2001/XMLSchema” targetNamespace=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” elementFormDefault=“qualified”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“rdf”>
<tsd:collection name=“ADCNOKIA”/>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:import namespace=“http://purl.org/dc/elements/1.1/” schemaLocation=“dc”/>
<xs:import namespace=“http://ncsp.forum.nokia.com/” schemaLocation=“ncsp”/>
xs:annotation
xs:documentation/
</xs:annotation>
<xs:attribute name=“about” type=“xs:anyURI” />
<xs:element name=“RDF”>
<xs:complexType mixed=“true”>
xs:sequence
<xs:element name=“Description”>
xs:complexType
<xs:choice minOccurs=“0” maxOccurs=“unbounded”>
<xs:element ref=“dc:title”/>
<xs:element ref=“ncsp:filename”/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



Thanks,
Mahesh

Hello mahesh,

In your first Schema, you are referencing RDF element from RDF Schema. Plus you are trying to add Description element in it, which is not required, as you are referencing RDF Element. Now if you want attribute “about” on Element RDF. You can add the reference in rdf Schema itself. As shown below,

<xs:element name = “RDF”>
<xs:complexType mixed = “true”>
xs:sequence
<xs:element name = “Description”>
xs:complexType
<xs:choice minOccurs = “0” maxOccurs = “unbounded”>
<xs:element ref = “dc:title”></xs:element>
<xs:element ref = “ncsp:filename”></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute ref = “rdf:about”></xs:attribute>
</xs:complexType>
</xs:element>

Thanks,
Prashant Jedhe