Jump to content
Sign in to follow this  

Generating XML and XSD from entity-relationship diagram

Recommended Posts

Error I receive while implementing this code:

Exception: cvc-complex-type.2.4.a: Invalid content was found starting with element 'employee'. One of '{contractemployee}' is expected.

What changes shall I make in my code to correctly implement the xml document from the given image





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


<?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="catalog">
                    <xsd:element name="product" maxOccurs="unbounded" minOccurs="0">
                                <xsd:element name="productname" type="xsd:string"></xsd:element>
                                <xsd:element name="storagenumber" type="xsd:short"></xsd:element>
                                <xsd:element name="dimension">
                                            <xsd:element name="width" type="xsd:byte"></xsd:element>
                                            <xsd:element name="heigth" type="xsd:string"></xsd:element>
                                            <xsd:element name="depth" type="xsd:byte" minOccurs="0"></xsd:element>
                            <xsd:element name="description" type="xsd:string"></xsd:element>
                            <xsd:element name="supplier" type="xsd:string" maxOccurs="unbounded" minOccurs="0"></xsd:element>

Edited by Jade

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...