RE: XForms, HLink and modularizing XHTML 2.0 docs

Hi John,

[I've CCd the list, since others may be interested in this - particularly
your question about XLink and HLink.]

> 1. The currencyCodes and country_Codes templates that are referred to and
> expanded (as noted in comments), are they incorporated via HLinks or
> XLinks? From what I've read, the XHTML 2.0 wg is going with the former
> than latter.

Neither, I'm afraid. We've developed a template expansion mechanism which we
will be releasing soon. It sits at a lower level - a bit like XInclude - so
XForms and XHTML are completely unaware of it. But the principle of what you
are doing is the same as what I am doing.

> 2. So I guess in the HLink/XForms example I gave in my posting would do,
> and I could refrain from putting in the <xforms:model> declarations in the
> master doc.  In the sub-docs (which are hlink'd to), I would use the
> "localized" <xforms:model> approach you gave (in the <body>..</body>).  Is
> my assertion correct? 

Yes.

> What I found I bit confusing in your example is that the expansions of
> countryCOdes and currencyCodes ref'd country and currency, which are
> declared in the <xf:model> segment of the main doc's <head> section.

That's where the data will be stored when the user chooses a country. But
because I use templates and not just ordinary inclusion, then the problem
you raise is easy to solve (this is not our template syntax, but it shows
the approach):

    <template name="country">
        <target>
            <model>myData</model>
            <ref>country</ref>
        </target>
    </template>

    <template name="currency">
        <target>
            <model>myData</model>
            <ref>currency</ref>
        </target>
    </template>

> ... if you add another object to one of the sub-docs, eg.
>
>	<xf:input ref="cntryname">
>	   <xf:label>Country Name: </xf:label>
>	</xf:input>
>
> in countryCodes.xml ...

Take another look at the sample ... countryCodes.xml is just a list of
countries for the instance data, to be used for populating the select list.
It's not an included document with a list of forms controls - so you
wouldn't add anything to that.

In short, using templates is a lot more powerful than just doing an include.

Mark Birbeck

Received on Thursday, 3 July 2003 11:01:32 UTC