Author |
Message
|
mapa |
Posted: Tue Apr 24, 2012 4:11 am Post subject: |
|
|
 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 |
|
 |
my_mqmb |
Posted: Tue Apr 24, 2012 5:04 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Tue Apr 24, 2012 5:14 am Post subject: |
|
|
 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 |
|
 |
mapa |
Posted: Tue Apr 24, 2012 5:28 am Post subject: |
|
|
 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 |
|
 |
optimist |
Posted: Tue Apr 24, 2012 10:47 am Post subject: To my_mqmb |
|
|
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 |
|
 |
my_mqmb |
Posted: Tue Apr 24, 2012 11:50 pm Post subject: |
|
|
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 |
|
 |
mapa |
Posted: Wed Apr 25, 2012 12:21 am Post subject: |
|
|
 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 |
|
 |
joebuckeye |
Posted: Wed Apr 25, 2012 5:13 am Post subject: |
|
|
 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 |
|
 |
optimist |
Posted: Wed Apr 25, 2012 6:08 am Post subject: Is this what you need? |
|
|
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 |
|
 |
my_mqmb |
Posted: Mon Apr 30, 2012 4:32 am Post subject: |
|
|
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 |
|
 |
my_mqmb |
Posted: Mon Apr 30, 2012 4:35 am Post subject: Re: Is this what you need? |
|
|
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"
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 30, 2012 4:38 am Post subject: |
|
|
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 |
|
 |
|