You are here

function patterns_from_source in Patterns 5

Same name and namespace in other branches
  1. 6.2 patterns.module \patterns_from_source()
  2. 6 patterns.module \patterns_from_source()

Create a pattern from an XML data source

1 call to patterns_from_source()
patterns_load_xml in ./patterns.module

File

./patterns.module, line 719
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_from_source($xml) {
  $parse = xml_parser_create();
  xml_parse_into_struct($parse, $xml, $vals, $index);

  // Create a multi-dimensional array representing the XML structure
  $pattern = current(_patterns_parse_tag($vals, 0));
  return $pattern;
}