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 » Create XML attributes in ESQL

Post new topic  Reply to topic
 Create XML attributes in ESQL « View previous topic :: View next topic » 
Author Message
monangi1
PostPosted: Wed Jun 24, 2015 4:46 am    Post subject: Create XML attributes in ESQL Reply with quote

Novice

Joined: 02 Feb 2014
Posts: 11

Hi All,
Need help!
I have create the XML attribute in ESQL in below format

<Emp z:Id="i2">

on this, I am able to create Emp element with attribute like Id = "i2", but facing trouble while creating the attribute as "z:Id".
my code as below:
Code:

Outputroot.SOAP.Body.ns32:CreateParty.Addresses.(XMLNSC.Attribute)Id='i2'


Thanks in Advance
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 24, 2015 5:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So, what does the "z:" indicate, as part of an XML document?

What does the "ns32" in your OutputRoot represent?
Back to top
View user's profile Send private message
monangi1
PostPosted: Wed Jun 24, 2015 5:26 am    Post subject: Reply with quote

Novice

Joined: 02 Feb 2014
Posts: 11

Thans for quick reply.

ns32 is my local namespace and to call the end systen webservice I have to construct the element with attribute value like <Emp z:Id="i2">. Beow is the request message.

Code:
<Emp z:Id="i2" i:type="Referrer">
     <ID>395206</ID>
     <EmpName>XYZ</EmpName>
        <EmpPartyID>229102</EmpPartyID>
  </Emp>
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 24, 2015 5:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Yes, so ns32 is a namespace reference.

What's z, then? An eggplant? (aubergine for those of you from furrin parts)

What was done to assign the value to ns32? What does the logical message tree look like when you put a trace node after your compute node?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 24, 2015 5:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

@monangi1

Not to keep driving the same nail into the coffin, but you did not answer the question:

What do z: and i: represent in the XML snippet you described? Where have they been defined?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
monangi1
PostPosted: Wed Jun 24, 2015 5:48 am    Post subject: Reply with quote

Novice

Joined: 02 Feb 2014
Posts: 11

Hi fjb_saper & mqjeff,

Z and I are not a namespaces declared in XML, But I have to construct the attribute with z:Id format in out put ESQL.

Example :

<Emp z:Id="i2" i:type="Referrer">
z:Id and i:type are the XML attribure here coming in the input XML.

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 24, 2015 6:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can't have "z:" like that and have it *not* be a namespace.

That's not how XML works.

But if you really felt like doing that, you can simply set the name to "z:id".

And then watch things break further down the line.
Back to top
View user's profile Send private message
monangi1
PostPosted: Thu Jun 25, 2015 10:32 pm    Post subject: Reply with quote

Novice

Joined: 02 Feb 2014
Posts: 11

Thanks for giving the reply guys.

I got the solution by using the FIELDVALUE.

ex Outputroot.SOAP.BOdy.Emp.(SOAP.Attribute)"z:Id" Value =FIELDVALUE(Inputroot.SOAP.Body.XyzEmp.(SOAP.Attribute)z:Id)

Then I can see the below output
<Emp z:Id = "i2">.

Regards
Monangi
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jun 25, 2015 10:53 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you taken the output XML and validated it using one of the many freely available XML Validators on the internet?

If so what was the result?

The reason I ask this is that while your output XML Might meet your requirement it might be invalid XML.

I tried validating your XML at
http://www.w3schools.com/xml/xml_validator.asp

This is the result.

XML Parsing Error: prefix not bound to a namespace
Location: http://www.w3schools.com/xml/xml_validator.asp
Line Number 7, Column 1:
<Emp z:Id = "i2">

As has been said at least once in this thread 'z:' implies that it is a namespace according to the XML specification.

Outputting this XML may work but may I humbly suggest that you go back to whoever told you to do this and get clarification that outputting this invalid XML won't break something else later on in the processing.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Rambabu
PostPosted: Tue Jun 30, 2015 1:00 am    Post subject: Reply with quote

Newbie

Joined: 29 Jun 2015
Posts: 5

Hey smdavies99, But i'm able to validate below XML sucessfully..

Code:
<?xml version="1.0" encoding="UTF-8"?>
<note k:Id="2">
  <Emp z:Id = "i2">
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
  </Emp>
</note>
Back to top
View user's profile Send private message
Rambabu
PostPosted: Tue Jun 30, 2015 1:09 am    Post subject: Reply with quote

Newbie

Joined: 29 Jun 2015
Posts: 5

Apologies, It's W3schools validator mistake .... i tried in other XML validator, it's throwing error as you said.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jul 03, 2015 1:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I assume that you have searched for 'namespace declaration' in the IIB v9 info center?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
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 » Create XML attributes in ESQL
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.