Tony Edwards wrote:

Hi people,
I'm progressing nicely with my journey down the enlightened path of Woody/CForms, incorporating more of its wonderful features as I go.
I'm now at the stage where I'd like to bind the content of a CForm to a selected element of a large XML document.
Is there any way to programmatically or otherwise nominate the xpath attribute of the wb:context element in the binding file?
For example, here's a snippet of the document I'm editing:
<hierarchy description="Tony Test Hrcy" hrcyNumber="16">
<hNode ID="517" copyStatus="L" nodeNum="517" seqNum="0">Date Testing Nodes</hNode>
<hNode ID="331" copyStatus="L" nodeNum="331" seqNum="0">Node1</hNode>
<hNode ID="505" copyStatus="L" nodeNum="505" seqNum="0">Node Test</hNode>
<hNode ID="526" copyStatus="L" nodeNum="526" seqNum="0">New Node for Mondays</hNode>
<hNode ID="474" copyStatus="L" nodeNum="474" seqNum="1">Node Not For Role Ate</hNode>
<hNode ID="684" copyStatus="L" nodeNum="684" seqNum="2">Frunobulax</hNode>
</hierarchy>


Let's say I want to bind on the 'Frunobulax' node. Can I specify the path as "//[EMAIL PROTECTED]:selectedNode}" (where selectedNode = 684) or similar?

Nope, but there is a far easier way to cope with this:
when you load the XML file to a DOM-tree, then you can easily have code that selects the DOM-element-context you want to work on


you just give that to the binding in the load() and save()

HTH,
-marc=
--
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
[EMAIL PROTECTED]                              [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to