ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How can I create a DOCTYPE statement using a prefix?

Post new topic  Reply to topic
 How can I create a DOCTYPE statement using a prefix? « View previous topic :: View next topic » 
Author Message
ninja
PostPosted: Tue Jul 21, 2009 8:08 am    Post subject: How can I create a DOCTYPE statement using a prefix? Reply with quote

Newbie

Joined: 21 Jul 2009
Posts: 8

Hi all,

I'm using WMB 6.1 and I have to create an output like below using ESQL:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE SwInt:ExchangeRequest SYSTEM "Sw.dtd">
<SwInt:ExchangeRequest>
...
</SwInt:ExchangeRequest>

Reading some topics I understood I must use XMLNS parser since DTD support in XMLNSC parser is limited.
Always in some topics I saw the code to produce a similar output without prefixs.

Simple output:
<?xml version="1.0"?>
<!DOCTYPE Order SYSTEM "NewDtdName.dtd">
<Order>
<Test>OK</Test>
</Order>

Simple code:
SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.DocTypeDecl)Order ='';
SET OutputRoot.XMLNS.(XML.DocTypeDecl).(XML.SystemId) = 'NewDtdName.dtd';
SET OutputRoot.XMLNS.(XML.Element)Order.Test = 'OK';

I'm trying to extend this code to get my output but I'm not having good results.

Do you have some advice for me?

Thanks in advance!
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 21, 2009 1:37 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Have you tried simply specifying the prefixed string 'SwInt:ExchangeRequest'?
Back to top
View user's profile Send private message
ninja
PostPosted: Wed Jul 22, 2009 12:25 am    Post subject: Reply with quote

Newbie

Joined: 21 Jul 2009
Posts: 8

Hi Kimbert,

if I write the following code:

SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.DocTypeDecl)myns:Order ='';
SET OutputRoot.XMLNS.(XML.DocTypeDecl).(XML.SystemId) = 'NewDtdName.dtd';
SET OutputRoot.XMLNS.(XML.Element)myns:Order.Test = 'OK';

I get this (not good) output:

<?xml version="1.0"?>
<!DOCTYPE Order SYSTEM "NewDtdName.dtd">
<NS1:Order xmlns:NS1="myns">
<Test>OK</Test><
/NS1:Order>

But if I use this code:
SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.DocTypeDecl)"myns:Order" ='';
SET OutputRoot.XMLNS.(XML.DocTypeDecl).(XML.SystemId) = 'NewDtdName.dtd';
SET OutputRoot.XMLNS.(XML.Element)"myns:Order".Test = 'OK';

...I get the right code!
It sounds a little "tricky" to me since WMB is not aware of the prefix...but if we don't have other solutions it's ok

Thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 22, 2009 1:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Why not declare the namespace?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ninja
PostPosted: Wed Jul 22, 2009 1:53 am    Post subject: Reply with quote

Newbie

Joined: 21 Jul 2009
Posts: 8

Hi Vitor,

if I declare and I use the namespaces, then I will get in the output the xmlns attribute in the elements: and this is unwanted.
The problem is that, I suppose, all namespaces are declared externally in the dtd file but WMB can't understand it.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 22, 2009 1:20 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
It sounds a little "tricky" to me since WMB is not aware of the prefix.
Check the definition of the DOCTYPE tag in the XML specification. It is a 'Name', not a 'QName'. In other words, the string following 'DOCTYPE' is interpreted as a simple XML name, and not as a prefixed name.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How can I create a DOCTYPE statement using a prefix?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.