cancel
Showing results for 
Search instead for 
Did you mean: 

Prolog Useage

Former Member
0 Kudos

Hello guys,

I am sending an IDOC to a 3rd party using HTTP adapter. I need to bring in the Doctype into the payload of the message to the 3rd party. But for some reason the DOCTYPE <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd"> does not come into the payload..

So I used prolog to add in the HTTP adapter but now its comingout as

<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd">

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

which is a FATAL error because the XML tag needs to be the first one.

Any ideas in bringing the DOCTYPE below the XML... or anyother better method of incorporating the DOCTYPE into the message coming out of the Integration server.

I used XSD format to pull in the target message into message mapping.

Thanks,

Ken

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ken,

Are you using ARIBA ? There are numerous problems with the cXML dtd's/xsd's ... they are not accepted by XI for some reason.

You could use the following code in XSL to produce it ...

<xsl:variable name="quote">"</xsl:variable>

<xsl:value-of disable-output-escaping="yes"

select="concat('&lt;!DOCTYPE Numbers SYSTEM ', $quote, 'http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd', $quote,

'&gt;')"/>

except I'm not sure this would be a valid result

Message was edited by: Achmed Aboulcher

Former Member
0 Kudos

Hello Achmed,

i am facing same problem for our scenario. I tried to use this method.

using this method.

it gives error as "Document is not valid xsd since it contains the <value-of> tag ".

Is there any other method to solve this problem.

Thanks,

Gaurav Jain.

Former Member
0 Kudos

My first approach was to use an XSL map after the original map to add the doctype in. I used the following:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- Add the Doctype declaration -->

<xsl:output method="xml" indent="no" doctype-system="http://xml.cxml.org/schemas/cXML/1.2.011/cXML.dtd"/>

<!-- Identity Transform - copy the source XML to the output without any changes -->

<xsl:template match="node() | @*">

<xsl:copy>

<xsl:apply-templates select="node() | @*"/>

</xsl:copy>

</xsl:template>

</xsl:stylesheet>

But it looks like the SAP XSLT Processor has a bug since it creates the DOCTYPE incorrectly:

<!DOCTYPE cXML SYSTEM 'http://xml.cxml.org/schemas/cXML/1.2.011/cXML.dtd' [

]>

Instead of correctly as with the 4 other XSLT processors I tried it with:

<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.011/cXML.dtd">

Therefore I'll need to take the other approach and write a Java map to do it.

Thanks,

Jesse