one element multiple times

Discussion in 'XML' started by Timo Nentwig, May 25, 2004.

  1. Timo Nentwig

    Timo Nentwig Guest

    Hi!

    I try to write a schema for:

    <f4t-config>
    <database>
    <jndi-url>foo</jndi-url>
    <fetch-size>100</fetch-size>
    <!-- these are the problem -->
    <query id="foo">bar</query>
    <query id="bar">foo</query>
    </database>
    </f4t-config>

    This is what is currently looks like:

    <xs:element name="f4t-config">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="database">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="jndi-url" type="xs:string"/>
    <xs:element name="fetch-size" type="xs:int" />
    <xs:element name="query" maxOccurs="unbounded">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="id" type="xs:string" use="required" />
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>


    ....but this doesn't seem to be correct (or it's problem with the JAXB
    generator...)
     
    Timo Nentwig, May 25, 2004
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.