xsd - xml schema : how to create element with string pcdata and one attribute -


i trying create simple element , not able define way had wanted in schema. (i'm using oxygen edit schema, , going fact giving me errors when trying define element)

i want create element this:

<sc:col-hd id="1">col hd name</sc:col-hd> 

but i'm not able define in schema. ended doing creating element 2 @atts, so:

<sc:col-hd id="1" col-name="bean"/> 

and def this:

        <xsd:element name="col-hd" maxoccurs="unbounded">              <xsd:complextype>                 <xsd:attribute name="id" type="xsd:int"/>                 <xsd:attribute name="col-name" type="xsd:string"/>             </xsd:complextype>         </xsd:element>         

but if wanted define in first example, how that? xsd:simplecontent allowable element before atts (according oxygen), that, according error has have base points complex type.

there has way define element in first example. second compromise ok me, it's bugging me can't find way in first example.

thanks.

an xsd:simplecontent can extend simple type, following should need:

    <xsd:element name="col-hd" maxoccurs="unbounded">          <xsd:complextype>             <xsd:simplecontent>                 <xsd:extension base="xsd:string">                     <xsd:attribute name="id" type="xsd:int"/>                 </xsd:extension>             </xsd:simplecontent>         </xsd:complextype>     </xsd:element>         

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -