Error inserting a node below the root

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

Error inserting a node below the root

Grégoire Neuville
Hi,

I'm currently working on a metadata editor part of the ORI-OAI
(www.ori-oai.org) based on Orbeon forms. The form I am dealing with is
in charge of editing a document the structure of which is as follow :

<dcfr:dc>
    <dc:creator />
    <dc:contributor />
    etc...

</dcfr:dc>

I'm willing to insert an additional 'dc:contributor' (or whatever dc
prefixed element) to the document according to the aforementioned
structure (just below the dcfr:dc root so) but keep on coming across
the following error : 'org.orbeon.saxon.om.QNameException: Invalid
QName {}'. This error is raised in particular when the 'context' or
'nodeset' (or their combination) attributes of the 'xforms:insert'
element point to the root of the edited instance (for example
something like this :
<xforms:insert context="xxforms:instance('main-instance')
origin="xxforms:instance('instance_containing_my_node')/dc:contributor"
/>
invariably raises this exception).

I've also tried to reach the same goal through xforms:submission, xpl
and xsl, without success (same issue with a 'dc' prefixed element, I
was able to insert an unprefixed node though).

The strangest of all is that the 'xforms-widgets.xsl' stylesheet
contains xforms code that is able to perform such an insertion without
error (but I can't rely on that stylesheet for this sole insertion).

Any suggestion ?

(I'm using Orbeon Forms 3.7.0beta1, Apache Tomcat/5.5.25, JDK 1.6.0_14-b08)

Thanks,
--
Grégoire Neuville


--
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: Error inserting a node below the root

Grégoire Neuville
Answer to myself : insertion was working all right, the problem came
from an attribute of the node I was trying to insert : this attribute
is bound to the 'xsi' namespace (xsi:type is the QName of the
attribute) and the 'Invalid QName' exception was thrown because this
attribute was empty at insertion time - and now I can reproduce the
exception at initialisation time by putting an element wearing an
xsi:type empty attribute in the instance declaration. Note that xsi is
the only namespace - at least in my case - to cause such an error.

Don't know if this behaviour is expected, but hope that report helps.

2009/8/28 Grégoire Neuville <[hidden email]>:

> Hi,
>
> I'm currently working on a metadata editor part of the ORI-OAI
> (www.ori-oai.org) based on Orbeon forms. The form I am dealing with is
> in charge of editing a document the structure of which is as follow :
>
> <dcfr:dc>
>    <dc:creator />
>    <dc:contributor />
>    etc...
>
> </dcfr:dc>
>
> I'm willing to insert an additional 'dc:contributor' (or whatever dc
> prefixed element) to the document according to the aforementioned
> structure (just below the dcfr:dc root so) but keep on coming across
> the following error : 'org.orbeon.saxon.om.QNameException: Invalid
> QName {}'. This error is raised in particular when the 'context' or
> 'nodeset' (or their combination) attributes of the 'xforms:insert'
> element point to the root of the edited instance (for example
> something like this :
> <xforms:insert context="xxforms:instance('main-instance')
> origin="xxforms:instance('instance_containing_my_node')/dc:contributor"
> />
> invariably raises this exception).
>
> I've also tried to reach the same goal through xforms:submission, xpl
> and xsl, without success (same issue with a 'dc' prefixed element, I
> was able to insert an unprefixed node though).
>
> The strangest of all is that the 'xforms-widgets.xsl' stylesheet
> contains xforms code that is able to perform such an insertion without
> error (but I can't rely on that stylesheet for this sole insertion).
>
> Any suggestion ?
>
> (I'm using Orbeon Forms 3.7.0beta1, Apache Tomcat/5.5.25, JDK 1.6.0_14-b08)
>
> Thanks,
> --
> Grégoire Neuville
>


--
Grégoire Neuville


--
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: Error inserting a node below the root

Alessandro Vernet
Administrator
Grégoire,

Grégoire Neuville wrote
Answer to myself : insertion was working all right, the problem came
from an attribute of the node I was trying to insert : this attribute
is bound to the 'xsi' namespace (xsi:type is the QName of the
attribute) and the 'Invalid QName' exception was thrown because this
attribute was empty at insertion time - and now I can reproduce the
exception at initialisation time by putting an element wearing an
xsi:type empty attribute in the instance declaration. Note that xsi is
the only namespace - at least in my case - to cause such an error.

Don't know if this behaviour is expected, but hope that report helps.
Yes, this error seems reasonable. When you have xsi:type="..." attributes on nodes of your instance, the XForms engine will try to interpret those to attach a type to the node, just as if you had a <xforms:bind type="..."/> for that node. So it is normal that the XForms engine isn't too happy when it can't parse the type you specify in xsi:type="..." isn't a valid type.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Error inserting a node below the root

Grégoire Neuville
Ok, that makes sense now. Thanks for the explanation.

Grégoire.

2009/8/29 Alessandro  Vernet <[hidden email]>:

>
> Grégoire,
>
>
> Grégoire Neuville wrote:
>>
>> Answer to myself : insertion was working all right, the problem came
>> from an attribute of the node I was trying to insert : this attribute
>> is bound to the 'xsi' namespace (xsi:type is the QName of the
>> attribute) and the 'Invalid QName' exception was thrown because this
>> attribute was empty at insertion time - and now I can reproduce the
>> exception at initialisation time by putting an element wearing an
>> xsi:type empty attribute in the instance declaration. Note that xsi is
>> the only namespace - at least in my case - to cause such an error.
>>
>> Don't know if this behaviour is expected, but hope that report helps.
>>
>
> Yes, this error seems reasonable. When you have xsi:type="..." attributes on
> nodes of your instance, the XForms engine will try to interpret those to
> attach a type to the node, just as if you had a <xforms:bind type="..."/>
> for that node. So it is normal that the XForms engine isn't too happy when
> it can't parse the type you specify in xsi:type="..." isn't a valid type.
>
> Alex
>
> -----
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
> Twitter - http://twitter.com/avernet
> --
> View this message in context: http://www.nabble.com/Error-inserting-a-node-below-the-root-tp25185981p25198930.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> --
> 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
>
>


--
Grégoire Neuville


--
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