Hi
I want to validate my xml file during unmarshalling. In my mapping file i have:
<class name="com.bzwbk.ewnioski.configuration.Brand">
        <map-to xml="brand"/>
        <field name="name">
            <bind-xml name="name" node="attribute"/>
        </field>
        <field name="parser" type="com.organization.ewnioski.configuration.parsers.BrandParser ">
            <bind-xml name="parser" node="element"/>
        </field>
</class>

com.organization.ewnioski.configuration.parsers.BrandParser is an interface and in my xml file i have the following:
<brand name="grono">    
     <parser  xsi:type="java:com.organization.ewnioski.configuration.parsers.DefaultCobrandParser"/>
<brand>

where com.organization.ewnioski.configuration.parsers.DefaultCobrandParser is the implementation of com.organization.ewnioski.configuration.parsers.BrandParser.
Unmarshalling works fine but i would like to have my xml validated ... and i do not know how to do it.
I tried
 <xs:complexType name="brandType">      
        <xs:sequence>
            <xs:element name="parser" type="xs:anyType" ></xs:element>
        <xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
</xs:complexType>
but it doesn't work.
Can anyone help me or show me example how my schema should look like to validate my xml.
Thanks in advance
                                milus

Reply via email to