24. WMBv6.x - Java Compute Node Accessing the tree using object API (0x01000000):XMLNSC = ( (0x01000000):document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
25. WMBv6.x - Java Compute Node Accessing the tree using object API assembly.getMessage();
26. WMBv6.x - Java Compute Node Accessing the tree using object API MbElement xmlnsc = assembly.getMessage().getRootElement().getLastChild();
27. WMBv6.x - Java Compute Node Accessing the tree using object API MbElement xmlnsc = assembly.getMessage().getRootElement().getLastChild(); MbElement chapter = xmlnsc.getFirstChild().getFirstChild();
28. WMBv6.x - Java Compute Node Accessing the tree using object API public class SampleFlow_JavaCompute extends MbJavaComputeNode { public void evaluate(MbMessageAssembly assembly) throws MbException { MbElement xmlnsc = assembly.getMessage().getRootElement().getLastChild(); MbElement chapter = xmlnsc.getFirstChild().getFirstChild(); } }
32. WMBv6.x - Java Compute Node Accessing the tree with XPath / <document> <chapter title=”Chapter One”> This is chapter one </chapter> </document> (0x01000000): XMLNSC = ( (0x01000000):document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
33. WMBv6.x - Java Compute Node Accessing the tree with XPath /document < document > <chapter title=”Chapter One”> This is chapter one </chapter> </ document > (0x01000000):XMLNSC = ( (0x01000000): document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
34. WMBv6.x - Java Compute Node Accessing the tree with XPath /document/chapter <document> < chapter title=”Chapter One”> This is chapter one </ chapter > </document> (0x01000000):XMLNSC = ( (0x01000000):document = ( (0x03000000): chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
35. WMBv6.x - Java Compute Node Accessing the tree with XPath /document/chapter/@title <document> <chapter title=”Chapter One” > This is chapter one </chapter> </document> (0x01000000):XMLNSC = ( (0x01000000):document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100): title = 'Chapter One' ) ) )
36. WMBv6.x - Java Compute Node Accessing the tree with XPath /document/chapter[@title=’Chapter One’] <document> < chapter title=”Chapter One”> This is chapter one </ chapter > </document> (0x01000000):XMLNSC = ( (0x01000000):document = ( (0x03000000): chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
37. WMBv6.x - Java Compute Node Accessing the tree with XPath /document/chapter[@title=’Chapter One’]/.. < document > <chapter title=”Chapter One”> This is chapter one </chapter> </ document > (0x01000000):XMLNSC = ( (0x01000000): document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100):title = 'Chapter One' ) ) )
38. WMBv6.x - Java Compute Node Accessing the tree with XPath string(/document/chapter/@title) <document> <chapter title=” Chapter One ”> This is chapter one </chapter> </document> (0x01000000):XMLNSC = ( (0x01000000):document = ( (0x03000000):chapter = 'This is chapter one' ( (0x03000100):title = ' Chapter One ' ) ) )
39.
40. WMBv6.x - Java Compute Node Modifying the tree with XPath Funktioner: set-value() set-local-name() set-namespace-uri()
41. WMBv6.x - Java Compute Node Modifying the tree with XPath Broker specific XPath additions: ?myElement Selects myElement, created if not present ?$myElement Creates myElement as last child and selects it ?^myElement Creates myElement as first child and selects it ?>myElement Creates myElement as next sibling and selects it ?<myElement Creates myElement as previous sibling and selects it @ Used to select attributes, e.g; ?@myAttribute[set-value(’Attribute value’)]
42. WMBv6.x - Java Compute Node Modifying the tree with XPath <document> <chapter title=”Chapter One”> This is chapter one </chapter> </document>
43. WMBv6.x - Java Compute Node Modifying the tree with XPath <document> <chapter title=”Chapter One”> This is chapter one </chapter> </document> /document/?$chapter [set-value('This is chapter two')] [?@title[set-value('Chapter Two')]]
44. WMBv6.x - Java Compute Node Modifying the tree with XPath <document> <chapter title=”Chapter One”> This is chapter one </chapter> </document> /document/?$chapter [set-value('This is chapter two')] [?@title[set-value('Chapter Two')]] <document> <chapter title=”Chapter One”> This is chapter one </chapter> <chapter title=”Chapter Two”> This is chapter two </chapter> </document>