HOW TO add a DOCTYPE statement in a xml file

Hi all,

I have this cXML document in wich I need to add the folowing statement :
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.009/InvoiceDetail.dtd">

after the first line in the cXML Invoice document :
<?xml version=“1.0” encoding=“UTF-8”?>

I currently have the following :
<?xml version=“1.0” encoding=“UTF-8”?>
<cXML payloadID=“20041231114548359.218b5630-5b19-11d9-9e1f-df81d26919c4.0a02151bf70d8bb20000b89b@server” timestamp=“2004-12-31T11:45:48-MET”>
<Header>
<From>
<Credential domain=“NetworkID”>

How am I suuposed to do it ?

Thanks a lot,

Renaud

Renaud,

In your pub.xml:documentToXMLString statement populate the dtdHeaderInfo input parameter by setting “systemID” to “http://xml.cxml.org/schemas/cXML/1.2.009/InvoiceDetail.dtd” and “rootLocalName” to “cXML”.

Mark

Rangoon,

I don’t understand why you want to add an XML processing instruction (like DOCTYPE) or the XML Version tag to a webMethods DocumentType (which is not XML).

Perhaps you could explain more about why you need those things or post an example of a cXML documentType that you are attempting to construct.

Mark

Hi,

Sorry for the delay, Had to handle an other issue.

To sum it up, we need to wend a cXML v1.2.11 Invoice to ARIBA.

The whole cXML structure is set and corrcet but ARIBA requieres the Invoice to have a DOCTYPE statement as follow :

<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.009/InvoiceDetail.dtd">
<cXML payloadID=“20050105143037922.fc439c80-5f1d-11d9-9d5c-a03d8c844423.0a02151bf70d311d0000ff03@nikto” timestamp=“2005-01-05T14:30:37-MET”>
<Header>
<From>
<Credential domain=“NetworkID”>
<Identity>AN0123456789-T</Identity>
</Credential>
</From>

and this is what I send (note the missing DOCTYPE)

<?xml version=“1.0” encoding=“UTF-8”?>
<cXML payloadID=“20050105143037922.fc439c80-5f1d-11d9-9d5c-a03d8c844423.0a02151bf70d311d0000ff03@nikto” timestamp=“2005-01-05T14:30:37-MET”>
<Header>
<From>
<Credential domain=“NetworkID”>
<Identity>AN0123456789-T</Identity>
</Credential>
</From>

What method will you use to post the cXML document to Ariba? Are you sending it in string format using something like pub.client:http or are you using some Ariba onramp built-in service that accepts an IS document?

See my earlier post for how to add the !DOCTYPE declaration to your XML document.

Mark

Hello Mark,

Actually I’m using TN’s partner’s properties (Delivery Methods / Default Protocol = HTTP to Ariba).

For internal reasons my mapping service needs to give me a cXML document and not a String containing cXML. Then this cXML document is wrapped into a generic document, processed by Internal rules and finally passed to TN for sending to Ariba.

I tried using “pub.xml:documentToXMLString”, the problem is that my encoding and doctype get lost during the conversion back to cxml (string->cxml).
I also tried using a java service that used the insertAfter method but I wasn’t much help neither.

So my wondering is why I can’t have my cXML handling its DOCTYPE statement when I use it as a document ?..
… and my question is how to have my cXML handling its DOCTYPE statement when I use it as a document

Rangoon,

We have been sending invoices to Ariba for over a year now and have never had to wrap the document. I think it’s worthwhile looking at your architecture, because Ariba will be expecting the invoice as a string.
You are correct in that the Doctype declaration will not be retained when the xml string is converted to a document
2 cents
T

Finally, we’re on to install Ariba OnRamp 2.0 wich includes invoice sending. We currently have an issue on this install (waiting for feedback from WM support), I’ll let you know how good it’ll help.

Thanks for your help and comments !

Hi Topetee,

I need to sent cxml invoice to a customer’s ARIBA account. Can you please guide me on how to go about it. Can we just use WmPublic/pub.client:http to send the invoice or do we need to use Ariba OnRamp services. We are using WM 6.1 and Ariba OnRamp 2.0. Any inputs will be helpfull as I’m new to this stuff.

Thanks,
Ramya