How are namespaces in a bind being resolved?

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

How are namespaces in a bind being resolved?

cvesters
It's not really a problem, but knowing this would really help.
The problem I have is that I have an element with a bind, the nodeset refered by the bind contains xml namespaces.

<xforms:repeat bind="__query_Rm9ybVF1ZXJ5ICgxNjgyKQ____">

<xforms:bind nodeset="sdns1:document/sdns1:any-document" id="__query_Rm9ybVF1ZXJ5ICgxNjgyKQ____"/>

<xforms:instance id="Default">
    <sdns1:form>
        ...
    </sdns1:form>
</xforms:instance>


This gives me an error when deploying the form, as the namespace can not be resolved.
Adding the namespace declaration on the repeat solves this issue, but so does adding it to the instance.

I'm curious as to what context Orbeon uses to resolve the namespace?

Kind regards,
Chris Vesters
Reply | Threaded
Open this post in threaded view
|

Re: How are namespaces in a bind being resolved?

Alessandro  Vernet
Administrator
Hi Chris,

You should just need to have that "sdns1" prefix defined everywhere you are using it, which in your case means where your <xforms:bind> and <sdns1:form> are. The namespace can be declared on those elements, or on any of their parents. Usually, the simplest thing is to declare them on the root element (the <xh:html>), along with other namespaces. Does this make sense?

Alex

On Wed, Jan 27, 2016 at 8:19 AM cvesters <[hidden email]> wrote:
It's not really a problem, but knowing this would really help.
The problem I have is that I have an element with a bind, the nodeset
refered by the bind contains xml namespaces.

<xforms:repeat bind="__query_Rm9ybVF1ZXJ5ICgxNjgyKQ____">

<xforms:bind nodeset="sdns1:document/sdns1:any-document"
id="__query_Rm9ybVF1ZXJ5ICgxNjgyKQ____"/>

<xforms:instance id="Default">
    <sdns1:form>
        ...
    </sdns1:form>
</xforms:instance>


This gives me an error when deploying the form, as the namespace can not be
resolved.
Adding the namespace declaration on the repeat solves this issue, but so
does adding it to the instance.

I'm curious as to what context Orbeon uses to resolve the namespace?

Kind regards,
Chris Vesters

--
View this message in context: http://discuss.orbeon.com/How-are-namespaces-in-a-bind-being-resolved-tp4660978.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How are namespaces in a bind being resolved?

cvesters
This post was updated on .
I know how namespaces work, I am just trying to find out how Orbeon determines the namespace mapping for a namespace in a bind.

Since a bind is not inside an xform instance. So which declarations will it consider when trying to resolve the namespace?

Edit: I just found out that the bind is actually being placed directly on the xforms:repeat as a ref attribute.

So, I have an <xforms:repeat ref="..." />
This ref is an expression with namespaces. Which context will be used to resolve the namespaces?
The context of the xforms repeat obviously, but I discovered that putting the namespace declaration on the xforms:instance als seems to work. Is this expected or just luck?
Reply | Threaded
Open this post in threaded view
|

Re: How are namespaces in a bind being resolved?

Alessandro  Vernet
Administrator
Hi Chris,

I am not sure to get your question; there is nothing specific to Orbeon Forms or even XForms here: when an XPath expression is used, if it contains prefixes, the meaning of those prefixes is based on the namespaces in scope at the point where the expression is found. In your case, that would be the namespaces in scope where you put the <xf:bind>. Does this help?

Alex

On Wed, Jan 27, 2016 at 11:10 PM cvesters <[hidden email]> wrote:
I know how namespaces work, I am just trying to find out how Orbeon
determines the namespace mapping for a namespace in a bind.

Since a bind is not inside an xform instance. So which declarations will it
consider when trying to resolve the namespace?

--
View this message in context: http://discuss.orbeon.com/How-are-namespaces-in-a-bind-being-resolved-tp4660978p4660980.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How are namespaces in a bind being resolved?

cvesters
I though I witnessed some weird behaviour, but I'm unable to reproduce it. Perhaps I did something wrong the first time.

What I saw was that if I put the namespace declaration on the <xforms:instance> the namespace could be found. Which is weird because the element containing the ref is not inside the instance.

Perhaps there was a lingering namespace declarations somewhere. But for a moment it seemed like Orbeon did something weird with resolving namespaces, like they would look for namespace declarations in the default instance as well.
Reply | Threaded
Open this post in threaded view
|

Re: How are namespaces in a bind being resolved?

Alessandro  Vernet
Administrator
Hi Chris,

Understood. And Orbeon Forms shouldn't do anything unexpected with namespaces. To people unfamiliar with namespaces, how namespaces work can already be "unexpected" enough :). But of course, just let us know if in the future you stumble again into that case.

Alex

On Fri, Jan 29, 2016 at 6:53 AM cvesters <[hidden email]> wrote:
I though I witnessed some weird behaviour, but I'm unable to reproduce it.
Perhaps I did something wrong the first time.

What I saw was that if I put the namespace declaration on the
<xforms:instance> the namespace could be found. Which is weird because the
element containing the ref is not inside the instance.

Perhaps there was a lingering namespace declarations somewhere. But for a
moment it seemed like Orbeon did something weird with resolving namespaces,
like they would look for namespace declarations in the default instance as
well.

--
View this message in context: http://discuss.orbeon.com/How-are-namespaces-in-a-bind-being-resolved-tp4660978p4660983.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet