Skip to content

Instantly share code, notes, and snippets.

@luniki
Created June 7, 2012 09:03
Show Gist options
  • Save luniki/2887636 to your computer and use it in GitHub Desktop.
Save luniki/2887636 to your computer and use it in GitHub Desktop.
simplexml example
<?
$xml = '<?xml version="1.0" encoding="UTF-8"?><dublincore xmlns="http://www.opencastproject.org/xsd/1.0/dublincore/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"><dcterms:format xsi:type="dcterms:IMT">video/x-dv</dcterms:format><dcterms:publisher>Stud.IP 2.4 (bender.virtuos.uos.de)</dcterms:publisher><dcterms:identifier>804ad1e40cedc06fd8ce8986385f8491</dcterms:identifier><dcterms:title xml:lang="en">Opencast-Test</dcterms:title></dublincore>';
$s = new SimpleXMLElement($xml);
var_dump($s->xpath('//dcterms:format'));
var_dump($s->xpath('//dcterms:publisher'));
var_dump($s->xpath('//dcterms:identifier'));
var_dump($s->xpath('//dcterms:title'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment