cancel
Showing results for 
Search instead for 
Did you mean: 

DTD's using namespace

Former Member
0 Kudos

Hello,

In the topic there was a comment made that namespaces shall not be used in dtd's. We have received a dtd that contains a namespace that generates an error at the moment we import the file. (Unable to convert imported document to WSDL - Reason: Name "eb:MessageHeader" is incorrect - Check the selected category).

My question is: how can we convert/use this dtd so we can use it in the graphical mapping?

Thanks for your help,

Rudy Claassen

Message was edited by: Rudy Claassen (added correct link)

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Rudy,

<b>You can specify namespace in your DTD.</b>

Go to this link and have a look

http://bobcat.webappcabaret.net/javachina/faq/xml_01.htm#dtd_Q25

You can specify namespace in your DTD

For eg:-

<!ELEMENT first (head, rzpara)>

<!ATTLIST rzdocument

first CDATA #FIXED "http://www.rz.com"

>

<!ELEMENT head (#PCDATA)>

<!ELEMENT rzpara (#PCDATA | rzem)*>

<!ATTLIST rzpara

first CDATA #FIXED "http://www.rz1.com"

>

<!ELEMENT rzem (#PCDATA)>

<!ENTITY first "rz:document">

Here if you haven't given <b><!ENTITY first "rz:document"></b> then there will be a problem when you try to convert the document to wsdl.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I tried to apply this suggestion to my dtd. I replace all 'eb:' by 'eb' and defined the ENTITY in the ATTLIST of these elements. The wsdl generation is now running ok, but the namespace is not taken into account. The elements are all called 'ebxxxx' in stead of 'eb:xxx'.

Did I miss something here?

Thanks,

Rudy

former_member187339
Active Contributor
0 Kudos

Hi Rudy,

Look at the following code

<b><!ELEMENT first (head, rzpara)></b>

<!ATTLIST rzdocument

first CDATA #FIXED "http://www.rz.com"

>

<!ELEMENT head (#PCDATA)>

<!ELEMENT rzpara (#PCDATA | rzem)*>

<!ATTLIST rzpara

first CDATA #FIXED "http://www.rz1.com"

>

<!ELEMENT rzem (#PCDATA)>

<b><!ENTITY first "rz:document"></b>

Actually <b>rz:document</b> was giving error in the wsdl, hence I changed it with a constant <b>first</b> (as <!ENTITY first "rz:document">).

<i>>>I replace all 'eb:' by 'eb'</i>

Try giving ENTITY for the 'eb:xxxx' fields rather than changing it.

Hope it will be helpful.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I tried again, but not with the effect I expected. I also imported your rz example. The wsdl is ok, but when I make a map to the message 'first' the elements do not have the namespace. They are called rzpara for example, where I would expect rz:para.

Maybe it is not the dtd, but the message mapper that cannot handle the ':' sign.

Regards,

Rudy

Former Member
0 Kudos

Hi Suraj,

I managed to get it in by first uploading the dtd without the namespace. Then I downloaded the generated wsdl and in the wsdl I put back the namespaces again. This worked for the element names, but not the (complex) type definitions. Those have to be defined without the namespace. I will test whether this causes a problem for us later on, but at this moment I am quite happy.

Thanks for pointing me in the right direction.

Regards,

Rudy

Former Member
0 Kudos

Too bad, I was too enthousiastic. The message looked ok in the message mapping, but I could not activate the external definition, it throws the following error:

Cause: Unable to recognize the loaded document as valid WSDL The value "eb:MessageHeader" is not permitted for the attribute "name" of the "NCName" type in the "/schema/complexType("Envelope")/sequence/element("eb:MessageHeader")" element

I am about to give up and look for a different mapping tool to achieve this.

Answers (0)