summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2010-04-20 01:00:23 (GMT)
committerDavid A. Madore <david+git@madore.org>2010-04-20 01:00:23 (GMT)
commit4219f38709cde6726169749de7c2672960f38f11 (patch)
treed312a80624fd30b0aa475f57d4fa89dcd1c4a262
parentb67cab11ed1f8271a1157f6fc376d90de2b1cfb3 (diff)
downloadblogengine-4219f38709cde6726169749de7c2672960f38f11.zip
blogengine-4219f38709cde6726169749de7c2672960f38f11.tar.gz
blogengine-4219f38709cde6726169749de7c2672960f38f11.tar.bz2
Minimal modification to make some sense of namespaced daml.HEADmaster
Unfortunately, this is not really satisfactory: entry XML will be stored in database with no prefix declarations. But XML::LibXML / libxml2 limitations with namespace declarations make it very hard to work around (and I can't drop XML::Xerces as replacement, because it has no XPath).
-rwxr-xr-xinsert-entries.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/insert-entries.pl b/insert-entries.pl
index fe46de8..71f4dbd 100755
--- a/insert-entries.pl
+++ b/insert-entries.pl
@@ -117,7 +117,7 @@ sub get_node_lang {
my $xpc = XML::LibXML::XPathContext->new($doc);
#$xpc->registerNs('h', XHTML_NS);
-my $entry_list = $xpc->findnodes("//weblog/entry");
+my $entry_list = $xpc->findnodes("//d:weblog/d:entry");
foreach my $node ( $entry_list->get_nodelist ) {
my $id = $node->getAttribute("number")+0;
my $date = $node->getAttribute("date");
@@ -129,7 +129,7 @@ foreach my $node ( $entry_list->get_nodelist ) {
$sth_check->execute($id);
my $exists = $sth_check->rows;
next if $exists && ($sth_check->fetchrow_array)[0] eq $sha1;
- my $title_node = ($xpc->findnodes("title", $node))[0];
+ my $title_node = ($xpc->findnodes("d:title", $node))[0];
my $title = defined($title_node)?$title_node->textContent:undef;
my $title_xml = defined($title_node)?$title_node->serialize:undef;
my $cdate;