← Prev in month ← Prev in thread
Next in thread → Next in month →

[wsrp] Proposal for simple properties mechanism based on XForms

From
Gil Tayar <>
Date
2002-08-25T12:31:13+00:00
ID
Thread
[wsrp] Proposal for simple properties mechanism based on XForms
Objectives:

1. Separate 
Property definition (meta-data) from property values from property 
querying.

2. Do 
it simply.

 

General 
model (as defined by XForms 1.0 in http://www.w3.org/TR/xforms/)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<xf:model>

  
<xf:instance>

    <values>

        
<p1>value1</p1>

        
<p2>value2</p2>

        ...

    
</values>

  </xf:instance>

  <xf:bind nodeset="p1" type="xsd:string" /> <!-- 
defines that 'p1' is of type string --> 

  <xf:bind nodeset="..." type="...:foobar" /> <!-- 
defines that 'p1' is of type foobar, which is defined in the <schema> 
below -->

  <xsd:schema>

    ...

    <xsd:simpleType 
id="foobar">...</xsd:simpleType>

  </xsd:schema>

</model> 

 

This 
defines property values (<xf:instance>) and meta-data (<xf:bind>) 
with supporting type definitions.

 

To 
specify only meta-data, specify only empty placeholders for instance data (e.g. 
without values), and optionally specify bind tags (and supporting type 
definitions) for defining types. This is 
conformant to the view of XForms, where the only place to define validation 
constraints is in the <bind> tag, which specifies for nodes in the 
<instance> what their schema is.

To specify 
only values, do not specify bind tags.

To 
specify querying of values, specify only empty placeholders for instance data 
(e.g. without values). This means that to 
retrieve all values of the instance data, just pass back what was received in 
the meta-data description.

 

Constraints for simplicity:

~~~~~~~~~~~~~~~~~~~~~

1. All 
instances are of the form:

  
<values>

   
<property-name>property-value</property-name>

   ...

  </values>

  This means that the root tag contains only child tags with no 
attributes. The sub-values of these tags are 
unconstrained.

  The child tag is a property whose name is the 
property's name and it's content is the property's 
value.

 

2. 
The types for the property values must be one of the pre-defined types defined 
in XML Schema. The default if not defined in a 
<bind> is "##any".

3. The bind 
tag must reference (using its "nodeset" 
attribute) only propeties, i.e. the 
child tags (e.g. p1...).

 

Example:

~~~~~~~

1. 
Description of an entity with two properties - TitleText (string) and ShowHelp 
(boolean):

<xf:model>

  
<xf:instance>

    <values>

       <TitleText 
/>

       <ShowHelp 
/>

    </values>

  
</xf:instance>

  
<xf:bind nodeset="ShowHelp" type="xsd:boolean" />

  <!-- default type is ##any 
-->

</xf:model>

 

2. Querying 
of the value of TitleText:

<xf:model>

  
<xf:instance>

    <values>

       <TitleText 
/>

    </values>

  
</xf:instance>

</xf:model>

 

3. Response 
to the query:

<xf:model>

  
<xf:instance>

    <values>

       <TitleText>This is the title 
of the text</TitleText>

    </values>

  
</xf:instance>

</xf:model>

 

Extensions 
allowed by implementors

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. 
Implement full "bind" functionality (e.g. define "required", "constraints", 
"min"... on each part of instance data). Clients not aware of these can ignore 
them.

2. The 
types for the property values can be any defined in the XML Schema. Clients not 
aware of these can ignore them and assume "xsd:##any".

3. Remove constraints 
on the bind tag.

4. Remove 
constraint on structure of the values.

 

Comments, anybody?

Gil Tayar

WebCollage
← Prev in month ← Prev in thread
Next in thread → Next in month →