Two-step (indirect) recursion in XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgassmann
    New Member
    • Nov 2013
    • 1

    Two-step (indirect) recursion in XML

    I am trying to implement a schema for a block-structured matrix. The simplified version might look like this:

    <matrix numberOfRows="1 0" numberOfCols="2 0"> <blocks numberOfBlocks= "4"> <colOffsets numberOfEl="2"> <el> 0 </el> <el> 12 </el> </colOffsets> <rowOffsets numberOfEl="2"> <el> 0 </el> <el> 6 </el> </rowOffsets> <block blockRowIdx="0" blockColIdx="0" > <elements> <start numberOfEl="13" >...</start> <nonzeroes numberOfEl="20" > <indexes>...</indexes> <values>...</values> </nonzeroes> </elements> </block> <colOffsets numberOfEl="3"> <el> 0 </el> <el> 2 </el> <el> 5 </el> </colOffsets> <rowOffsets numberOfEl="3"> <el> 0 </el> <el> 2 </el> <el> 4 </el> </rowOffsets> <block>...</block> <block>...</block> <block>...</block> </blocks> </block> </blocks> </matrix>

    This is clearly recursive, but it is a two-step recursion (<blocks> nested inside <block> inside <blocks> etc.) The examples I found on the net involve one-step recursion only. I'd imagine that my approach must be expressible in a schema, but I have no idea where to start.

    Thanks
Working...