Okay, this only seems to manifest as a problem for me when
binding to
attributes however. it is finding elements that are bound
to, but when
I try to find attributes it needs the namespace binding, in
what way
can I do my xpath query or binding so it will match to the
correct
element even though the namespace is declared further up in
the tree
than the instance?
Cheers,
Bryan Rasmussen
On 3/22/07, Lars Oppermann <lars.oppermann sun.com> wrote:
> Hi Bryan,
>
> I took some time to look at the namespace handling in
the XForms code. I
> cannot say that I have the full picture yet. However,
it is clear that
> there seem to be numerous problems.
>
> First of all, the forms processor does not see the full
document as a
> DOM tree. Only the actual instances are treated as a
DOM. Consequently,
> any namespaces that are declared further up in the full
document tree
> are not available to the processor.
>
> Furthermore the XML editing UI in OOo misses some
aspects of namespace
> handling. You can only specify namespace declarations
on individual
> bindings. In my opinion that is very inconvenient. I
think it should be
> possible to at least specify them in a way where they
can be used in all
> bindings. So they would for instance be declared on the
xforms:model
> element. Nevertheless, the fact that only the instance
is treated as
> generic XML makes the whole namespace handling very
cumbersome.
>
> This is not much, but I hope it helps a little bit...
>
> Bests,
> Lars
>
> bryan rasmussen wrote:
> > Hi,
> >
> > I am about ready to crack from too much Xforms in
Open Office work I
> > have to say.
> >
> > Why the does the following give a response of
'This is an invalid
> > binding expression':
> >
> >
> > The drawn element:
> >
> > <draw:control
draw:style-name="defaultCBCfield"
> > draw:text-style-name="P4"
svg:width="3.5cm" svg:height="0.498cm"
> > text:anchor-type="paragraph"
> >
draw:control="controlPaymentMeans_InstructionID_ schemeAgencyID"></draw:control>
> >
> >
> > the sun forms element:
> >
> > <form:text
form:name="TextBoxPaymentMeans_InstructionID_ schemeAgencyID"
> >
form:control-implementation="ooo:com.sun.star.form.comp
onent.TextField"
> >
form:id="controlPaymentMeans_InstructionID_ schemeAgencyID"
> > form:convert-empty-to-null="true"
> >
xforms:bind="BindingPaymentMeans_InstructionID_ schemeAgencyID"
> >
xmlns:number="urn:oasis:names:tc:opendocument mlns:
datas:1.0">
> > <form:properties>
> > <form:property
> > form:property-name="DefaultControl"
> > office:value-type="string"
> >
office:string-value="com.sun.star.form.control.TextFiel
d"></form:property>
> > </form:properties>
> > </form:text>
> >
> > the xforms binding:
> >
> > <xforms:bind
id="BindingPaymentMeans_InstructionID_ schemeAgencyID"
> >
nodeset="/in:Invoice/cac:PaymentMeans/cbc:InstructionID
/ schemeAgencyID"
> > required="false()"
type="xsd:string"
> >
xmlns:number="urn:oasis:names:tc:opendocument mlns:
datas:1.0"></xforms:bind>
> >
> >
> > please note that all sorts of variations of this
binding does not work:
> >
> > //cac:PaymentMeans/cbc:InstructionID/ schemeAgencyID
> > and
> > //cbc:InstructionID/ schemeAgencyID
> > and
> >
//in:Invoice/cac:PaymentMeans/cbc:InstructionID/ schemeAgencyID
> > don't work either.
> >
> > Is it because this element does not exist in the
document?
> >
> > Well no, here is a fragment with it here:
> >
<cac:PaymentMeans><cbc:ID/><cbc:PaymentMeansC
ode
> >
listURI="urn:oioubl.codelist.paymentmeanscode-1.0"
/><cbc:PaymentDueDate/><cbc:PaymentChannelCode
> >
> >
listURI="urn:oioubl:id:paymentchannelcode-1.0"/>
;<cbc:InstructionID
> > schemeAgencyID=""/>
> >
> > if I take the whole xml instance out and running
it over this xslt:
> >
> > <?xml version='1.0' encoding='utf-8'?>
> > <xsl:stylesheet xmlns sl=&q
uot;http://www
.w3.org/1999/XSL/Transform"
> > xmlns:ns="urn:schemas-microsoft-com slt&q
uot;
> > xmlns:fnx="http://rep.oio.dk/funx&q
uot;
> > xmlns:fnc="http://rep.oio.dk/fu
nx/fnc"
> > xmlns:att="http://rep.oio.dk/fu
nx/att"
> > xmlns:temp="http://tempgenerator"
> > xmlns:l="http://tempgenerator/
list"
> >
xmlns:cac="urn:oasis:names:specification:ubl:schema sd:Co
mmonAggregateComponents-2"
> >
> >
xmlns:cbc="urn:oasis:names:specification:ubl:schema sd:Co
mmonBasicComponents-2"
> >
> >
xmlns:office="urn:oasis:names:tc:opendocument mlns:
office:1.0"
> > xmlns:s="urn:oasis:names:tc:opendocument mlns:
s:1.0"
> >
xmlns:text="urn:oasis:names:tc:opendocument mlns:
text:1.0"
> >
xmlns:table="urn:oasis:names:tc:opendocument mlns:
table:1.0"
> >
xmlns:draw="urn:oasis:names:tc:opendocument mlns:
drawing:1.0"
> > xmlns:fo="urn:oasis:names:tc:opendocument mlns<
img
src='http://www.archivesat.com/images/love_struck.gif'>sl-fo
-compatible:1.0"
> > xmlns link=
"http://www.w3.org/
1999/xlink"
> > xmlns:dc="http://purl.or
g/dc/elements/1.1/"
> >
xmlns:meta="urn:oasis:names:tc:opendocument mlns:
meta:1.0"
> >
xmlns:number="urn:oasis:names:tc:opendocument mlns:
datas:1.0"
> >
xmlns:svg="urn:oasis:names:tc:opendocument mlns:
svg-compatible:1.0"
> >
xmlns:chart="urn:oasis:names:tc:opendocument mlns:
chart:1.0"
> >
xmlns:dr3d="urn:oasis:names:tc:opendocument mlns:
dr3d:1.0"
> > xmlns:math="http://www.w
3.org/1998/Math/MathML"
> >
xmlns:form="urn:oasis:names:tc:opendocument mlns:
form:1.0"
> >
xmlns:script="urn:oasis:names:tc:opendocument mlns:
script:1.0"
> > xmlns:ooo="http://openof
fice.org/2004/office"
> > xmlns:ooow="http://openof
fice.org/2004/writer"
> > xmlns:oooc="http://openoffi
ce.org/2004/calc"
> > xmlns:dom="http://www.w3
.org/2001/xml-events"
> > xmlns forms
="http://www.w3.org
/2002/xforms"
> > xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
> > xmlns si=&q
uot;http:
//www.w3.org/2001/XMLSchema-instance"
> > xmlns:docu="http://rep.oio.dk/oioxml/stylesheetdocumentation"
> > xmlns:template="http://r
ep.oio.dk/ubl/templatingsystem"
> > version="1.0">
> > <xsl:output method="text"/>
> > <xsl:template match="/">
> > <xsl:apply-templates
> >
select="/in:Invoice/cac:PaymentMeans/cbc:InstructionID/
schemeAgencyID"/>
> > </xsl:template>
> > <xsl:template match=" schemeAgencyID">
> > yes
> > </xsl:template>
> > </xsl:stylesheet>
> >
> > the output I get is yes, so that means the binding
does exist.
> >
> > now why is this happening???
> >
> > Well partially I suppose it has to do with
namespace binding, for
> > example I can make the binding to my attribute is
correct if using the
> > complete path /in:Invoice and so forth to the
attribute but only if my
> > namespace prefix in is declared in the context of
the element of the
> > element invoice. Thus it does not help at all if
my namespace prefix
> > is declared on the document element of my open
office document. This
> > however is a problem because I am generating the
XML instance from an
> > XSLT processor and despite putting the namespace
declaration both
> > places the processor can make its own mind up, in
this case putting
> > the namespace in the document element. Reasons why
this might be
> > problematic, well, not sure if moving it around or
trying to take it
> > out of the document element isn't going to lead to
a situation where I
> > am running around trying to chase bugs for the
next week and I am
> > supposed to deliver on the 26th, the other reason
is that I am not
> > sure if all the things I am doing in my program
can be made to work
> > with namespaces not output on the document element
of my Open Office
> > document.
> >
> >
> > Cheers,
> > Bryan Rasmussen
> >
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail: dev-unsubscribe xml.openoffice.org
> > For additional commands, e-mail: dev-help xml.openoffice.org
> >
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe xml.openoffice.org
> For additional commands, e-mail: dev-help xml.openoffice.org
>
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe xml.openoffice.org
For additional commands, e-mail: dev-help xml.openoffice.org
|