XSD PLEASE HELP



THIS IS HOW THE XMLFILE IS

<INTRO>
<GROUPS>
<ADD1 GROUP="G1" MODE="INPROC">
</GROUPS>
<PROPERTY>
<ADD KEY="KEY3" MODE="OUTPROC">
<ADD KEY="KEY4" GROUP="G1" MODE="INPROC">
<ADD KEY="KEY2" ABS="FDG" SLI="GD">
</PROPERTY>
</INTRO>


THE PROBLEM IS
1) IN THE <PROPERTY> TAG THE USER HAS THE CHOICE TO INCLUDE GROUP NAME OR NOT FOR EACH  <ADD> ELEMENT

IF THE USER INCLUDES THE <GROUP>TAG THEN THE < MODE> SHOULD INCLUDE THE THE SAME MODE VALUE AS THE CORRESPONDING <GROUP> IN THE <GROUPS> ELEMENT


IF THE <GROUP> TAG IS NOT INCLUDEED THEN THE USER CAN USE ANY MODE HE WISHES.

2)
HOW DO WE USE THE <CHOICE> TAG FOR ATTRIBUTES

THE USER HAS THE OPTION TO EITHER <ABS> OR THE <SLI> TAG.
OR THE USE R SIMPLY DOES NOT USE EITHER.



APPRECIATE HELP ON XSD FOR THE ABOVE 2 PROBLEMS



me_newAsked:
Who is Participating?
 
Shiju SasidharanConnect With a Mentor Assoc Project ManagerCommented:
hi
i think this is the proper and easy way of handling xml nodes
it is always better to avoid attributes for a tag, instead keep them as child nodes.
putting child nodes doesnt make any overload. its easy to trace and handle

'================================
<INTRO>
<GROUPS>
      <ADD1>
            <GROUP>G1</GROUP>
            <MODE>INPROC</MODE>
      </ADD1>
</GROUPS>
<PROPERTY>
      <ADD>
            <KEY>KEY3</KEY>
            <MODE>OUTPROC</MODE>
      </ADD>
      <ADD>
            <KEY>KEY4</KEY>
            <GROUP>G1</GROUP>
            <MODE>INPROC</MODE>
      </ADD>
      <ADD>
            <KEY>KEY2</KEY>
            <ABS>FDG</ABS>
            <SLI>GD</SLI>
      </ADD>
</PROPERTY>
</INTRO>
'======================================

;-)
Shiju
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.