2 Replies Latest reply on Apr 18, 2014 9:04 AM by User772606-Oracle

    How to restrict max children for a node containing different node types




      I have the following XML:

          <category id="hsp">
              <cardUsage id="hsp.approvals">
                  <tabUsage id="hsp.approvals.puListing"/>
                  <tabUsage id="hsp.approvals.puDashboard"/>
              <cardClusterUsage id="hsp.someCluster">
                  <cardUsage id="hsp.someCluster.approvals"/>
          <category  id="psb">
          <category  id="pfp">
          <category  id="cx">


      I need to put a restriction that node category cannot have more than 16 children (cardUsage nodes + cardClusterUsage nodes).


      The way I was thinking to achieve this is, use a new node Usage as child of category. I could set maxOccurs on Usage to 16. And then in Usage use the xs:choice to choose between cardUsage and cardClusterUsage. And setting the maxOccurs to 1.


      Please let me know if there is a better way to do this. Or you see any flaws in my proposal.


      Thanks for you time in advance,