# Pile of utilty methods used accross applications.
# ---------------------------------------------------------------------------
my $cache_client = "OpenSRF::Utils::Cache";
-my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
# ---------------------------------------------------------------------------
# on sucess, returns the created session, on failure throws ERROR exception
sub marc_xml_to_doc {
my ($class, $xml) = @_;
my $marc_doc = XML::LibXML->new->parse_string($xml);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
+ $marc_doc->documentElement->setNamespace(MARC_NAMESPACE, 'marc', 1);
+ $marc_doc->documentElement->setNamespace(MARC_NAMESPACE);
return $marc_doc;
}
use OpenSRF::AppSession;
use OpenILS::Event;
my $U = 'OpenILS::Application::AppUtils';
-my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
# ---------------------------------------------------------------------------
sub marc_xml_to_doc {
my $xml = shift;
my $marc_doc = XML::LibXML->new->parse_string($xml);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1);
- $marc_doc->documentElement->setNamespace($MARC_NAMESPACE);
+ $marc_doc->documentElement->setNamespace(MARC_NAMESPACE, 'marc', 1);
+ $marc_doc->documentElement->setNamespace(MARC_NAMESPACE);
return $marc_doc;
}
use OpenSRF::AppSession;
use OpenILS::Event;
my $U = 'OpenILS::Application::AppUtils';
-my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim';
# ---------------------------------------------------------------------------
sub __make_marc_doc {
my $xml = shift;
my $marcxml = XML::LibXML->new->parse_string($xml);
- $marcxml->documentElement->setNamespace($MARC_NAMESPACE, "marc", 1 );
- $marcxml->documentElement->setNamespace($MARC_NAMESPACE);
+ $marcxml->documentElement->setNamespace(MARC_NAMESPACE, "marc", 1 );
+ $marcxml->documentElement->setNamespace(MARC_NAMESPACE);
__remove_empty_marc_nodes($marcxml);
return $marcxml;
}
sub __remove_empty_marc_nodes {
my $marcxml = shift;
- __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS($MARC_NAMESPACE, 'controlfield');
- __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS($MARC_NAMESPACE, 'subfield');
- __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS($MARC_NAMESPACE, 'datafield');
+ __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS(MARC_NAMESPACE, 'controlfield');
+ __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS(MARC_NAMESPACE, 'subfield');
+ __remove_if_childless($_) foreach $marcxml->documentElement->getElementsByTagNameNS(MARC_NAMESPACE, 'datafield');
}
sub __remove_if_childless {
econst OILS_BILLING_TYPE_NOTIFICATION_FEE => 9;
+# ---------------------------------------------------------------------
+# Non Evergreen-specific constants
+# ---------------------------------------------------------------------
+econst MARC_NAMESPACE => 'http://www.loc.gov/MARC21/slim';
+
# ---------------------------------------------------------------------
# finally, export all the constants