alexxiopiccinno / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

Enhancement request for Jabber.protocl.x.Data #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Enhancement request

Please modify the class

Jabber.protocl.x.Data to support the entire x data specification:

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='jabber:x:data'
    xmlns='jabber:x:data'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0004: http://www.xmpp.org/extensions/xep-0004.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='x'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='instructions' 
                    minOccurs='0' 
                    maxOccurs='unbounded' 
                    type='xs:string'/>
        <xs:element name='title' minOccurs='0' type='xs:string'/>
        <xs:element ref='field' minOccurs='0' maxOccurs='unbounded'/>
        <xs:element ref='reported' minOccurs='0' maxOccurs='1'/>
        <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
      </xs:sequence>
      <xs:attribute name='type' use='required'>
        <xs:simpleType>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='cancel'/>
            <xs:enumeration value='form'/>
            <xs:enumeration value='result'/>
            <xs:enumeration value='submit'/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

  <xs:element name='field'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='desc' minOccurs='0' type='xs:string'/>
        <xs:element name='required' minOccurs='0' type='empty'/>
        <xs:element ref='value' minOccurs='0' maxOccurs='unbounded'/>
        <xs:element ref='option' minOccurs='0' maxOccurs='unbounded'/>
      </xs:sequence>
      <xs:attribute name='label' type='xs:string' use='optional'/>
      <xs:attribute name='type' use='optional' default='text-single'>
        <xs:simpleType>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='boolean'/>
            <xs:enumeration value='fixed'/>
            <xs:enumeration value='hidden'/>
            <xs:enumeration value='jid-multi'/>
            <xs:enumeration value='jid-single'/>
            <xs:enumeration value='list-multi'/>
            <xs:enumeration value='list-single'/>
            <xs:enumeration value='text-multi'/>
            <xs:enumeration value='text-private'/>
            <xs:enumeration value='text-single'/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name='var' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='option'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='value'/>
      </xs:sequence>
      <xs:attribute name='label' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='value' type='xs:string'/>

  <xs:element name='reported'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='field' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
    <xs:annotation>
      <xs:documentation>
        When contained in a "reported" element, the "field" element
        SHOULD NOT contain a "value" child.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name='item'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='field' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>

I am going to work on making the changes necessary to support this change.
When I am finished I will post the changes and you can include in the 
project.

Casey

Original issue reported on code.google.com by BCaseyHa...@gmail.com on 13 Nov 2008 at 5:25

GoogleCodeExporter commented 8 years ago
as specified in:
http://xmpp.org/extensions/xep-0004.html#schema

Original comment by BCaseyHa...@gmail.com on 13 Nov 2008 at 5:37

GoogleCodeExporter commented 8 years ago
The parts that are missing the I need are:

<xs:element name='reported'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='field' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
    <xs:annotation>
      <xs:documentation>
        When contained in a "reported" element, the "field" element
        SHOULD NOT contain a "value" child.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name='item'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='field' maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

These are needed to support:

http://xmpp.org/extensions/xep-0055.html

Original comment by BCaseyHa...@gmail.com on 13 Nov 2008 at 5:39

GoogleCodeExporter commented 8 years ago

Original comment by hil...@gmail.com on 3 Dec 2008 at 3:34