title: Android SimpleXML Deserialisation
body: <p>I am trying to create node &amp; edge objects from this graphml. I had some great advice that told me to use several packages, on further research, with it being an android implementation I went for simplexml.</p>
  
  <p><a href="http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#nested" rel="nofollow noreferrer">http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#nested</a></p>
  
  <p>I am starting with the nodes. I have created my node class:</p>
  
  <pre><code>@Root(name="node")
  public class DeserialisedNode implements Serializable {
  
      public DeserialisedNode() {
          super();
      }
  
      @Attribute(name = "id")
      private int iD;
  
      private String venueId;
      @Element(name = "name")
      private String name;
      @Element(name = "waypoint_type")
      private String type;
      @Element(name = "lat")
      private double latitude;
      @Element(name = "lon")
      private double longitude;
      @Element(name = "level_id")
      private int levelId;
      @Element(name = "on_starting_route")
      private String onStartingRoute;
      @Element(name = "on_finish_route")
      private String onFinishRoute;
  
  
      public DeserialisedNode(int iD, String name, String type, double latitude, double longitude, int levelId, String onStartingRoute, String onFinishRoute) {
          this.iD = iD;
          this.name = name;
          this.type = type;
          this.latitude = latitude;
          this.longitude = longitude;
          this.levelId = levelId;
          this.onStartingRoute = onStartingRoute;
          this.onFinishRoute = onFinishRoute;
      }
  }
  </code></pre>
  
  <p>In my mainActivity i added:</p>
  
  <pre><code> try {
              Serializer serializer = new Persister();
              AssetManager assetManager = getAssets();
              InputStream inputStream = assetManager.open("routing.xml");
              DeserialisedNode node = serializer.read(DeserialisedNode.class, inputStream);
              System.out.println("It worked! "+node.getClass().getName());
              System.out.println("It worked! "+node.getClass().getName());
          }
          catch (Exception e) {
              e.printStackTrace();
              System.out.println("error! "+e.getMessage());
          }
  </code></pre>
  
  <p>An example of the start of the xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"&gt;
    &lt;key attr.name="weight" attr.type="double" for="edge" id="weight" /&gt;
    &lt;key attr.name="edgeid" attr.type="string" for="edge" id="edgeid" /&gt;
    &lt;key attr.name="alpha" attr.type="string" for="edge" id="alpha" /&gt;
    &lt;key attr.name="intendedpathlonlat" attr.type="string" for="edge" id="intendedpathlonlat" /&gt;
    &lt;key attr.name="levelid" attr.type="string" for="edge" id="levelid" /&gt;
    &lt;key attr.name="weight" attr.type="long" for="edge" id="weight" /&gt;
    &lt;key attr.name="type" attr.type="string" for="edge" id="type" /&gt;
    &lt;key attr.name="relatedroutes" attr.type="string" for="node" id="relatedroutes" /&gt;
    &lt;key attr.name="description" attr.type="string" for="node" id="description" /&gt;
    &lt;key attr.name="title" attr.type="string" for="node" id="title" /&gt;
    &lt;key attr.name="on_finish_route" attr.type="string" for="node" id="on_finish_route" /&gt;
    &lt;key attr.name="on_starting_route" attr.type="string" for="node" id="on_starting_route" /&gt;
    &lt;key attr.name="level_id" attr.type="string" for="node" id="level_id" /&gt;
    &lt;key attr.name="waypoint_type" attr.type="string" for="node" id="waypoint_type" /&gt;
    &lt;key attr.name="name" attr.type="string" for="node" id="name" /&gt;
    &lt;key attr.name="lon" attr.type="string" for="node" id="lon" /&gt;
    &lt;key attr.name="lat" attr.type="string" for="node" id="lat" /&gt;
    &lt;graph edgedefault="directed" id="new id here"&gt;
      &lt;node id="L08-022"&gt;
        &lt;data key="lat"&gt;30.69330963&lt;/data&gt;
        &lt;data key="lon"&gt;-53.98752537&lt;/data&gt;
        &lt;data key="name" /&gt;
        &lt;data key="waypoint_type"&gt;escalator&lt;/data&gt;
        &lt;data key="level_id"&gt;1080000&lt;/data&gt;
        &lt;data key="on_starting_route" /&gt;
        &lt;data key="on_finish_route" /&gt;
      &lt;/node&gt;
      &lt;node id="L08-023"&gt;
        &lt;data key="lat"&gt;30.69318355&lt;/data&gt;
        &lt;data key="lon"&gt;-53.98755793&lt;/data&gt;
        &lt;data key="name" /&gt;
        &lt;data key="waypoint_type"&gt;stairs&lt;/data&gt;
        &lt;data key="level_id"&gt;1080000&lt;/data&gt;
        &lt;data key="on_starting_route" /&gt;
        &lt;data key="on_finish_route" /&gt;
      &lt;/node&gt;
  etc......
  </code></pre>
  
  <p>My Error is:</p>
  
  <pre><code>W/System.err: org.simpleframework.xml.core.AttributeException: Attribute 'schemaLocation' does not have a match in class com.app.model.maps.DeserialisedNode at line 2
  </code></pre>
  
  <p>I need to get the node and edge data out.</p>