Skip to content

Instantly share code, notes, and snippets.

Robin Smidsrød robinsmidsrod

Block or report user

Report or block robinsmidsrod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robinsmidsrod
robinsmidsrod / load.pl
Created Jun 7, 2009
loader for imsmanifest.xml using XML::Toolkit::Loader
View load.pl
#!/usr/bin/perl
use strict;
use warnings;
use XML::Toolkit::Loader;
use Cwd qw(getcwd);
use lib getcwd();
my $loader = XML::Toolkit::Loader->new(
View gist:127262
package XML::Toolkit::Loader::ParserNS;
use Moose;
extends qw(XML::Toolkit::Loader::Parser);
has namespace_map => (
isa => 'HashRef',
is => 'ro',
lazy => 1,
default => sub { {} },
);
View gist:128664
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<tag id="abc">
<id>foo</id>
<id>bar</id>
</tag>
</root>
@robinsmidsrod
robinsmidsrod / gist:130108
Created Jun 15, 2009
not the right way to check type in javascript
View gist:130108
if ( ! ( typeof el === 'object' && el instanceof HTMLElement ) ) {
throw new TypeError("Argument is not a DOM node");
}
View gist:131235
#!/usr/bin/perl
use strict;
use warnings;
use XML::Toolkit::Loader;
use Data::Dumper qw(Dumper);
use Cwd qw(getcwd);
use lib getcwd();
View gist:131264
t/00.load.t ........ 1/1 # Testing XML::Toolkit 0.06
t/00.load.t ........ ok
t/01.basic.t ....... 4/? These XML namespaces have no mapping:
# Looks like your test exited with 255 just after 4.
t/01.basic.t ....... Dubious, test returned 255 (wstat 65280, 0xff00)
All 4 subtests passed
t/02.namespaced.t .. 1/? These XML namespaces have no mapping:
# Looks like your test exited with 255 just after 4.
View gist:131317
robin@server:~/ims$ cat all_in_one.pl
#!/usr/bin/perl
use strict;
use warnings;
use XML::Toolkit::Builder;
use XML::Toolkit::Loader;
use Data::Dumper qw(Dumper);
View gist:131327
#!/usr/bin/perl
use strict;
use warnings;
use XML::Toolkit::Builder;
use XML::Toolkit::Loader;
use Data::Dumper qw(Dumper);
my $filename = shift;
View gist:132702
#!/usr/bin/perl
use strict;
use warnings;
use XML::Toolkit::Builder ();
use XML::Toolkit::Loader ();
use Data::Dumper qw(Dumper);
my $xml1 = '<root xmlns="abc">test</root>';
View gist:132784
commit 5b70fa7ed266b78825dbf8d3dba65857d69fb54d
Author: Robin Smidsrød <robin@smidsrod.no>
Date: Fri Jun 19 20:47:10 2009 +0200
Tests for namespaced loading
diff --git a/t/03_1.namespaced_loading.t b/t/03_1.namespaced_loading.t
new file mode 100644
index 0000000..825cf36
--- /dev/null
You can’t perform that action at this time.