Advertisement

07.14.2008 at 01:21PM PDT, ID: 23564069 | Points: 500
[x]
Attachment Details

optional element in xml

Asked by edyonline in Extensible Markup Language (XML)

Tags:

how can i create xsd that describe optional element in xml. I know that if i have the following:

                        <xs:choice>
                              <xs:element ref="percent"/>
                                        <xs:element ref="name"/>
                        </xs:choice>
That means either i have xml with element percent or name. But how to make either percent or nothing?

i tried the following
                        <xs:choice>
                              <xs:element ref="percent"/>
                              <xs:sequence/>
                        </xs:choice>
and it does not work. any idea?Start Free Trial
[+][-]07.14.2008 at 11:49PM PDT, ID: 22004614

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 04:37AM PDT, ID: 22005880

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 04:49AM PDT, ID: 22005928

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628