Permalink
Browse files

move cdata example from readme to examples folder

  • Loading branch information...
1 parent f80ddba commit dc6c1e311d7eef24a78bae0c7423274806c7db14 @defunctzombie defunctzombie committed Jan 3, 2013
Showing with 18 additions and 21 deletions.
  1. +3 −21 README.md
  2. +15 −0 examples/cdata.js
View
24 README.md
@@ -26,34 +26,16 @@ var child = children[0];
console.log(child.attr('foo').value()); // prints "bar"
```
-CDATA Example:
-
-```javascript
-var libxml = require('libxmljs');
-
-var doc = libxml.Document();
-var elem = doc.node('name1');
-var newChild = libxml.Element(doc, 'new-child');
-elem.addChild(newChild);
-
-var child1 = elem.node('child1');
-var child2 = elem.node('child2', 'second');
-var newChild = libxml.Element(doc, 'new-child');
-var name2 = elem.node('name2');
-name2.addChild(newChild);
-child2.cdata('<h1>cdata test</h1>').cdata('<p>It\'s worked</p>').cdata('<hr/>All done');
-
-console.log('Document with CDATA: %s', doc.toString());
-```
-
## Basics
* Docs - [http://github.com/polotek/libxmljs/wiki](http://github.com/polotek/libxmljs/wiki)
* Mailing list - [http://groups.google.com/group/libxmljs](http://groups.google.com/group/libxmljs)
## API and Examples
-Check out the wiki [http://github.com/polotek/libxmljs/wiki](http://github.com/polotek/libxmljs/wiki)
+Check out the wiki [http://github.com/polotek/libxmljs/wiki](http://github.com/polotek/libxmljs/wiki).
+
+See the [examples](https://github.com/polotek/libxmljs/tree/master/examples) folder.
## Requirements
View
15 examples/cdata.js
@@ -0,0 +1,15 @@
+var libxml = require('../');
+
+var doc = libxml.Document();
+var elem = doc.node('name1');
+var newChild = libxml.Element(doc, 'new-child');
+elem.addChild(newChild);
+
+var child1 = elem.node('child1');
+var child2 = elem.node('child2', 'second');
+var newChild = libxml.Element(doc, 'new-child');
+var name2 = elem.node('name2');
+name2.addChild(newChild);
+child2.cdata('<h1>cdata test</h1>').cdata('<p>It\'s worked</p>').cdata('<hr/>All done');
+
+console.log('Document with CDATA: %s', doc.toString());

0 comments on commit dc6c1e3

Please sign in to comment.