Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update example.dart

add `hello.text` and attributes to `simpleHello()`
  • Loading branch information...
commit cfbd303166a98eb752bec46a379b2649b1cc5ae3 1 parent d0e355a
@mibamur mibamur authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 example/example.dart
View
12 example/example.dart
@@ -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>
-''';
+''';
Please sign in to comment.
Something went wrong with that request. Please try again.