cancel
Showing results for 
Search instead for 
Did you mean: 

DTDs & namespaces

Former Member
0 Kudos

Hi all,

I imported a DTD with one message as an external definition into XI. However, the message from the DTD has no external namespace, which leads to problems later on. Does XI support any method to assign a namespace to a DTD element?

I tried the following within the DTD:

<!ELEMENT inquiry_1_1 (header, items)>

<!ATTLIST inquiry_1_1

xmlns CDATA #FIXED "http://www.sample.com/"

>

...

bur it didn't work

Any help is appreciated!

Thanks,

Matthias

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Matthias,

indeed using a DTD to describe a message using namespaces will not work.

You should use XSD or WSDL to describe such a message.

The following trick might help you to get such a WSDL: Import your DTD as External Definition into the Integration Repository. Then on the WSDL tab you can see a WSDL version of that DTD. Export this to your file system. Now you have to edit this WSDL (introduce the namespace you want to use as targetNamespace of the schema in the types-section, maybe you have to update the elementFormDefault-attribute).

Afterwards you can upload this modified WSDL into the repository as External Definition. The External Definition containing the DTD is not needed any more.

When you go this way you also need some basic XSD-knowledge, but it is probably easier then building your XSD from scratch.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephan,

thanks for your help! I already guessed that I have to use XSDs...

I used XMLSpy to convert my DTD to XSD. I added a targetNamespace to the XSD and imported it into XI. Now it works, with namespace

Thanks,

Matthias

former_member185751
Contributor
0 Kudos

An example of the XSL code might be as follow:

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

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

<xsl:output method='xml' xmlns:ns1="http://www.sample.com" />

<xsl:template match="/">

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

</xsl:template>

</xsl:stylesheet>

Regards,

Sridhar

former_member185751
Contributor
0 Kudos

Hi Matthias,

You can write a XSLT or Java mapping to include the namespace in the transformed XML.

Include this XSLT or Java map as the second mapping step in your interface mapping.

First step in your interface mapping will be your already existing mapping.

Regards,

Sridhar