Skip to content

Instantly share code, notes, and snippets.

@dwcramer
Created September 19, 2012 16:37
Show Gist options
  • Save dwcramer/3750661 to your computer and use it in GitHub Desktop.
Save dwcramer/3750661 to your computer and use it in GitHub Desktop.
Turtles...
From this:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<resources base="http://localhost:9999/">
<resource type="#anyGet" path="{any}" bar="blaz">
<param type="xs:string" style="template" name="any"/>
</resource>
</resources>
<resource_type id="anyGet">
<method name="GET"/>
<resource type="#anyGet2" path="{any}">
<param type="xs:string" style="template" name="any" foo="wooga1"/>
</resource>
</resource_type>
<resource_type id="anyGet2">
<method name="GET"/>
<resource type="#anyGet" path="{any}">
<param type="xs:string" style="template" name="any" foo="wooga2"/>
</resource>
</resource_type>
</application>
We get this:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<resources base="http://localhost:9999/">
<resource path="{any}" id="rax-_any_-0">
<param xmlns:rax="http://docs.rackspace.com/api" type="xs:string" style="template"
name="any"/>
<method name="GET"/>
<resource xmlns:rax="http://docs.rackspace.com/api" path="{any}" id="rax-_any_-1">
<param type="xs:string" style="template" name="any"/>
<method name="GET"/>
<resource rax:nextTurtle="rax-_any_-1" path="{any}" id="rax-_any_-2">
<param type="xs:string" style="template" name="any"/>
</resource>
</resource>
</resource>
</resources>
<resource_type id="anyGet">
<method name="GET"/>
<resource type="#anyGet2" path="{any}">
<param type="xs:string" style="template" name="any"/>
</resource>
</resource_type>
<resource_type id="anyGet2">
<method name="GET"/>
<resource type="#anyGet" path="{any}">
<param type="xs:string" style="template" name="any"/>
</resource>
</resource_type>
</application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment