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 » xml.attribute

Post new topic  Reply to topic
 xml.attribute « View previous topic :: View next topic » 
Author Message
malammik
PostPosted: Mon Jul 11, 2005 12:49 pm    Post subject: xml.attribute Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

I have xml which looks like this
<myxml>
<a xsi:type = foo>
<a xsi:type = bar>
and so on
</myxml>

Say I need the a with xsi type bar. Is there a way to get to <a> with xsi type bar right away w/o having to loop and check?

I know this grammar is not supported but something like this.

DECLARE X REFERENCE TO A.(XML.Attribute)xsi:type='bar'


Thanks.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
JT
PostPosted: Mon Jul 11, 2005 1:59 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
Is there a way to get to <a> with xsi type bar right away w/o having to loop and check?

I don't believe so, at least we haven't been able to do so without looping through the array and then setting the REFERENCE pointer to the required occurrence. Obviously, with a single line of code you can extract the values on the <a> occurrence that you seek, but that doesn't tell you the position in the array.
Back to top
View user's profile Send private message
malammik
PostPosted: Mon Jul 11, 2005 4:43 pm    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

Thanks.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
chibban
PostPosted: Tue Jul 12, 2005 1:41 pm    Post subject: Reply with quote

Novice

Joined: 01 Jun 2005
Posts: 14

Hello,
I have a related question :
I need to generate XML with attributes, lets say :
Code:
<EXAMP>
   <FIRST type="NUMBER">
   <SECOND type="CHAR">
</EXAMP>


I tried using the CREATE FIELD command with NameValue type as mentioned in the reference : http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp
like this :
Code:
CREATE FIELD OutputRoot.XML.TestCase.description TYPE NameValue VALUE 'This is my TestCase' ;
Which suppose to create this :
Code:
<TestCase description="This is my TestCase">
But it creates the description as a son tag of the TestCase, and somtimes (I think only when I use the 'type' word as an attribute) it omits it, I mean the output does not contain the attribute 'type'.

How can I create XML with attributes then ?
_________________
Thanks,
Sivan
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 12, 2005 2:05 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

chibban wrote:
I have a related question

No, you don't.
chibban wrote:
How can I create XML with attributes then ?

By reading the documentation that specifically tells you how to address different types of XML fields in ESQL.

Or by doing a search here for "XML Attribute", and finding any of the probably hundreds of other times that this question has been asked.

Welcome to the Internet.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chibban
PostPosted: Wed Jul 13, 2005 1:24 pm    Post subject: Reply with quote

Novice

Joined: 01 Jun 2005
Posts: 14

I did search for XML Attribute, and I even tried both ways of creating the xml attribute, Still it doesn't work... I get an invalid XML structure...
I have no idea what I'm doing wrong.
[I tried the NameValue option and the (XML.Attribute) option...]

Any idea ?
_________________
Thanks,
Sivan
Back to top
View user's profile Send private message
JT
PostPosted: Wed Jul 13, 2005 3:31 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Code:
SET OutputRoot.XML.EXAMP.FIRST.(XML.Attribute)type   =  'NUMBER';
SET OutputRoot.XML.EXAMP.SECOND.(XML.Attribute)type  =  'CHAR';

If you still receive an 'invalid XML structure' error after implementing the code above, post all of your ESQL code.
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 » xml.attribute
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.