forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47d4c88
commit 3c9c8b9
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,25 @@ LibXML bindings for [node.js](http://nodejs.org/) | |
|
||
console.log(child.attr('foo').value()); // prints "bar" | ||
|
||
CDATA Example by Dudochkin Victor <[email protected]>: | ||
|
||
var util = require('util'); | ||
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'); | ||
util.puts('Document With CDATA: ' + doc.toString()); | ||
|
||
## Basics | ||
|
||
* Docs - [http://github.com/polotek/libxmljs/wiki](http://github.com/polotek/libxmljs/wiki) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters