cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew MacDonald <andrew_james_macdon...@yahoo.com>
Subject CForms: inserting unique node on save
Date Fri, 14 Jan 2005 23:17:22 GMT
Hello,
I'm using CForms to edit an XML file, but can't figure
out how to insert a unique node when saving the
document.

Here is what the default doc looks like:
==========================
<?xml version="1.0"?>
<tool>
  <toolDetails>
    <toolName>tool</toolName>
    <toolDescription>description</toolDescription>
    <endpointURL>URL</endpointURL>
    <serviceURI>URI</serviceURI>
    <serviceMethod>method</serviceMethod>
  </toolDetails>
  <params>
    <param id="1">
      <label/>
      <paramName/>
      <value/>
      <soapType/>
      <defaultValue/>
      <display/>
      <listItems>
        <listItem id="1">
          <label>preset1</label>
          <value>preset1</value>
        </listItem>
        <listItem id="2">
          <label>preset2</label>
          <value>preset2</value>
        </listItem>
      </listItems>
    </param>
  </params>
</tool>
====================
Basically I want to insert a new <param> node (and
increase the id value for it).  Currently when use the
form.save(doc) method it overwrites the first <param>.
 I've been trying to specify the last <param> node in
my binding file but get a "JXPath can only create a
path if it uses exclusively the child:: and
attribute:: axes and has no context-dependent
predicates" error, so I'm assuming something like
"<fb:value id="label" path="param[last()]/label"/>"
will not work.

Oh, and although I'm using a repeater for <listItems>
I can't use that for <params> due to the way the forms
are set up.

Any help would be greatly appreciated!

Thanks,
Andrew MacDonald


	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message