On Fri, Sep 22, 2006 at 01:22:16PM +0100, jtgxbass wrote:
> >The thing that makes it a complex problem is that XMLSchema is rather
> >complex. So, I'll just ignore anything that looks tricky for the
> >moment.
>
> Yes an XML schema can become quite complex. But if they are being authored
> for use by you, perhaps you could require certain constraints?
That's my plan :)
So, I got this far...
---- catalogue.xsd ----
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/merchandise/2006"
xmlns="http://www.example.com/merchandise/2006"
elementFormDefault="qualified">
<xs:complexType name="Product">
<xs:annotation>
<xs:documentation xml:lang="en">A product available for
purchase.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="description"/>
<xs:element name="price" type="xs:float"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
</xs:complexType>
</xs:schema>
----
java Main catalogue.xsd
...
---- com/example/www/merchandise/_2006/Product.as ----
package com.example.www.merchandise._2006{
/**
* A product available for
* purchase.
*/
public class Product {
public var id:Number;
public var title:String;
public var description:org.w3.www._2001.XMLSchema.anyType;
public var price:Number;
}
}
----
...needs more work still ;)
ta,
dave
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org