Skip to content

Commit

Permalink
Patch all entity fragment files to include an xsi:schemalocation elem…
Browse files Browse the repository at this point in the history
…ent for the UK federation label namespace.
  • Loading branch information
iay committed Apr 4, 2008
1 parent 85e820b commit ea3d227
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/patch_all_entities
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

find ../entities -name uk\*.xml \
-exec perl -i patch_entity.pl \{\} \;
13 changes: 13 additions & 0 deletions build/patch_entity.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/perl

$seen = 0;

while (<>) {
if (/^\s+http:\/\/ukfederation.org.uk\/2006\/11\/label/) {
$seen = 1; # don't apply the change twice to the same file
}
if (!$seen && /^(\s+)http:\/\/www.w3.org\/2001\/04\/xmlenc/) {
print "$1http://ukfederation.org.uk/2006/11/label uk-fed-label.xsd\n";
}
print $_;
}

0 comments on commit ea3d227

Please sign in to comment.