Skip to content

Instantly share code, notes, and snippets.

View helderdarocha's full-sized avatar

Helder da Rocha helderdarocha

View GitHub Profile
@helderdarocha
helderdarocha / example.svg
Last active August 29, 2015 14:00
SVG example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<query_results>
<row id="1">
<distance>.1..</distance>
<post_title>.1..</post_title>
<post_excerpt>..1.</post_excerpt>
<ID>.1..</ID>
</row>
<row id="2">
<distance>.2..</distance>
<post_title>..2.</post_title>
@helderdarocha
helderdarocha / SAX XML Schema processing
Created February 3, 2014 20:24
Example processing a simple XML schema in SAX and generating a tree
public class SAXReaderExample {
public static final String PATH = "/tmp/resources";
public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader reader = sp.getXMLReader();
reader.setContentHandler(new SchemaSaxHandler());
reader.parse(new InputSource(new FileInputStream(new File(PATH, "source.xsd"))));
<!-- Highlight syntax for Mou.app, insert at the bottom of the markdown document -->
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/github.min.css">
<script>
hljs.initHighlightingOnLoad();
</script>