[Wylug-discuss] XML data storage & GUI design

Roger Leigh rleigh at whinlatter.ukfsn.org
Tue Nov 22 18:53:11 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Will Newton <will at misconception.org.uk> writes:

> On Monday 21 November 2005 16:23, Mischa Oliver Altmann wrote:
>
> I'm not sure time series data is that suited to the XML format. Not
> that it can't do it, but the strengths of XML are in structured
> tree-like data with named fields. It may be simpler, easier and more
> CPU and disk space efficient to use e.g. line-based textual format
> e.g.:
>
> XML:
>
> <readings>
>   <reading>
>     <time>1047638</time>
>     <temperature>10.2</temperature>
>     <humidity>64.2</humidity>
>   </reading>
>   ...
> </readings>
>
> ASCII:
>
> 1047638 10.2 64.2

It depends on the structure of the data.  It's certainly possible for
simple sequences, and you can even put sequences in a schema:

- From Gutenprint, in this case embedded as a C string:

static hue_curve_t generic_cyan_curve =
{
  "CyanCurve",
  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
  "<gutenprint>\n"
  "<curve wrap=\"wrap\" type=\"linear\" gamma=\"0\">\n"
  "<sequence count=\"48\" lower-bound=\"0\" upper-bound=\"4\">\n"
  /* C */  "1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 "  /* B */
  /* B */  "1.000 0.875 0.750 0.625 0.500 0.375 0.250 0.125 "  /* M */
  /* M */  "0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 "  /* R */
  /* R */  "0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 "  /* Y */
  /* Y */  "0.000 0.125 0.250 0.375 0.500 0.625 0.750 0.875 "  /* G */
  /* G */  "1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 "  /* C */
  "</sequence>\n"
  "</curve>\n"
  "</gutenprint>\n"
};

This is part of the schema:

  <xsd:simpleType name="sequencecontent">
    <xsd:list itemType="double"/>
  </xsd:simpleType>

  <xsd:element name="sequence" type="sequencecontent">
    <xsd:annotation>
      <xsd:documentation>
        The "sequence" class stores a list of numbers, based upon the
        stp_sequence_t type.  It has a defined length, and lower and
        upper bounds.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attributeGroup>
      <xsd:attribute name="count" type="positiveInteger" use="required"/>
      <xsd:attribute name="lower-bound" type="xsd:float" use="required"/>
      <xsd:attribute name="upper-bound" type="xsd:float" use="required"/>
    </xsd:attributeGroup>
  </xsd:element>

  <xsd:element name="curve">
    <xsd:annotation>
      <xsd:documentation>
        The "curve" class stores a complete stp_curve_t curve
        representation.  It is derived from the stp_sequence_t type,
        and contains a sequence element.
      </xsd:documentation>
    </xsd:annotation>
   <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="sequence" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:attributeGroup>
      <xsd:attribute name="type" use="required">
        <xsd:simpleType>
          <xsd:restriction type="normalizedString">
            <xsd:enumeration value="linear"/>
            <xsd:enumeration value="spline"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="wrap" use="required">
        <xsd:simpleType>
          <xsd:restriction type="normalizedString">
            <xsd:enumeration value="nowrap"/>
            <xsd:enumeration value="wrap"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="gamma" type="xsd:float" use="required"/>
    </xsd:attributeGroup>
  </xsd:element>

I would be very interested in finding a command-line tool that takes a
schema file and XML file and validates it for you, preferably that
uses libxml2.  Does anyone have any suggestions?


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFDg2fJVcFcaSW/uEgRAtECAJ42E5oS+CA29CUktnjTMeaT4eGb6wCgg61G
LuaH7QP4Mo4TW9YgMTv8nZU=
=HyRW
-----END PGP SIGNATURE-----




More information about the Wylug-discuss mailing list