cancel
Showing results for 
Search instead for 
Did you mean: 

How to import more than one XSD's into XI 3.0

Former Member
0 Kudos

Hi all,

I have one scenario in XI 3.0 , where i need to import more than one XSD's into XI for mapping .How can i do this ?

Thanks

Deno

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

I had the same problem, but because SAPXI does not allow different namespaces, I made the following workaround.

We put all schema's in one xsd under namespace http://rep.oio.dk/ubl/xml/schemas/0p71/common/

mail me to get the OIO invoice if you need that (it's too big to post here).

After the message is created in this format, we do a simple XSLT, to change the main namespaces.

See the xslt below.

Good luck,

Edwin Kense.

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="/com:Invoice">

<Invoice>

<!-- <xsl:attribute name="xsi:schemaLocation">http://rep.oio.dk/ubl/xml/schemas/0p71/pie/ http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pielax.xsd</xsl:attribute>;

-->

<xsl:for-each select="com:ID">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:IssueDate">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:TypeCode">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:InvoiceCurrencyCode">

<main:InvoiceCurrencyCode>

<xsl:value-of select="."/>

</main:InvoiceCurrencyCode>

</xsl:for-each>

<xsl:for-each select="com:Note">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:EncodedDocument">

<main:EncodedDocument>

<xsl:value-of select="."/>

</main:EncodedDocument>

</xsl:for-each>

<xsl:for-each select="com:BuyersReferenceID">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:ReferencedOrder">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:BuyerParty">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:DestinationParty">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:SellerParty">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:PaymentMeans">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:PaymentTerms">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:AllowanceCharge">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:TaxTotal">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:LegalTotals">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:InvoiceLine">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:ValidatedSignature">

<xsl:copy-of select="."/>

</xsl:for-each>

<xsl:for-each select="com:ExtensibleContent">

<xsl:copy-of select="."/>

</xsl:for-each>

</Invoice>

</xsl:template>

</xsl:stylesheet>

Former Member
0 Kudos

Hi Stephan,

Thanks for the reply. I am aware of the two problems.

For the first problem, I have imported some sample XSDs with references and without restriction for testing and its working & resolved. As u said, the 2nd is the unresolvable one in SP below 12. I am wondering whether even if we get SP12, the second problem would be resolved or not? We know that restriction would be supported in SP12. Since my schemas has lots of references and elements other than restriction like extension etc., I am wondering whether the import would be successfull or not in SP12.

Thanks,

Deno

Former Member
0 Kudos

Hi Deno, am not sure whether i got u rite , however, i beleive any no of XSD's can be imported under "External Definitions" in repository and can be referenced in ur mappings. Is that wat ur looking at ?

Former Member
0 Kudos

Hi Saravana,

I would need to import XSD's into XI repository.

The purpose is for mapping in IR. XSD's are related to electronic invoices need to be given to customers through XI . Pls See the link http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieLax.xsd

for getting an idea of XSD . There are reference types in main (invoice XSD) which are cardinal types and resusable types .Please see and tell me how to import the XSD's related into XI repository for getting the structure needed for mapping ..

Thanks in advance

Deno

Former Member
0 Kudos

Hi Deno,

there is no support for mass upload, you have to upload each needed file separately.

As a first step, I recommend to collect all necessary XSDs as files on your local PC (it is no problem to grab one later, when you found you have forgotten one).

Now you go to Integration Repository and define the first External Definition. Choose a suitable name (e.g. 'Invoice'), the correct category (xsd) and load up the file you grabbed from http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieLax.xsd

into the External Definition.

You will see, that the filename field is filled, but the source field is still empty. Here you can enter the original address http...

In this case this is only for documentation.

When you change to the tab displaying the external references you will find that there is one pointing to http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/Invoice.xsd. The name field behind this is empty, indicating that the Integration Builder was unable to find this file.

The next step will be to create a new External Definition representing that file. Thereby, you proceed the same way. Now it is crucial that you maintain the Source-field. Enter the http-Address cited above. After saving this you can again look at the first External Definition. Now on the tab for external references there should be a name behind the http-address, more precisely there should be the name of the second External Definition.

However, the second External Definition will again have two external references not identified yet. Hence, you have to proceed like this, until all external references are filled.

Note that all these External References have to lie in the same namespace.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephan ,

That's a real detailed explanation, Thanks for that. I was also trying this based on Deno's XSD's that have external references and was stuck.

I beleive this is a gap in XI metadata fetch features, cos i have worked on other EAI tools like TIBCO and they provide support to load XSD's & WSDl's from a URL directly rather than this. What say ?

-Saravana

Former Member
0 Kudos

Hi Stephan,

Thanks for the detailed reply. I have done what u said .The name is appearing correctly behind http.

Once i import to XI the main invoice.xsd from repository in the target structure space provided , i am not getting the structure needed for mapping with invoice idoc (source).I went to messages tab and tried to add external messages one by one .But still that hierarchy is not getting. How to resolve this problem? Please throw some light on this.

--Deno

Former Member
0 Kudos

Hi Deno,

one of the schemas uses xsd:restriction which is currently not supported. In the integration builder documentation you can find a link to an Excel that describes which features of XSD are supported.

The XSD support is substantially extended with SP11 and SP12. xsd:restriction should be supported with SP12.

Until then you would have to edit the XSDs manually in order to come to an XSD which uses only supported features (at the important places).

Greetings

Stephan

Former Member
0 Kudos

Hi Saravana,

the philosophy of the integration builder is rather to have all needed definitions inside the repository in order to avoid problems with firewalls, security settings, availability of websites....

Remember that integration builder content may be transported between different repositories which potentially have different possibilities to access the web.

Nevertheless, I agree that the importing functionalities could be enhanced. There are some ideas around, but I am not in the position to make any concrete announcements.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephen,

Thanks for providing inputs. I have tried to

import xsd with restriction base. Its a single XSD which when imported, properly displaying the structure . Since my XSD's has many reference types, XI is not decoding it properly to display the relevant structure needed .When i import invoice.XSD which has 2 references, i can get only one single node which is of invoice type .I would like to ask u to try import into XI some XSD's which has reference XSD's so that if it is succeeded, we can proceed accordingly.

Thanks,

Deno

Former Member
0 Kudos

Thanks Saravana,

Thanks for ur inputs as well. Hopefully u might have seen the message to Stephen. I would like to ask u also to try it out.

Thanks,

Deno

Former Member
0 Kudos

Hi Deno,

when you use the procedure I described above the linking between the schemas is performed correct. However, this will not help much, as the schemas contain xsd:restriction in a complexType which is not supported before SP12.

If you think you have a counter example you should provide detailed description what you did (which files did you use, which fields did you fill in your External Definition, in which screen do you see which unexpected result).

Alternatively (or maybe if nothing else helps) someone from SAP support may look at your system. But this would require an OSS message.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephen,

We have SP9. In this pack, as u said xsd:restriction may not be supported & xs:restricion is supported. I would like to know the difference between xsd and xs. I thought both are more or less same. I am really stucked up with the import of reference XSDs. For testing purpose, I have created 4 XSDs which has reference XSDs inside. See below for detailed explanation.

XI3.0 is running in Citrix server.

The four XSDs used for testing are invoice.xsd, invoicetype.xsd,

reusabletypes.xsd & identifertype.xsd. All these XSDs has reference

XSDs in it which is defined using include schema location in it.

Invoice.xsd has invoicetype.xsd and identifiertype.xsd as reference

XSD’s in it.

Invoice type has complex type defined in it which is used in

Invoice.xsd.

Reusabletypes.xsd has identifiertype.xsd as reference XSD in it.

Identifiertype.xsd has complex type defined in it which is used in

Reusabletypes.xsd

Root element is in Invoice.xsd.

I am pasting the four XSD's prepared by me here.

Invoicetype.xsd

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

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

<xs:include schemaLocation="ReusableTypes.xsd"/>

<xs:complexType name="InvoiceType">

<xs:sequence>

<xs:element name="AccountsContact"/>

<xs:element name="ActualPackage"/>

</xs:sequence>

</xs:complexType>

</xs:schema>

Invoice.xsd

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

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

<xs:include schemaLocation="InvoiceType.xsd"/>

<xs:include schemaLocation="ReusableTypes.xsd"/>

<xs:element name="Invoice">

<xs:annotation>

<xs:documentation>Comment describing your root element</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:complexContent>

<xs:restriction base="InvoiceType">

<xs:sequence>

<xs:element name="AccountsContact" type="AccountsContactType"/>

<xs:element name="ActualPackage" type="ActualPackageType"/>

</xs:sequence>

</xs:restriction>

</xs:complexContent>

</xs:complexType>

</xs:element>

</xs:schema>

ReusableTypes.xsd

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

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

<xs:include schemaLocation="IdentifierType.xsd"/>

<xs:complexType name="AccountsContactType" id="UBL000001">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

<xs:sequence>

<xs:element name="ID" type="IdentifierType" id="UBL000002">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="Name" id="UBL000003" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="Phone" id="UBL000004" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="Fax" id="UBL000005" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="E-Mail" id="UBL000006" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

</xs:sequence>

</xs:complexType>

<xs:complexType name="ActualPackageType" id="UBL000007">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

<xs:sequence>

<xs:element name="ID" type="IdentifierType" id="UBL000008">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="Quantity" type="xs:int" id="UBL000009" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="ReturnableMaterialIndicator" type="xs:string" id="UBL000010" minOccurs="0">

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

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

<xs:annotation>

<xs:documentation>

</xs:documentation>

</xs:annotation>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:schema>

IdentifierType.xsd

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

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

<xs:complexType name="IdentifierType">

<xs:sequence>

<xs:element name="IDName" type="xs:string"/>

<xs:element name="IDValue" type="xs:string"/>

</xs:sequence>

</xs:complexType>

</xs:schema>

These are simple XSDs prepared for testing import of

XSDs which has reference XSDs.

What I have done is explained below.

1) Created 4 external definitions in XI Integration repository

under same namespace for these four XSDs(Category:xsd, Messages: From All Available Global elements,Source field for external definitions is left blank bcoz no idea what to give for source). I can see in the external

references tab, the source appearing as the include schema location XSD (for eg:<xs:include schemaLocation="ReusableTypes.xsd" /> for InvoiceType.xsd), but name is blank.

2) Imported invoice.xsd (which has root element) into the target structure of message

mapping editor. I am getting only one node instead of whole structure.

This means XI has considered only invoice.xsd and not reference XSDs.

Please tell me stepwise how to import these into XI.

I would recommend you to try import once and see whether

you are getting structure instead of only one node.

Expecting reply soon. Please find time to reply soon.

Thanks in advance.

Thanks,

Deno

Former Member
0 Kudos

Hi Deno,

whether you use 'xsd' or 'xs' as a namespace prefix for the schema namespace does not matter, it is just an alias. (You could even use something strange like 'mySchemaAlias' if you do it consistently).

As I already wrote in my first reply the correct maintenance of the 'source'-field of your External Definitions is crucial in order to get them linked.

E.g. for the External Definition representing ReusableTypes.xsd you should enter "ReusableTypes.xsd" into the source field, as the other schemas refer to this address via the schemaLocation. (In my first answer I recommended to enter some http-address in the source-field, as the schemas you referred to in this case used http-addresses in their schemaLocations).

If you do this correctly, the linking of the documents will work. However, this may be of limited use, as xsd:restriction (or xs:restriction if you prefer it) is not fully supported before SP12.

Greetings Stephan

Former Member
0 Kudos

Hi,

I had a similar scenario and it works fine for me.

As said earlier the key is the "source" field location while creating the External Defintion.

okay here are the steps:

1. Import Schema1 which is referencing Schema2.

2. In the External References tab of "Schema1" you should see schema2.

3. Now import Schema2.

4. In the "source" field of Schema2 type in the exact path that you had seen in step2 for schema2.

5. The source path can be either http or file path :c:\ashish\etc".

You are done . Now the linkage is established and you can import this in XI and you should see the references in the Message types when you import it.

Thanks

Ashish

Former Member
0 Kudos

Hi Ashish,

Which ServicePack are u using? Does XSD contains

any schema element 'restriction' in it? I understood from

service marketplace (service.sap.com/xi ® Media Library ® Documentation: SAP XI 3.0 (SP1) - Supported XML Schema and WSDL (EN)) that 'restriction' is only supported from

SP12 which will only be launched in May. I have successfully imported the xsds mentioned in my previous mail to Stephen in SP9. I have commented out 'restriction'

& 'complex content' from the XSD and imported successfully. Thats why I am asking you whether ur XSD has restriction element & complex content used in it.

Please try importing

http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/Invoice.xsd

into XI which has reference schemas in it.

The related schemas are

http://rep.oio.dk/ubl/xml/schemas/0p71/common/0p70dk_Reusable.xsd

http://rep.oio.dk/ubl/xml/schemas/0p71/common/CoreComponentParametersDk.xsd

http://rep.oio.dk/ubl/xml/schemas/0p71/common/CoreComponentTypesDk.xsd

http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/nonCardinalTypes.xsd

http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/reusabletypes.xsd

These schemas has 'restriction'element in it. Please find time to do this and reply back with the results.

Thanks,

Deno

Former Member
0 Kudos

Hi Deno,

please be aware that you have two problems which are totally independent.

1. How to handle schemas spread over several files.

2. How to handle xsd:restriction

For the first problem use the 'source'-field as described by Ashish and myself.

For the second problem you have to wait until SP12 or, as a workaround, manually change the schemas.

To me it seems that you are mixing up the two problems.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephan,

I have to deliver an XML out from XI which has 3 namespaces

like <invoice xmlns="https..............."

xmlns:com="https..........."

xmlns:main="https............">.

This xml should be delivered to customer.

If the order of this namespace is changed, will it be a problem for customers to receive it. Is it mandatory that the namespace should be in exact order. I have a scenario where I am getting output xml from XI in an order which is different to the order mentioned above.

Thanks,

Deno

Former Member
0 Kudos

Hi Deno,

I am not sure whether I get your question right. I think you ask whether the fragment you wrote and

e.g. <invoice xmlns:main="https............" xmlns:com="https..........." xmlns="https...............">

are equivalent.

Yes, they are. The order of the namespace declarations does not matter.

Greetings

Stephan

Former Member
0 Kudos

Thanks Stephan. I meant exactly what You understood.

Thanks again.

Deno

jakob_steen-petersen
Active Participant
0 Kudos

Hi Deno

We have been working with the same schemas as you and did´nt find a solution. I think steh easiest way is to an external mapping tool (as xmlspy) to do your mappings and then use this external mapping.

Another problem that you will reach is that the oioxml files that you receives will contain different namespace declarations according to the contence of the doc.

So try to do an external mapping.

Former Member
0 Kudos

Hi Stephan,

When i am doing XSLT mapping between idoc(invoic01).XSD and invoice.xsd,

Material number is coming out after mapping as 00000000000000001. But I need '1'. Same for

another material 000000000000000121 , needed is '121'.

Need to take out zeros from 000000000000000000001 and 0000000000000121. How to do this? Thanks in advance.

Thanks

Deno