Exception when using loop

X-Application Version: 3.1.2
Tamino Version : 3.1.1
Platform : Solaris, …
WebContainer : Tomcat 4.0.2
JDK Version : 1.4

I got the exception of
ApplicationException: 999: Application Error! Please contact the X-Application-Team.
com.softwareag.xtools.xapplication.businessdocument.InvalidSchemaException
schema is non-deterministic

when using Loop

<%@ page language=“java” contentType=“text/html; charset=UTF-8” %>
<%@ taglib uri=“404” prefix=“bdm” %>



Loop Test



<bdm:module id=“bdProp”>
<bdm:form module=“bdProp”>
<bdm:directcommand type=“query” schema=“dc” queryparm=“.~=‘*’” />
</bdm:form>



<bdm:browse module=“bdProp”>

<bdm:loop module=“bdProp” select=“/dc” iterate=“Title” targetbase=“Titles”>



</bdm:loop>

</bdm:browse>

<bdm:display select=“.” />

</bdm:module>




My tsd and sample data enclosed.

Can anyone help?
dc.tsd (10.8 KB)

<?xml version="1.0" encoding="UTF-8"?>


Title1
Title2

Hi,

the problem with your schema definition is, that the parser cannot decided for a document like yours:



whether

<Title></pre> or <pre class="ip-ubbcode-code-pre"><dc></pre> is the occurring element.<BR>In this sense it's not deterministic and thus rejected. For a more detailed discussion of this topic please refer to <A HREF="http://tamino.forums.softwareag.com/viewtopic.php?p=12586" TARGET=_blank>non deterministic Schema topic</A><BR><BR>I adapted your schema by introducing a new enclosing element called <pre class="ip-ubbcode-code-pre">dcs</pre>, which contains a occurrence of <pre class="ip-ubbcode-code-pre">dc

elements. I generated an application using the X-Application Generator and it worked.

I hope that helps you.

Please find attached the modified schema.

Thank you for your contribution.

Stefan Schwalm
Software AG, Darmstadt
dc2.tsd (11 KB)

It works and display
Title1
Title2

How about data as



Title1
Title2


Title3
Title4




It does show Title3 and Title4?
Any suggestion?

I know the answer. We shall iterate dc.
Thanks.

Dear Schwalm,

I really don’t understand why my scheme non-deterministic.
You just add a node to my scheme and make it deterministic. Why?
Can I find more information from SoftwareAG?

Thanks.

Hi again,

ok here some more hints on the subject.
The part in the schema defintion, which says something about deterministic schemas is:


(for more details please see:
XML Schema Defintion)

As I wrote before it cannot be decided for a document like


T1
T2
C1


at the time T1 is read, whether T1 belongs to a occurrence or a occurrence.

Since one has always the freedom to define an enclosing element and giving it a name, this restriction shouldn’t cause too much trouble when designing a schema.

I hope I could help you.

Cheers

Stefan Schwalm
Software AG, Darmstadt

But I still don’t know why


T1
T2
C1


T21
T22
C21



is ok?

Hello,

what Stefan tried to explain is that for







The validating parser can not decide whether the document has the structure

a) dc - begin sequence - title title title - end sequence

or

b) dc - begin sequence - title - end sequence - begin sequence - title title - end sequence

or

c) dc - begin sequence - title title - end sequence - begin sequence - title - end sequence

or



With the modification Stefan proposed, you specify with the element dc which variant you want. For example







Bye,
Christian.