xforms:insert or another command??

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xforms:insert or another command??

agnesedalmonte
I've a question about xforms:insert.
Can I insert a node into an instance automatically, after the specification of
an XML schema for this instance?

Fox example:
<xf:instance id="my-instance">
        <SOAP-ENV:Envelope
                xmlns:SOAP-ENV="…/"
                xmlns:m0="… "
                xmlns:m5="…">
                        <SOAP-ENV:Body>
                                <m:UpdateResponse
                                        xmlns:m="…">
                                        <m0:A></m0:A>
                                        <m0:B></m0:B>
                                        <m5:C></m5:C>
                                        …
                                        <m0:D></m0:D>
                                </m:UpdateResponse>
                        </SOAP-ENV:Body>
                </SOAP-ENV:Envelope>
        </xf:instance>

This response are returned from a Web Service and some field are optional and
may not be present.

I have the .xsd file for this Response.

I want to add fields only if necessary and in the right position

Whit xforms:insert command I have to consider all possible paths…

<xforms: action if=”…”> <xforms:insert …>

…because I have to specify the nodeset or the context… but it is variable!

Is it possible to use the XML schema to automate the addition of fields??
Any other xforms command??

 Thank you
Agnese


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xforms:insert or another command??

Alessandro Vernet
Administrator
Agnese,

agnesedalmonte wrote
I've a question about xforms:insert.
Can I insert a node into an instance automatically, after the specification of
an XML schema for this instance?
There is no build-in feature to create "missing" nodes in a document based on a schema in XForms or Orbeon Forms. Essentially you'll have to write some code to do that. If your schema is simple enough, maybe you can load it in an instance, and write some XForms code that iterates over the schema and creates the nodes. If you feel more conformable doing this in XSLT, this is also an option.

Alex