function patterns_from_source in Patterns 6
Same name and namespace in other branches
- 5 patterns.module \patterns_from_source()
- 6.2 patterns.module \patterns_from_source()
Create a pattern from an XML data source
2 calls to patterns_from_source()
File
- ./
patterns.module, line 1202 - Enables extremely simple adding/removing features to your site with minimal to no configuration
Code
function patterns_from_source($xml) {
$parse = drupal_xml_parser_create($xml);
xml_parser_set_option($parse, XML_OPTION_CASE_FOLDING, 0);
if (!xml_parse_into_struct($parse, $xml, $vals, $index)) {
return false;
}
// Create a multi-dimensional array representing the XML structure
$pattern = current(_patterns_parse_tag($vals));
return $pattern;
}