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 (Simple) question

Post new topic  Reply to topic
 XML Attribute (Simple) question « View previous topic :: View next topic » 
Author Message
AgentSmith
PostPosted: Sat Dec 27, 2003 2:44 am    Post subject: XML Attribute (Simple) question Reply with quote

Novice

Joined: 19 Nov 2003
Posts: 19

Hi All,
I have a simple doubt i need to clarify ASAP.
I have an input XML like this:
<MAIN>

<DATA>
<Child1 Name="A" Age="28" Loc="US"/>
<Child2 Type="VV" Fen="DD"/>
<Child3 Next="X" GG="d" Loc="US"/>
</DATA>

<OUT>
<Child1 Name="A" Age="28" Loc="US">
<old>yes</old>
</Child1>
<Child2 Type="VV" Fen="DD"/>
<new>yes</new>
</Child2>
<Child3 Nm="A" g="28" />
<Child4 Name="B" Age="28" Loc="US"/>
</OUT>

</DATA>


I don't know the names of the child tags of DATA and OUT. So ,I am accessing them via anonymous references and I am comparing the child tags of DATA and OUT tags.
I should process them if the attributes(and their values) of the same named child tags in DATA and OUT are equal.
I neither know the names of the attributes nor HOW MANY attributes every child tag will contain, since XML is generated dynamically.


-> How can i compare attributes of two tags using anonymous field references without knowing their names?

-> How can i determine whether the anonymous reference is an XML Attribute or XML Element?


Anybody, Please reply to this query.

Thx,
AgentSmith.
Back to top
View user's profile Send private message
EddieA
PostPosted: Sat Dec 27, 2003 4:45 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

You can use FIELDNAME to get the Tag/Attribute name.

The following is how I check for a Tag. You'll have to get the value for an Attribute from a Trace node:

IF FIELDTYPE(InputBody.*[ThisTag]) = 0x1000000 THEN

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
AgentSmith
PostPosted: Sat Jan 03, 2004 10:45 pm    Post subject: Reply with quote

Novice

Joined: 19 Nov 2003
Posts: 19

Hey,
That worked.

Thx,
AgentSmith
Back to top
View user's profile Send private message
kirani
PostPosted: Sun Jan 04, 2004 11:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

From WBIMB manual,
Quote:

Note that the mapping of integer values to field types is not published, and might change from release to release. You should therefore use the results of the FIELDTYPE function by comparing with named field types. For example:
Code:

IF FIELDTYPE(source_field_reference) = NameValue
THEN ...


_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
EddieA
PostPosted: Sun Jan 04, 2004 1:25 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Agreed that it would be better. But, to do that, IBM need to publish what those field types are. I can't find them, not in any 2.1 manual.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
kirani
PostPosted: Sun Jan 04, 2004 1:38 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I remember seeing some table in one of the WMQI Manual specifying these values. I don't remember the manual name right now, I will try to find the table and post it here.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Sun Jan 04, 2004 4:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Please take a look at WMQI - Programming Guide Appendix E - XML and MRM parser constants. You can use constants specified in this section in your FIELDTYPE function. For example,
Code:

IF FIELDTYPE(InputBody.*[ThisTag]) = XML.tag THEN


Hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
AgentSmith
PostPosted: Wed Jan 14, 2004 2:16 am    Post subject: Reply with quote

Novice

Joined: 19 Nov 2003
Posts: 19

Yep. I got it.
Thx,
Smith.
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 (Simple) question
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.