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 » Add element on existing tree

Post new topic  Reply to topic
 Add element on existing tree « View previous topic :: View next topic » 
Author Message
Gaara84
PostPosted: Sat May 14, 2011 11:25 am    Post subject: Add element on existing tree Reply with quote

Newbie

Joined: 14 May 2011
Posts: 2

Hi all!

I am new to WMB and I encountered a problem I can't solve.

My message flow receives an XML with schemas defined on it, but when I want to add some elements in the xml, nothing happens. When I do it with an XML without schema it works.

I get this

Code:

<tns:Root xmlns:tns="http :// www . sample. com. test. sample" xmlns:tns1="http :// www . sample. com. test" xmlns:xsi="http:// www . w3 .org/2001/ XMLSchema-instance" xsi:schemaLocation="http : // www. sample. com .test .sample.xsd ">
    <tns:Message>
   <tns:Context>
       <tns1:SentDate>date</tns1:SentDate>
        </tns:Context>
        <tns:Attachment>
       <tns1:Size>size</tns1:Size>
        </tns:Attachment>
    </tns:Message>
</tns:Root>


and I want to add element Success, to make it like this

Code:

<tns:Root xmlns:tns="http :// www . sample. com. test. sample" xmlns:tns1="http :// www . sample. com. test" xmlns:xsi="http:// www . w3 .org/2001/ XMLSchema-instance" xsi:schemaLocation="http : // www. sample. com .test .sample.xsd ">
    <tns:Message>
   <tns:Context>
       <tns1:SentDate>date</tns1:SentDate>
        </tns:Context>
        <tns:Attachment>
       <tns1:Size>size</tns1:Size>
        </tns:Attachment>
   <tns:Status>
       <tns1:Success>true</tns1:Success>
        </tns:Status>     
    </tns:Message>
</tns:Root>


I tried this but it only works with non schemas defined.

Code:

outMessage.evaluateXPath("?Root/?Message/?Status/?Success[set-value('true')]");


What am I supposed to do?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat May 14, 2011 11:46 pm    Post subject: Reply with quote

Grand High Poobah

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

What have you all tried? What was the result?
Have you tried specifying the namespace at each node level?
Your XPath does not seem to allow for any namespace but your message requires it.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Sun May 15, 2011 1:12 am    Post subject: Reply with quote

Jedi Council

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

And does the XSD allow for this extra field?

There are a raft of different possible reasons as to why your operation failed. We really would like to know the steps you have gone through to isolate/debug the problem.
This will stop people suggesting the things you have already tried.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Add element on existing tree
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.