Re: Using and extending XForms-Schema.xsd

Mark,

Thanks for the link: that document addresses exactly the schema
mixing/extending problems I'm having, so I'm glad that some thought is
being put into this.

Regarding the use of QNames in the appearance tag, thanks for the tip
- I can see that this can go a fair way towards providing custom
appearance 'hints'. However, some of the layout tags we've created
involve complex content specifying column numbers, widths, section
styles etc, which suits itself to a metadata style element rather than
an appearance. (Although by the time the form is handed to the XForms
engine it may be encoded differently - this is more an abstract
definition for editing & storage).

Also, we're using the Eclipse EMF & EMF.Edit frameworks to generate a
Java API to act as a basis for an editor/designer (a web based one,
interestingly enough). So the tighter and more explicit we can make
the schema, with our own element types declared explicitly, the more
useful and safe this API becomes.

Anyway, for now I can achieve what I need to by editing the
XForms-Schema.xsd, but I certainly look forward to any new/revised
XForms schemas that make this avoidable :)

Adrian

On 7/20/05, Mark Birbeck <mark.birbeck@x-port.net> wrote:
> Adrian,
> 
> The first thing to say is that from your description you don't sound like
> you need to extend the schemas. The appearance attribute can take QNames so
> you can add your own values:
> 
>   <xforms:group bind="bind-name" appearance="adrian:vertical">
>     <xforms:input bind="bind-firstname">
>       <xforms:label>First Name</xforms:label>
>     </xforms:input>
>     <xforms:input bind="bind-lastname">
>       <xforms:label>Last Name</xforms:label>
>     </xforms:input>
>   </xforms:group>
> 
> If you are using server-side generated XForms then you can easily spot this
> value and do some more specific formatting. And if you are using client-side
> generated XForms then in Mozilla you could use CSS rules to add some extra
> CSS rules, and in formsPlayer version 2 you can use XBL binding rules to
> bind a completely different widget (if you wanted to).
> 
> However, although I think it's not relevant for your problem, your question
> about schemas still stands as a more general issue. I'm currently working on
> trying to get XML Schema to 'play ball' in terms of modularisation for
> compound documents (XHTML + XForms + SVG + MathML, etc.). If you are
> interested in this area, some comments are on the XForms Wiki at:
> 
> 
> http://www.xforms-wiki.com/bin/view/Main/CompoundDocumentSchemaBestPractices
> 
> If you really need to have schemas that allow you to add the extra features
> you describe then I would use the schemas that will come out of this work.
> (They are nearly complete!)
> 
> Regards,
> 
> Mark
> 
> 
> Mark Birbeck
> CEO
> x-port.net Ltd.
> 
> e: Mark.Birbeck@x-port.net
> t: +44 (0) 20 7689 9232
> w: http://www.formsPlayer.com/
> b: http://internet-apps.blogspot.com/
> 
> Download our XForms processor from
> http://www.formsPlayer.com/
> 
> > -----Original Message-----
> > From: www-forms-request@w3.org
> > [mailto:www-forms-request@w3.org] On Behalf Of Adrian Baker
> > Sent: 20 July 2005 00:27
> > To: www-forms@w3.org
> > Subject: Using and extending XForms-Schema.xsd
> >
> >
> > We have a forms application in which our forms are defined
> > using XForms hosted in proprietary xml document (these are
> > then converted via XSLT to XHTML+XForms documents which are
> > passed to the XForms engine).
> >
> > I've been trying to integrate our inhouse proprietary form
> > schema (which isn't particularly complex - primarily it's
> > just a platform independent container document for the XForms
> > markup) with the XForms-Schema.xsd defined as part of the
> > spec (http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd).
> >
> > One extension we have is that some extra tags are present
> > inside xforms elements, for example a group can have a
> > 'layout' metadata tag (from our own namespace), which affects
> > the XHTML generated from the form definition (because we
> > wanted more precise control than the minimal, compact & full
> > appearance hints)
> >
> > <xforms:group bind="bind-name">
> >    <layout:vertical-layout/>
> >    <xforms:input bind="bind-firstname">
> >        <xforms:label>First Name</xforms:label>
> >    </xforms:input>
> >    <xforms:input bind="bind-lastname">
> >        <xforms:label>Last Name</xforms:label>
> >    </xforms:input>
> > </xforms:group>
> >
> > My schema knowledge is fairly basic, but my first instinct
> > here was to look for a way to extend the XForms group type to
> > allow a 'layout' tag to be added. As far as I could tell
> > though, there is no such type declared (in fact there are no
> > complexTypes declared at all), only a top level group element
> > which isn't available for extension:
> >
> >    <xsd:element name="group">
> >        <xsd:complexType>
> >            <xsd:sequence>
> >                <xsd:element ref="xforms:label" minOccurs="0"/>
> >                <xsd:sequence minOccurs="0" maxOccurs="unbounded">
> >                    <xsd:choice>
> >                        <xsd:group ref="xforms:UI.Common"/>
> >                        <xsd:group ref="xforms:Form.Controls"/>
> >                        <xsd:element ref="xforms:group"/>
> >                        <xsd:element ref="xforms:switch"/>
> >                        <xsd:element ref="xforms:repeat"/>
> >                        <!-- containing document language to
> > add additional allowed content here -->
> >                    </xsd:choice>
> >                </xsd:sequence>
> >            </xsd:sequence>
> >            <xsd:attributeGroup ref="xforms:Common.Attributes"/>
> >            <xsd:attributeGroup
> > ref="xforms:Single.Node.Binding.Attributes"/>
> >            <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
> >        </xsd:complexType>
> >    </xsd:element>
> >
> > Note the comment 'containing document language to add
> > additional allowed content here' - precisely what I want to
> > do, but am I expected to actually maintain and edit a local
> > copy of this schema to do this?
> > Certainly that's easy enough, especially since I expect the
> > public version will be slow to change, but surely the
> > preferred method would be to extend, rather than directly modify?
> >
> > Adrian
> >
> >
> >
> >
> 
> 
> 
>

Received on Thursday, 21 July 2005 05:53:19 UTC