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="[EMAIL PROTECTED]"></draw:control>
>
>
> the sun forms element:
>
> <form:text
form:name="[EMAIL PROTECTED]"
> form:control-implementation="ooo:com.sun.star.form.component.TextField"
> form:id="[EMAIL PROTECTED]"
> form:convert-empty-to-null="true"
> xforms:bind="[EMAIL PROTECTED]"
> xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datas:1.0">
> <form:properties>
> <form:property
> form:property-name="DefaultControl"
> office:value-type="string"
>
office:string-value="com.sun.star.form.control.TextField"></form:property>
> </form:properties>
> </form:text>
>
> the xforms binding:
>
> <xforms:bind id="[EMAIL PROTECTED]"
>
nodeset="/in:Invoice/cac:PaymentMeans/cbc:InstructionID/@schemeAgencyID"
> required="false()" type="xsd:string"
>
xmlns:number="urn:oasis:names:tc:opendocument:xmlns: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:PaymentMeansCode
>
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:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:ns="urn:schemas-microsoft-com:xslt"
> xmlns:fnx="http://rep.oio.dk/funx"
> xmlns:fnc="http://rep.oio.dk/funx/fnc"
> xmlns:att="http://rep.oio.dk/funx/att"
> xmlns:temp="http://tempgenerator"
> xmlns:l="http://tempgenerator/list"
>
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
>
>
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
>
> xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
> xmlns:s="urn:oasis:names:tc:opendocument:xmlns:s:1.0"
> xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
> xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
> xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
> xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:dc="http://purl.org/dc/elements/1.1/"
> xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
> xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datas:1.0"
> xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
> xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
> xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
> xmlns:math="http://www.w3.org/1998/Math/MathML"
> xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
> xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
> xmlns:ooo="http://openoffice.org/2004/office"
> xmlns:ooow="http://openoffice.org/2004/writer"
> xmlns:oooc="http://openoffice.org/2004/calc"
> xmlns:dom="http://www.w3.org/2001/xml-events"
> xmlns:xforms="http://www.w3.org/2002/xforms"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:docu="http://rep.oio.dk/oioxml/stylesheetdocumentation"
> xmlns:template="http://rep.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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]