on 12-07-2010 9:07 AM
Hi,
I am implementing this cxml to IDOC scenario in PI.
I have downloaded invoicedetail.dtd file from cxml website and converted it into XSD.
then I have imported xsd into external definition. after that I can see various messages in the message tab. like HEADER , INVOICE REQUEST.
Where as I was expecting that these elements will be grouped in a segment ??? is that correct ? as any inbound cxml file will have header and invoice lines with them , so should they be separate messages ? something wrong ?
Regards
Hello,
Since you have already converted it to an xsd, maybe it would help to look inside the xsd for the message that would contain both the HEADER and the INVOICE BODY. e.g
<xsd:complexType name="rootType">
<xsd:sequence>
<xsd:element name="HEADER" type="headerType"/>
<xsd:element name="BODY" type="invoiceType"/>
</xsd:sequence>
</xsd:complexType>
I'm not sure if my syntax is correct as I'm not using any XML tools right now. But in the example, since the rootType contains both the header and the body, you could look for it's equivalent message type e.g
<xsd:element name="Invoice" type="rootType"/>
Take note that the element name declared above does not belong in any sequence.
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is the XSD file I created from the invoicedetail.DTD file . original DTD file is at cXML website. Though there is another CXML.DTD file which does have this other node , but for invoice they are suggesting to use invoicedetail.
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:annotation>
-- This schema was automatically generated by Syntext Dtd2Schema --
-- conversion tool (from file: C:\Documents and Settings\bhandariv\Desktop\InvoiceDetail.dtd) --
-- Copyright (C) 2002, 2003 Syntext Inc. See <a href="http://www.syntext.com" TARGET="test_blank">http://www.syntext.com</a> for updates. --
</xs:annotation>
<xs:attributeGroup name='xmlLangCode'>
</xs:attributeGroup>
<xs:attributeGroup name='isoCountryCode'>
</xs:attributeGroup>
<xs:attributeGroup name='isoCurrencyCode'>
</xs:attributeGroup>
<xs:attributeGroup name='uint'>
</xs:attributeGroup>
<xs:attributeGroup name='URL'>
</xs:attributeGroup>
<xs:element name='Accounting'>
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element ref='Segment' maxOccurs='unbounded'/>
<xs:element ref='AccountingSegment' maxOccurs='unbounded'/>
</xs:choice>
</xs:sequence>
<xs:attribute name='name' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='AccountingSegment'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Name'/>
<xs:element ref='Description'/>
</xs:sequence>
<xs:attribute name='id' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='Address'>
<xs:complexType>
<xs:sequence>
<xs:element ref='Name'/>
<xs:element ref='PostalAddress' minOccurs='0'/>
<xs:element ref='Email' minOccurs='0'/>
<xs:element ref='Phone' minOccurs='0'/>
<xs:element ref='Fax' minOccurs='0'/>
<xs:element ref='URL' minOccurs='0'/>
</xs:sequence>
<xs:attribute name='isoCountryCode'/>
<xs:attributeGroup ref='isoCountryCode'/>
<xs:attribute name='addressID'/>
</xs:complexType>
</xs:element>
<xs:element name='AgreementItemOut'>
<xs:complexType>
<xs:sequence>
<xs:element ref='MaxAmount' minOccurs='0'/>
<xs:element ref='MinAmount' minOccurs='0'/>
<xs:element ref='MaxReleaseAmount' minOccurs='0'/>
<xs:element ref='MinReleaseAmount' minOccurs='0'/>
<xs:element ref='ItemOut'/>
</xs:sequence>
<xs:attribute name='maxQuantity'/>
<xs:attribute name='minQuantity'/>
<xs:attribute name='maxReleaseQuantity'/>
<xs:attribute name='minReleaseQuantity'/>
</xs:complexType>
</xs:element>
Edited by: V bhandari on Dec 7, 2010 9:01 PM
Hi,
When I imported the document, I am seeing 4 messages (on the same level):
Accounting
AccountingSegment
Address
AgreementItemOut
Which I think is not what is your requirement. Are there multiple xsds generated? If so, you need to import them one by one in PI. Also, If you will be using the .dtd itself, you need to clear out the any namespaces since this is not allowed in PI 7.1.
Hope this helps,
Mark
Hi Mark,
Yes they are on same level. Now on CXML website there are two DTD files.
cXML.DTD
there is an element CXML ( which I need as root element)
Invoicedetail.DTD
in there are 2 elements on same level , which I need
Header
InvoiceLInes
Now, The file I am expecting will come as
CXML
Hedaer
Invoicelines
</>
Now the issue is if I have two diff DTD , How can I map it to one message interface ? so that it resembles the incoming XML file?
Hi.
I'm not sure if DTDs can have multiple references just like xsds. But in your case, since you have a DTD to XSD converter. You can try creating another xsd that will contain the CML structure, Header and Invoicelines. No need to copy paste, just use the xsd:include in your declaration.
Hope this helps,
Mark
Hi,
A DTD can be composed of many messages. Usually, the name of the DTD itself will indicate the root node of the message that will contain the sub-messages. e.g for Orders.dtd, go to the Messages tab in the external definition and find the Orders there. The Orders message will contain all the items from Header to Items. It should also be the same in your case.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.