Re: Newb Q: How define element in XML Schema which forces it to be empty?

Discussion in 'XML' started by gabriel, Jun 25, 2003.

  1. gabriel

    gabriel Guest

    Try this:

    <?xml version="1.0">
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" attributeFormDefault="unqualified">

    <xs:element name="myEmptyElement">
    <xs:complexType></xs:complexType>
    </xs:element>
    </xs:schema>



    "Rich Weed" <> skrev i meddelandet
    news:Xns93A3DA691C76BweedrichardNOhotmSPA@24.24.2.166...
    > I currently set the type to xs:string and length to 0. Is this the proper
    > way to define an element so that it must be empty if it's present?
    >
    > --
    >
    > Remove NO SPAM to reply
     
    gabriel, Jun 25, 2003
    #1
    1. Advertising

  2. gabriel

    Nobody Guest

    ok, thanks!

    "gabriel" <> wrote in
    news:HadKa.38$-ip.net:

    > Try this:
    >
    > <?xml version="1.0">
    > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    > elementFormDefault="qualified" attributeFormDefault="unqualified">
    >
    > <xs:element name="myEmptyElement">
    > <xs:complexType></xs:complexType>
    > </xs:element>
    > </xs:schema>
    >
    >
    >
    > "Rich Weed" <> skrev i meddelandet
    > news:Xns93A3DA691C76BweedrichardNOhotmSPA@24.24.2.166...
    >> I currently set the type to xs:string and length to 0. Is this the
    >> proper way to define an element so that it must be empty if it's
    >> present?
    >>
     
    Nobody, Jun 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page