function biblio_xml_export in Bibliography Module 6
Same name and namespace in other branches
- 6.2 includes/biblio_xml.inc \biblio_xml_export()
- 7 includes/biblio_xml.inc \biblio_xml_export()
- 7.2 includes/biblio.xml.inc \biblio_xml_export()
Parameters
$result:
Return value
unknown_type
File
- ./
biblio_xml.inc, line 28
Code
function biblio_xml_export($result) {
set_time_limit(300);
$nid = 0;
$dom = new DOMDocument('1.0', 'UTF-8');
$biblio_collection = $dom
->appendChild(new DOMElement('biblio_collection'));
$biblio_collection
->setAttribute("Schema", "6010");
$comment = $biblio_collection
->appendChild(new DOMComment('Generated by the Biblio module from Drupal (http://drupal.org/project/biblio)'));
$db_result = db_query("SELECT nr.nid, nr.vid FROM {node_revisions} nr join node n on nr.nid=n.nid where n.type='biblio' order by nr.nid, nr.vid");
while ($n = db_fetch_object($db_result)) {
$node = node_load($n->nid, $n->vid);
if ($n->nid == $nid) {
$revision = $domnode
->appendChild(new DOMElement('revision'));
$node = (array) $node;
AtoX($node, $dom, $revision);
}
else {
$domnode = $biblio_collection
->appendChild(new DOMElement('node'));
$node = (array) $node;
AtoX($node, $dom, $domnode);
}
$nid = $n->nid;
}
return $dom
->saveXML();
}