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 » CREATING XML

Post new topic  Reply to topic Goto page Previous  1, 2
 CREATING XML « View previous topic :: View next topic » 
Author Message
mapa
PostPosted: Tue Apr 24, 2012 4:11 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

I don't get what you meant by "DUDE, CHECK THIS SNIPPET FROM THE INFO CENTER : "

I am doing this in one of my message flows (this is production code, omitting non-relevant parts):

Code:


DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';

SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)xmlns:xsi = xsi;

CREATE FIELD OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.jp4:processSalesOrder.header;
DECLARE SOHeaderRef REFERENCE TO OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.jp4:processSalesOrder.header;

SET SOHeaderRef.salesOrderKey.documentTypeCode.(XMLNSC.Attribute)xsi:nil='true';



Your problem seems to be related to insufficient knowledge of XML.
(No offense, but better understanding of namespaces would probably had helped you.)
Back to top
View user's profile Send private message Visit poster's website
my_mqmb
PostPosted: Tue Apr 24, 2012 5:04 am    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

mapa wrote:

Your problem seems to be related to insufficient knowledge of XML.
(No offense, but better understanding of namespaces would probably had helped you.)



no offense too , but although your code is right, you dint understand my requirement .. i need these declarations to be repeated in some part of the xml as it is .

Not your own way , as to declare only once at the higher level.

please understand the requirement .
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 24, 2012 5:14 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Can you explain why the receiving application needs the same namespace declaration on every tag?


Quote:
although your code is right, you dint understand my requirement .. i need these declarations to be repeated in some part of the xml as it is .
Fair enough. You are claiming that the receiving application *requires* you to output the xsi namespace declaration on every tag.
You can't really blame us for not understanding your requirement, though. I asked this very specific question
Quote:
Can you explain why the receiving application needs the same namespace declaration on every tag?
...and you have not answered it yet. So it was possible that the receiving app needed the 16 tags but not the 16 namespace declarations. But you're saying that it needs all 16 namespace decls, right?
Back to top
View user's profile Send private message
mapa
PostPosted: Tue Apr 24, 2012 5:28 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

my_mqmb wrote:


no offense too , but although your code is right, you dint understand my requirement .. i need these declarations to be repeated in some part of the xml as it is .

Not your own way , as to declare only once at the higher level.


I did understand both options and you have the answers for both ways. On each element or on a higher level element.

But you also seem to not know what a default namespace is...or?
Back to top
View user's profile Send private message Visit poster's website
optimist
PostPosted: Tue Apr 24, 2012 10:47 am    Post subject: To my_mqmb Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 33

Are you sure you want this:

Code:
 
<root xmlns:ns1="namespace1">
<example>ABCDE</example>
</root>


and not this:

Code:

<ns1:root xmlns:ns1="namespace1">
<example>ABCDE</example>
</ns1:root>


??
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Tue Apr 24, 2012 11:50 pm    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

[quote="kimbert"]
Quote:
But you're saying that it needs all 16 namespace decls, right?



Yes kimbert u are spot on ..
I am sorry if i could not be exact..


mapa wrote:

But you also seem to not know what a default namespace is...or?


I think you are keen to help , but you cant keep yourself away from repeating "you dont know" which i think is not a way to share knowledge.
Back to top
View user's profile Send private message
mapa
PostPosted: Wed Apr 25, 2012 12:21 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

It is just meant as a tip to something you should look into, since that was sipping out from your question with the example XML you provided.

Maybe I should rephrase it better, since it maybe sounds not so nice, I normally don't say so, but the capital "DUDE, ETC." might have put me off a little, since using capital letters like that is considered somewhat aggressive, at least by me...

We all start somewhere and move from there.

Did you get it to work using the input you have received here?

Btw, you know that there is a XMLNSC Namespaces example provided with the Toolkit?
Back to top
View user's profile Send private message Visit poster's website
joebuckeye
PostPosted: Wed Apr 25, 2012 5:13 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

[quote="my_mqmb"]
kimbert wrote:
Quote:
But you're saying that it needs all 16 namespace decls, right?



Yes kimbert u are spot on ..
I am sorry if i could not be exact..


So the receiving application is not XML savy at all if they require this. They probably have their own 'XML parser' instead of using a real XML compliant one.

You do realize that a real XML parser doesn't care how the namespaces are declared, right? Mapa's suggestion of having the namespace declaration at a higher level is perfectly equal (and much more efficient) than having the namespace declaration on each element from a real XML parser perspective.

my_mqmb wrote:

mapa wrote:

But you also seem to not know what a default namespace is...or?


I think you are keen to help , but you cant keep yourself away from repeating "you dont know" which i think is not a way to share knowledge.


Well the questions you are asking are quite bizarre and seem to indicate a lack of XML and/or namespace knowledge on either your part or the part of the application you are sending this 'so-called' XML to.
Back to top
View user's profile Send private message
optimist
PostPosted: Wed Apr 25, 2012 6:08 am    Post subject: Is this what you need? Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 33

I was able to set up a flow to produce the following XML. Is this what you need?

<createCardRequest xmlns:ns1="namespace1">
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</createCardRequest>


Thanks.
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Mon Apr 30, 2012 4:32 am    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

[quote="joebuckeye"]
my_mqmb wrote:
kimbert wrote:
Quote:
But you're saying that it needs all 16 namespace decls, right?



Yes kimbert u are spot on ..
I am sorry if i could not be exact..


So the receiving application is not XML savy at all if they require this. They probably have their own 'XML parser' instead of using a real XML compliant one.

You do realize that a real XML parser doesn't care how the namespaces are declared, right? Mapa's suggestion of having the namespace declaration at a higher level is perfectly equal (and much more efficient) than having the namespace declaration on each element from a real XML parser perspective.

my_mqmb wrote:

mapa wrote:

But you also seem to not know what a default namespace is...or?


I think you are keen to help , but you cant keep yourself away from repeating "you dont know" which i think is not a way to share knowledge.


Well the questions you are asking are quite bizarre and seem to indicate a lack of XML and/or namespace knowledge on either your part or the part of the application you are sending this 'so-called' XML to.



Fix yourself to the question , dont assume things..
now ur guessing right , that yr 'assumption' of the XML compliant parser was wrong ...

Kimbert got my point , where i told i just know that the recieving application fails to parse , if there is even a 'dot' extra..
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Mon Apr 30, 2012 4:35 am    Post subject: Re: Is this what you need? Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

optimist wrote:
I was able to set up a flow to produce the following XML. Is this what you need?

<createCardRequest xmlns:ns1="namespace1">
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<cardGraphicalData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</createCardRequest>


Thanks.



yes , without

xmlns:ns1="namespace1"


Code:
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 30, 2012 4:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

my_mqmb
Please show us the code you have right now, and show us what it produces.

To produce the code that optimist showed is relatively straight forward. To change that code to not put the "createCardRequest" into a namespace is relatively straight forward.

If you've got code that produces *something*, it's much easier to change that code to produce the right thing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CREATING XML
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.