cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roy huang" <>
Subject [Help][CForms]About insert-node
Date Thu, 24 Jun 2004 11:44:02 GMT
    I'm writing a tools base on form-gui but editing data binding file.All's fine but one
problem make me stuck.
    In one binding file value may need convert like:

  <fb:value id="created" path="created">
   <fd:convertor datatype="date">

 and if no convert is needed it may look like:
  <fb:value id="created" path="created">

 Basing form-gui sample,I define my edit-form define like:
      <fd:struct id="value">
        <fd:new id="direction-class" />
        <fd:new id="id-class" />
        <fd:new id="path-class" />
        <fd:new id="datatype-class" />
        <fd:new id="convertor-class" />

and binding define lookes like:

 <fb:class id="value-class">
  <fb:case id="value" path=".">
   <fb:struct id="value" path="fb:value">
    <fb:value id="id" path="@id" />
    <fb:value id="direction" path="@direction" />
    <fb:value id="path" path="@path" />
    <fb:value id="datatype" path="fd:convertor/@datatype" />
    <fb:value id="convertor" path="fd:convertor/fd:patterns/fd:pattern"/>

it can display well,but when I save it,error occoured:

org.apache.commons.jxpath.JXPathException: Exception trying to create xpath fd:convertor/@datatype;
Cannot create an attribute for path /fb:value[1]/fd:convertor/@datatype, operation is not
allowed for this type of node

I must change    
to solve this problem,but this also make <fb:value> in the new databind define all have
<fd:convertor> child node even it doesn't need it.

My question is how to aviod the error and insert <fd:convertor> only when it is needed.


Roy Huang 
View raw message