Skip to content

Instantly share code, notes, and snippets.

@polotek
Created April 12, 2010 00:17
Show Gist options
  • Save polotek/363158 to your computer and use it in GitHub Desktop.
Save polotek/363158 to your computer and use it in GitHub Desktop.
/**
* simple.tal file
<?xml version="1.0" encoding="UTF-8"?>
<div xmlns:tal="http://axiomstack.com/tale">
<p id="testing" tal:omit="true">
Hello <span tal:content="data.name"/>
You have just won $<span tal:content="data.value"/>!
<span tal:if="data.in_ca">
Well, $<span tal:content="data.taxed_value"/>, after taxes.
</span>
<foo>This is a foo node.</foo>
</p>
</div>
*/
var sys = require('sys');
var XML = require('libxmljs');
var doc = null;
function mem() {
sys.debug(sys.inspect(process.memoryUsage()));
}
mem();
doc = XML.parseXmlFile('simple.tal');
sys.puts(doc);
//xpath test
var span = doc.get('//span');
sys.puts(span.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment