Skip to content

Instantly share code, notes, and snippets.

@mamund mamund/uber-doc.xml
Last active Aug 29, 2015

Embed
What would you like to do?
parsing an UBER doc
<data id="user01" name="user"> <!-- URL=false + innerText=false + children=true + parent=false, so this is a container that belongs to the document -->
<data name="actions"> <!-- URL=false + innerText=false + children=true + parent=true, so this is a container that belongs to "user01" -->
<data rel="item" url="/user/1" action="read" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belongs to "user01/actions" -->
<data rel="/rels/replace" url="user/1" action="replace" template="#userUpdate" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions"-->
<data rel="/rels/delete" url="user/1" action="remove" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions" -->
<data rel="/rels/suspend" url="/suspendUser/{id}" action="append" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions" -->
<data rel="/rels/addEmail" url="/user/1?addEmail" action="append" model="{email}" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01/actions" -->
<data rel="related" url="http://example.org/blogs/user01" action="read">Visit my blog</data> <!-- URL=true + innerText=true + children=false + parent=true, so this is a transition (with annotation text) that belongs to "user01/actions" -->
</data>
<data name="properties"> <!-- URL=false + innerText=false + children=true + parent=true, so this is a container belongs to "user01"-->
<data name="givenName">mike</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01/properties"-->
<data name="faimlyName">amundsen</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01/properties" -->
<data name="email">m...@example.org</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01/properties" -->
</data>
</data>
@benhamill

This comment has been minimized.

Copy link

commented Mar 17, 2014

An alternative way to render this same data (right?):

<data id="user01" name="user" rel="item" url="/user/1" action="read"> <!-- URL=true + innerText=false + children=true + parent=false, so this is a container that belongs to the document as well as a transition --> 
  <data rel="/rels/replace" url="user/1" action="replace" template="#userUpdate" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01"-->
  <data rel="/rels/delete" url="user/1" action="remove" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01" -->
  <data rel="/rels/suspend" url="/suspendUser/{id}" action="append" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01" -->
  <data rel="/rels/addEmail" url="/user/1?addEmail" action="append" model="{email}" /> <!-- URL=true + innerText=false + children=false + parent=true, so this is a transition that belowngs to "user01" -->
  <data rel="related" url="http://example.org/blogs/user01" action="read">Visit my blog</data> <!-- URL=true + innerText=true + children=false + parent=true, so this is a transition (with annotation text) that belongs to "user01" -->

  <data name="givenName">mike</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01"-->
  <data name="faimlyName">amundsen</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01" -->
  <data name="email">m...@example.org</data> <!-- URL=false + innerText=true + children=false + parent=true, so this is a data element that belongs to "user01" -->
</data>
@mamund

This comment has been minimized.

Copy link
Owner Author

commented Mar 17, 2014

yep - this is a totally fine representation of the same data. my goal is to design UBER such that it allows differences like this w/o problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.