Author |
Message
|
Oops |
Posted: Tue Jan 20, 2004 8:24 am Post subject: Type name in path |
|
|
Newbie
Joined: 20 Jan 2004 Posts: 9
|
Can I include the type name in the path to an element?
A type in my message set contains few elements and this type is repeating.Could I access the elements including the type name also in the path so that I could access the different instances of the elements for various instances of the type.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 20, 2004 9:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Can you give a more specific example of what you're trying to do? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Oops |
Posted: Tue Jan 20, 2004 8:33 pm Post subject: |
|
|
Newbie
Joined: 20 Jan 2004 Posts: 9
|
Hi,
Ok let me put it in an example, suppose I have a type t_Type in my message set and t_Type e_Element is one of the elements contained within in .
t_Type is by itself REPEATING and I need to access the instances of the element e_Element as t_Type repeats.
To identify the instances of the element could I include the name of the type t_Type in the path calling the element? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 21, 2004 5:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, if you've included the Type itself, rather than an element of the type, then your path to e_Element would be Body.A_Root.e_Element (if A_Root was the root element of your tree, which contained a repeating t_Type structure).
It should be that the second occurance of e_Element within t_Type is available as Body.A_Root.e_Element[2]. At least, that's what I believe.
I've only ever done repeating types when I've included them as Elements, not as types (So, Body.A_Root.e_Type[2].e_Element). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Oops |
Posted: Wed Jan 21, 2004 8:26 pm Post subject: |
|
|
Newbie
Joined: 20 Jan 2004 Posts: 9
|
Yeah as you said typically only the element names appear in the path and not the type names. But is there is method where I could include the type name to appear in the path.
I have seen the following statements in a doccument but could not get it working.
"Path elements can also contain a type and an index. These are contained within
round and square brackets respectively. For example, the path:
InputRoot.XML.Data.(XML.Element)Invoice [ 3 ] .(XML.Attribute)Period
identifies an XML attribute called Period within the third XML tag called Invoice
(indexes start at 1) within the first field (of any type) called Data within the first
field (again of any type) called XML." |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 22, 2004 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Path elements can also contain a type and an index. These are contained within round and square brackets respectively. For example, the path:
InputRoot.XML.Data.(XML.Element)Invoice [ 3 ] .(XML.Attribute)Period |
The 'Type' is not the message set 'type'. It is the node type (XML.Element) or (XML.Attribute). Unfortunately, there is no way to include the modelled type in an ESQL path.
However, it looks as if you have the following structure:
Code: |
parentElement
- t_Type (Repeating)
- e_Element |
So you should be able to get at the nth occurrence of e_Element simply as
InputBody.ParentElement.e_Element[n] ( just as Jeff said).,
One question, though...is e_Element is the only member of t_Type? if so, you probably do not need t_Type. |
|
Back to top |
|
 |
|