Skip to content

Instantly share code, notes, and snippets.

@roolo
Created February 2, 2012 18:38
Show Gist options
  • Save roolo/1725042 to your computer and use it in GitHub Desktop.
Save roolo/1725042 to your computer and use it in GitHub Desktop.
Svg example
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="1052.4" width="744.09" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g stroke-width="24.4">
<path d="m265.71 86.648a177.14 177.14 0 1 1 -354.29 0 177.14 177.14 0 1 1 354.29 0z" fill-rule="evenodd" transform="matrix(1.6866 0 0 1.6866 223.47 216.22)" stroke="#000" fill="#fcff00"/>
<g id="fff">
<g transform="translate(24.286)" data="mailo">
<path d="m157.14 150.93a70 70 0 1 1 -140 0 70 70 0 1 1 140 0z" transform="translate(148.57 118.57)"/>
<path d="m157.14 150.93a70 70 0 1 1 -140 0 70 70 0 1 1 140 0z" transform="translate(374.29 118.57)"/>
</g>
</g>
</g>
</svg>
require 'nokogiri'
noko_doc = Nokogiri::XML ( <svg content> )
noko_doc.xpath('//path')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment