cancel
Showing results for 
Search instead for 
Did you mean: 

QUERY IN XSD WHILE IMPORTING INTO IR

former_member185845
Active Participant
0 Kudos
49

Dear Collegues,

I am trying to import extensible xsd into IR.After importing i am having a issue.

<u><b>BookCatalogue.xsd (first xsd)</b></u>

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

<!--> <xsd:element name="Book" type="CardCatalogueEntry"/> -->

<xsd:element name="Book">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Title" type="xsd:string"/>

<xsd:element name="Author" type="xsd:string"/>

<xsd:element name="Date" type="xsd:string"/>

<xsd:element name="ISBN" type="xsd:string"/>

<xsd:element name="Publisher" type="xsd:string" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

<u><b>MainSchema.xsd</b></u>

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.library.org" xmlns="http://www.library.org" elementFormDefault="qualified">

<xsd:include schemaLocation="BookCatalogue.xsd"/>

<xsd:element name="BBook" type="Library12"/>

<xsd:complexType name="Library12">

<xsd:sequence>

<xsd:element name="BookID" type="xsd:string"/>

<xsd:element name="Domain" type="xsd:string"/>

<xsd:element name="BookCatalogue">

<xsd:complexType>

<xsd:sequence>

<b> <xsd:element ref="Book" minOccurs="0" maxOccurs="unbounded"/></b> </xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

In XMLSPY when i generate xml ,i could see

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

<!Sample XML file generated by XMLSpy v2006 sp2 U (http://www.altova.com)>

<BBook xmlns="http://www.library.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.library.org

C:\DOCUME~1\cshekar\Desktop\XSLTMAPPING\Bookcatalogue\MainSchema2.xsd">

<BookID>String</BookID>

<Domain>String</Domain>

<BookCatalogue>

<b><Book>

<Title>String</Title>

<Author>String</Author>

<Date>String</Date>

<ISBN>String</ISBN>

<Publisher>String</Publisher>

</Book>

<Book>

<Title>String</Title>

<Author>String</Author>

<Date>String</Date>

<ISBN>String</ISBN>

<Publisher>String</Publisher>

</Book></b> </BookCatalogue>

</BBook>

when i import the main schema.xsd.

while maping i could see

only

<<b>BookID>String</BookID>

<Domain>String</Domain>

<BookCatalogue>

<b><Book></b> the elements under Book are not appearing.

Any pointers to this.

Regards

chandra

Accepted Solutions (1)

Accepted Solutions (1)

former_member206604
Active Contributor
0 Kudos

Hi,

When ever you are refering another XSD which is imported in the IR you need to fill in the Source field.

Try this might work for you

1. When you import the BookCatalogue.xsd under external defintion you will find a field called Source there you just give the value BookCatalogue.xsd.

2. When you import the MainSchema.xsd under external defintion you will find a field called Source there you just give the value BookCatalogue.xsd since you are refering BookCatalogue.xsd inside it.

I used to do this way and it worked I remember but not sure.

Thanks,

Prakash

Answers (2)

Answers (2)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

take a look at this thread. It has a similar problem.

The solution is interesting,

<i>The main XSD file had a default namespace, and also an element that is referring to an element in another XSD file (Import). After changing the default namespace, to a prefix and accordingly manipulating the elements, and then importing them to external definitions the problem got fixed.</i>

Try this.

Regards,

bhavesh

former_member185845
Active Participant
0 Kudos

Thanks ,Its working well

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

I hope you have imported both the XSD's in XI and activate the same?

Regards,

bhavesh

former_member185845
Active Participant
0 Kudos

ya Bhavanesh i have done the same, syill its not showing