[EMAIL PROTECTED] wrote:
This is a known issue, which I'll add to the status page. The problem is with forward references to objects from collections. If your XML defines the IDs before the references to them from inside the collections there won't be a problem; this obviously doesn't help if you're stuck with XML documents that use forward references.

We used three different forward references to objects from collections in our binding. Two of them work just fine. This one fails.


The difference is that the collection which fails contains the id-ref directly.

The two collections which work contain a mapping to some type which then contains the id-ref (as a <value>). This works. In the document, the id-defs occurr after their id-refs.

To show forward references which work, I attached our binding.

Falk
<?xml version="1.0" encoding="UTF-8"?>
<binding name="xfb" global-ids="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="binding.xsd">
   <!-- ============================================================== -->
   <mapping name="xform" class="com.livis.xforms.desc.XForm">
      <value name="name" field="name" usage="optional" style="attribute"/>
      <structure name="description" usage="optional"/>
      <value name="version" field="version"/>
      <value name="cursor" field="cursor" usage="optional"/>
      <collection name="forms" field="forms" usage="optional"/>
      <collection name="types" field="types" usage="optional"/>
      <collection name="styles" field="styles" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="form" class="com.livis.xforms.desc.Form" post-set="_link">
      <value name="name" field="name" ident="def" style="attribute"/>
      <value name="kind" field="kind" usage="optional" style="attribute"/>
      <structure name="description" usage="optional"/>
      <collection name="fields" field="fields" usage="optional"/>
      <collection name="constraints" field="constraints" usage="optional"/>
      <value name="type-ref" field="type" usage="optional" ident="ref"/>
      <collection field="constraintrefs">
         <value name="constraint-ref"/>
      </collection>
      <structure field="layout" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="type" class="com.livis.xforms.desc.Type">
      <value name="name" field="name" ident="def" style="attribute"/>
      <value name="kind" field="kind" usage="optional" style="attribute"/>
      <structure name="description" usage="optional"/>
      <value name="class" field="jclass" usage="optional"/>
      <value name="skin-class" field="skinclass" usage="optional"/>
      <collection field="archives">
         <value name="archive"/>
      </collection>
      <collection field="parameters">
         <structure name="parameter" type="com.livis.xforms.desc.Type$Parameter">
            <value name="name" field="name" style="attribute"/>
            <value name="for" field="kind" usage="optional" style="attribute"/>
            <value field="value" style="text"/>
         </structure>
      </collection>
      <value name="style-ref" field="style" usage="optional" ident="ref"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="style" class="com.livis.xforms.desc.StyleTag">
      <value name="name" field="name" ident="def" style="attribute"/>
      <value field="value" style="text"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="field" class="com.livis.xforms.desc.Form$Field">
      <value name="name" field="name" ident="def" style="attribute"/>
      <structure name="description" usage="optional"/>
      <structure name="value" field="value" usage="optional">
         <structure name="description" usage="optional"/>
         <value name="data" field="data" usage="optional"/>
         <value name="state" field="state" usage="optional"/>
      </structure>
      <value name="param-name" field="paramname" usage="optional"/>
      <value name="label" field="label" usage="optional"/>
      <value name="type-ref" field="type" usage="optional" ident="ref"/>
      <collection field="constraintrefs">
         <value name="constraint-ref"/>
      </collection>
      <structure field="layout" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="constraint" class="com.livis.xforms.desc.Form$Constraint">
      <value name="name" field="name" ident="def" style="attribute"/>
      <structure name="description" usage="optional"/>
      <value name="type-ref" field="type" usage="optional" ident="ref"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="layout" class="com.livis.xforms.desc.Form$FormLayout">
      <structure name="description" usage="optional"/>
      <structure name="columns" usage="optional">
         <collection field="columns"/>
      </structure>
      <structure name="rows" usage="optional">
         <collection field="rows"/>
      </structure>
      <value name="type-ref" field="type" usage="optional" ident="ref"/>
      <structure field="defFieldLayout" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="empty" class="com.livis.xforms.desc.Form$EmptyColumn">
      <value field="spec" style="text" usage="optional"/>
   </mapping>
   <mapping name="label" class="com.livis.xforms.desc.Form$LabelColumn">
      <value field="spec" style="text" usage="optional"/>
   </mapping>
   <mapping name="column" class="com.livis.xforms.desc.Form$FieldColumn">
      <value field="spec" style="text" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="empty" class="com.livis.xforms.desc.Form$EmptyRow">
      <value name="repeat" field="repeat" style="attribute" usage="optional"/>
      <value field="spec" style="text" usage="optional"/>
   </mapping>
   <mapping name="row" class="com.livis.xforms.desc.Form$FieldRow">
      <value name="repeat" field="repeat" style="attribute" usage="optional"/>
      <value field="spec" style="text" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
   <mapping name="layout-hints" class="com.livis.xforms.desc.Form$FieldLayout" value-style="attribute">
      <value name="name" field="name" usage="optional"/>
      <value name="size" field="size" usage="optional"/>
      <value name="lines" field="lines" usage="optional"/>
      <value name="block" field="block" usage="optional"/>
      <value name="col" field="column" usage="optional"/>
      <value name="colspan" field="columnspan" usage="optional"/>
      <value name="row" field="row" usage="optional"/>
      <value name="rowspan" field="rowspan" usage="optional"/>
      <value name="spec" field="spec" usage="optional"/>
   </mapping>
   <!-- ============================================================== -->
</binding>

Reply via email to