Arc Selection Syntax Reprise

OK, I implemented the proposed ArcPattern syntax change and decided that I didn't like it! However, I came up with an alternative that is even more expressive: introduce a specifier called arc() that acts in all ways like resource() but is to be used as the specifer in ArcPatterns. Here's how it would look:

<rt:root-template>
  <rt:for-each rt:select="~subject()">
    <rt:for-each rt:select="resource()/arc()">
      <rt:for-each rt:select="arc()/resource()">
        <rt:value-of rt:select="label()"/>
      </rt:for-each>
  </rt:for-each>
</rt:root-template>

For comparison, here's the original (i.e. current spec version):

<rt:root-template>
  <rt:for-each rt:select="~subject()">
    <rt:for-each rt:select="resource()/resource()">
      <rt:for-each rt:select="resource()/resource()">
        <rt:value-of rt:select="label()"/>
      </rt:for-each>
  </rt:for-each>
</rt:root-template>

The new way is clearer I'm sure.

Comments

No comments yet.

Leave a comment

Sorry, the comment form is closed at this time.