# NULL values are ignored, but having one helps pointing out that
# the array given is non-associative
-$doc = process_file('../xml/clone.xml', array(
+$doc = XML_Template_process_file('../xml/clone.xml', array(
'color' => 'blue',
'#things' => array(NULL)
), true);
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/clone.xml', array(
+$doc = XML_Template_process_file('../xml/clone.xml', array(
'color' => 'red',
'#things' => array(
array( 'li' => 'Raindrops on roses', 'li/class' => 'odd' ),
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/clone.xml', array(
+$doc = XML_Template_process_file('../xml/clone.xml', array(
'color' => 'blue',
'#things' => XML_Template_alternate('li/class', array(
array( 'li' => 'Raindrops on roses' ),
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/clone.xml', array(
+$doc = XML_Template_process_file('../xml/clone.xml', array(
'color' => 'blue',
'#things' => XML_Template_alternate('li/class', array(
array( 'li' => 'Raindrops on roses' ),
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/clone.xml', array(
+$doc = XML_Template_process_file('../xml/clone.xml', array(
'color' => 'blue',
'#things' => array(
array( 'li' => 'Raindrops on roses' ),
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/included.xml', array(
+$doc = XML_Template_process_file('../xml/included.xml', array(
'color' => 'red'
), 0);
-$master = process_file('../xml/master.xml', array(
+$master = XML_Template_process_file('../xml/master.xml', array(
'title' => 'Main HTML title',
'h1' => 'Nice heading here',
'contents' => $doc
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/namespace.xml', array(
+$doc = XML_Template_process_file('../xml/namespace.xml', array(
'title' => 'Namespace tests',
'#hello' => 'Hello world!',
'#test' => 'Replaced.',
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/namespace2.xml', array(
+$doc = XML_Template_process_file('../xml/namespace2.xml', array(
'title' => 'Namespace tests',
'#hello' => 'Replaced.',
), true);
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/passthru.xml', array(), true);
+$doc = XML_Template_process_file('../xml/passthru.xml', array(), true);
output_to_fd_and_free($doc, 1);
?>
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/simple.xml', array(
+$doc = XML_Template_process_file('../xml/simple.xml', array(
'title' => 'A very basic example',
'#hello' => 'Hello world!'
), true);
<?php
dl("XML_Template_SWIG.so");
-$doc = process_file('../xml/structure.xml', array(
+$doc = XML_Template_process_file('../xml/structure.xml', array(
'#outer' => array(
array( '#inner' => 'One' ),
array( '#inner' => 'Two' ),
return NULL;
}
+xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean)
+{
+ xmlDocPtr ret = process_file(input_filename, root_directive, clean);
+ delete root_directive;
+ return ret;
+}
+
%}
%typemap(in) Directive* {
$1 = convert_php_objects_to_directive(*$input);
}
-xmlDocPtr process_file(const char *input_filename, Directive *root_directive, bool clean);
+xmlDocPtr XML_Template_process_file(const char *input_filename, Directive *root_directive, bool clean);
void output_to_fd_and_free(xmlDocPtr doc, int fd);