XMLDTD Issues Urgent

Peers,

Really Appreciate your help here

Currently, I have to map a SAP IDoc to an XML.

The DTD of the XML has an element called InvoiceGroup
InvoiceGroup (InvoiceHeader, InvoiceDetail*, InvoiceSummary)+

When I load the DTD into I.S., I.S. create a document type

InvoiceGroup
InvoiceHeader <- Document List
InvoiceDetail <- Document List
InvoiceSummary <- Document List

When I map the data from SAP IDoc to the XML, the following XML will be
generated (as an example)

<invoicegroup>
<invoiceheader></invoiceheader>
<invoiceheader></invoiceheader>
<invoicedetail></invoicedetail>
<invoicedetall></invoicedetail>
<invoicesummary></invoicesummary>
<invoicesummary></invoicesummary>
</invoicegroup>

which is not valid according to the DTD.

The XML requried should look like

<invoicegroup>
<invoiceheader></invoiceheader>
<invoicedetall></invoicedetail>
<invoicesummary></invoicesummary>
<invoiceheader></invoiceheader>
<invoicedetail></invoicedetail>
<invoicesummary></invoicesummary>
</invoicegroup>

The schema generated by I.S. is correct. However, I have a hard time
playing around with the document type to generate an actual XML to satisfy the DTD.

The DTD is given by a government department, thus I cannot modify it

Thanks in advance

Hi Stephen,
did you map each individual element(i.e. invoiceheader–invoiceheader) or mapped invoicegroup–invoicegroup. if you map invoicegroup–>invoicegroup then it should work.

Regard’s
MKR

Stephen,

If you want to see the XML in this format
<invoicegroup>
<invoiceheader></invoiceheader>
<invoicedetall></invoicedetail>
<invoicesummary></invoicesummary>
<invoiceheader></invoiceheader>
<invoicedetail></invoicedetail>
<invoicesummary></invoicesummary>
</invoicegroup>

then you might have to change the DocumentType structure in this way.
<invoicegroup>
------><invoiceheader></invoiceheader> --DocumentList
-------------><invoicedetall></invoicedetail>—underneath Header DocList
-------------><invoicesummary></invoicesummary>----DocumentList
Once after mapping the each instance of the above Invoice Header structure,use the appendToDocumentList Service

------><invoiceheader></invoiceheader> --DocumentList
-------------><invoicedetall></invoicedetail> —underneath Header DocList
-------------><invoicesummary></invoicesummary>----DocumentList
</invoicegroup>

But this mapping is very critical and just careful when appending the doclist’s and drop the temporary documents before appending.

HTH,
RMG.

RMG & MKR

Thanks for the input

But if I change the Document Type to
<invoicegroup>
------><invoiceheader></invoiceheader> --DocumentList
-------------><invoicedetall></invoicedetail>—underneath Header DocList
-------------><invoicesummary></invoicesummary>----DocumentList

Then the generated XML will be

<invoicegroup>
----<invoiceheader>
---------><invocedetail></invoicedetail>
---------><invoicesummary></invoicesummary>
----</invoiceheader>
----<invoiceheader>
---------><invocedetail></invoicedetail>
---------><invoicesummary></invoicesummary>
----</invoiceheader>
</invoicegroup>

Instead of the required
<invoicegroup>
------><invoiceheader></invoiceheader> --DocumentList
-------------><invoicedetall></invoicedetail>—underneath Header DocList
-------------><invoicesummary></invoicesummary>----DocumentList

Then the generated XML will be

<invoicegroup>
----<invoiceheader></invoiceheader>
----<invocedetail></invoicedetail>
----<invoicesummary></invoicesummary>
----<invoiceheader></invoiceheader>
----<invocedetail></invoicedetail>
----<invoicesummary></invoicesummary>
</invoicegroup>

Stephen,

Since all the document structures are documentlist
InvoiceHeader <- Document List
InvoiceDetail <- Document List
InvoiceSummary <- Document List

Unless you manipulate in the mapping of appending Header,Detail,Summary part and child elements i dont think there is a way to do as expected by changing in the doctype structure of the InvoiceGroup.

<invoicegroup>
----<invoiceheader></invoiceheader>
----<invocedetail></invoicedetail>
----<invoicesummary></invoicesummary>
----<invoiceheader></invoiceheader>
----<invocedetail></invoicedetail>
----<invoicesummary></invoicesummary>
</invoicegroup>

Since you are tied up not changing the Schema its hard to manage and format according to your requirement.

HTH,
RMG