users@jaxb.java.net

create a new nodo

From: lissette <glorianchu18_at_hotmail.com>
Date: Fri, 8 Jun 2007 08:20:57 -0700 (PDT)

I need create a new product in the catalogs. My xml is:
<?xml version="1.0" encoding="UTF-8"?>
<catalogs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="catalogs.xsd">
    <catalog catalogID="1" name="Cafes">
        <description>El catalogo contiene Cafes</description>
        <product productID="C349K4">
                <productName>Arabica</productName>
                <vendor>Cafetaras Norte S.A</vendor>
                <property name="Remark"></property>
                    <price>13.5</price>
        </product>
        <product productID="C349K5">
                    <productName>Mocha Java</productName>
                <vendor>Cafetaras Norte S.A</vendor>
                <property name="Remark"></property>
                          <price>11.95</price>
        </product>
        <product productID="C349K6">
                    <productName>Sumatra</productName>
                <vendor>Hig S.A</vendor>
                <price>12.5</price>
        </product>
    </catalog>
</catalogs>
 
my xsd is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
         
        <xsd:element name="product">
                <xsd:complexType>
                        <xsd:sequence>
                                <!-- Definicion de los elementos nombre y precio -->
                                <xsd:element name="productName" type="xsd:string" />
                                <xsd:element name="vendor" type="xsd:string" />
                                <xsd:element ref="property" minOccurs="0" maxOccurs="1"/>
                                <xsd:element name="price" type="xsd:double" />
                        </xsd:sequence>
                        <xsd:attribute name="productID" type="xsd:string" use="required" />
                </xsd:complexType>
        </xsd:element>
        
        <xsd:element name="property">
                <xsd:complexType>
                        <xsd:attribute name="name" type="xsd:string" use="optional"
fixed="Remark"/>
                </xsd:complexType>
        </xsd:element>

        <xsd:element name="catalog">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="description" type="xsd:string" minOccurs="0"
maxOccurs="1"/>
                                <xsd:element ref="product" minOccurs="1" maxOccurs="unbounded"/>
                        </xsd:sequence>
                        <xsd:attribute name="catalogID" type="xsd:string" use="required" />
                        <xsd:attribute name="name" type="xsd:string" />
                </xsd:complexType>
        </xsd:element>

        <xsd:element name="catalogs">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element ref="catalog" minOccurs="1" maxOccurs="unbounded"/>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
</xsd:schema>

When do I create a new product? thanks very much
-- 
View this message in context: http://www.nabble.com/create-a-new-nodo-tf3890460.html#a11028566
Sent from the java.net - jaxb users mailing list archive at Nabble.com.