Author |
Message
|
yellowbee |
Posted: Fri Apr 27, 2012 12:19 am Post subject: Java code in Java compute code |
|
|
 Acolyte
Joined: 14 Apr 2012 Posts: 58
|
Code: |
MbMessage message = assembly.getMessage();
MbElement element1=message.getRootElement().getFirstElementByPath("/XML/EMP");
Object object1=element1.getFirstChild().getValue();
String string1=object1.toString();
String string2=string1.substring(5,10);
MbMessage message1=new MbMessage(message);
MbElement element2=message1.getRootElement().getFirstElementByPath("/XML/EMP");
element2.setName("STUDENT");
element2.createElementAsFirstChild(0x1000000,"SNAME",string2);
//MbElement title2 = chapter2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, “title”, “Message Flows”);
element2.getLastChild().detach();
MbMessageAssembly assembly1=new MbMessageAssembly(assembly,message1);
out.propagate(assembly1);
|
------
what 0x1000000 indicates or describes in the line element2.createElementAsFirstChild(0x1000000,"SNAME",string2);
Thanks |
|
Back to top |
|
 |
Esa |
Posted: Fri Apr 27, 2012 12:29 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
It is not you own code, he?
If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created.
By the way, you should use parser specific constants instead of numeric values, e.g. XMLNSC.Folder.
And by another way and before anyone else makes the remark (they usually do), you should not use the deprecated 'XML' domain. |
|
Back to top |
|
 |
yellowbee |
Posted: Fri Apr 27, 2012 2:47 pm Post subject: |
|
|
 Acolyte
Joined: 14 Apr 2012 Posts: 58
|
masters let me know what is the meaning of 0x1000000 in wmb java compute node................ |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Apr 27, 2012 10:50 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@yellowbee
Esa wrote: |
If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created. |
Which part of this did you not understand. Did you not follow the link?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun Apr 29, 2012 3:44 pm Post subject: Re: Java code in Java compute code |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
yellowbee wrote: |
Code: |
//MbElement title2 = chapter2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, “title”, “Message Flows”); |
|
Even though this line is commented out, the non-ascii quotes don't really belong there.
Esa wrote: |
By the way, you should use parser specific constants ... |
... or the generic type constants.
Esa wrote: |
If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created. |
But the v61 javadoc doesn't document the actual values for the type constants. Those are documented elsewhere. The v8 javadoc is a bit more complete, but the parser-specific values are subject to change from version to version ... that's another reason not to hardcode them.
yellowbee wrote: |
masters let me know what is the meaning of 0x1000000 in wmb java compute node |
For the given code, it could mean either MbElement.TYPE_NAME, or MbXML.Element. |
|
Back to top |
|
 |
yellowbee |
Posted: Sun Apr 29, 2012 11:59 pm Post subject: |
|
|
 Acolyte
Joined: 14 Apr 2012 Posts: 58
|
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Apr 30, 2012 2:36 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
yellowbee wrote: |
Thank you shaman |
You have gotten confused again.
you are a Novice (your rank) and your username is 'yellowbee'.
I'm a Jedi and my username is SMDavies99
As the number of posts you make rises, you reach different ranks. The gap between the ranks increases as you rise up the ladder. _________________ 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 |
|
 |
yellowbee |
Posted: Wed May 30, 2012 4:01 am Post subject: |
|
|
 Acolyte
Joined: 14 Apr 2012 Posts: 58
|
|
Back to top |
|
 |
zpat |
Posted: Wed May 30, 2012 5:07 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
|
Back to top |
|
 |
|