Need Help with xapp:child()

X-Application Version: 3.1.3
Tamino Version : 3.1.1.4
Platform : Win2k
WebContainer : Tomcat 3.3
JDK Version : 1.4.0

Hi everyone, I am a new member from China. I urgently need some help with things like xapp:child(x) and xapp:seq(), which I don’t understand.

Please refer to the figure where the schema definition for element “Organization” is shown. The element defines a sequence, which further contains another sequence. And in that second sequence there is an element ref called “Classification”.

Below is the JSP loop tag which goes down to the node “Classification”.
<xapp:loop select="/RegistryObjectList/Organization/xapp:child(1)/xapp:child(1)/xapp:child(1)" iterate=“Classification” targetbase="/RegistryObjectList/Organization/Classification">

</xapp:loop>

It seems that I cannot use <xapp:loop select="/RegistryObjectList/Organization/" iterate=“Classification” …> to refer to node “Classification”.

Can you help to explain the reason? And also, I don’t know what the things like xapp:child(x) or xapp:seq() are about. Are they part of the X-node statements?

Appreciate your help very much!!

Hello,

for details about xapp:child / seq / occ / chc you will find a chapter 'Schema based Operations' within your X-Application documentation.

For your problem: If you use an 'iterate' attribute within your xapp:loop tag, X-Application looks into the schema and looks for a schema path to the element(s) you want to iterate. The algorithm will no valid schema path if more than one occurrence occurs between the starting point (Organization) and the end point (Classification). There are two occurrences because of the optional sequence with is internally handled as an occurrence.

To define a schema path: You can use xapp:child() where index defines the position of the element / sequence / choice within an element declaration of your schema.

The structure path from Organization to Classification is

xapp:child(1)/xapp:child(1)/xapp:child(1)/xapp:child(4)

  1. addresses the first sequence
  2. addresses the first child of the first sequence (occurrence for the optional sequence)
  3. addresses the nested sequence
  4. addresses the occurrence of the classification node.

Alterenatively you could use 'seq' / 'occ' / 'chc' instead of 'child':

xapp:seq(1)/xapp:occ(1)/xapp:seq(1)/xapp:occ(2)

Both of the paths address the occurrence node on top of the Classification node.

I hope, that small explanation helps you to understand the problem.

We are aware that the schema based paths are too complicate. Therefore, for the next version of X-Application we will offer a better support of XPath. This should simplify the access to child elements.


Bye, Christian.

[This message was edited by Christian Freytag on 14 Jan 2003 at 08:22.]

Hi Christian,
Thanks very much. I have more or less become aware of the syntax and usage of the schema-based operations, and totally agree with the way you address node “Classification” from node “Organization”, both through xapp:child(n) and through xapp:seq()/xapp:occ().

Here I am working on some other schema. (I attach it here.) But even the x-application generated JSP pages don’t work for it, here I’m referring to “create.jsp”.

Can you pls look into the schema and JSP and give me any help? Thank you for your time, Christian!
User.TSD (11.7 KB)