findnodes only looks at immediate children
authorJason Etheridge <jason@esilibrary.com>
Tue, 19 Aug 2008 05:56:16 +0000 (05:56 +0000)
committerJason Etheridge <jason@esilibrary.com>
Tue, 19 Aug 2008 05:56:16 +0000 (05:56 +0000)
unicorn_patron_xml2text.pl

index be22309..fcaaedf 100755 (executable)
@@ -110,7 +110,8 @@ for my $patron ( $doc->documentElement->childNodes ) {
 
     my $inactive_barcode1 = '';
     my $inactive_barcode2 = '';
-    for my $i_bc ( $patron->findnodes( "barcode" ) ) {
+    my @barcodes = $patron->findnodes( "barcodes" );
+    for my $i_bc ( $barcodes[0]->findnodes( "barcode" ) ) {
         my $active = $i_bc->getAttribute('active');
         if ($active eq "0") {
             if (! $inactive_barcode1 ) {