Permalink
Browse files

Update example.dart

add `hello.text` and attributes to `simpleHello()`
  • Loading branch information...
1 parent d0e355a commit cfbd303166a98eb752bec46a379b2649b1cc5ae3 @mibamur mibamur committed Dec 24, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 example/example.dart
View
@@ -28,9 +28,17 @@ void simpleHello(){
print('Simple XML API demonstration:');
// deserialize
- XmlElement hello = XML.parse('<hello>world</hello>');
+ XmlElement hello = XML.parse('<hello my="dear">world</hello>');
+
// serialize - in this case to console
print('$hello');
+
+ // print text inside node
+ print(hello.text);
+
+ // print attributes of current node
+ print(hello.attributes['my']);
+
print('');
}
@@ -121,4 +129,4 @@ String example =
<author>Stefan Handsomly</author>
</book>
</books>
-''';
+''';

0 comments on commit cfbd303

Please sign in to comment.