From ea3d22741b79cc80158c4e47aab8280793ce7e7d Mon Sep 17 00:00:00 2001 From: Ian Young Date: Fri, 4 Apr 2008 16:21:20 +0000 Subject: [PATCH] Patch all entity fragment files to include an xsi:schemalocation element for the UK federation label namespace. --- build/patch_all_entities | 4 ++++ build/patch_entity.pl | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 build/patch_all_entities create mode 100644 build/patch_entity.pl diff --git a/build/patch_all_entities b/build/patch_all_entities new file mode 100755 index 00000000..b9042c2e --- /dev/null +++ b/build/patch_all_entities @@ -0,0 +1,4 @@ +#!/bin/bash + +find ../entities -name uk\*.xml \ + -exec perl -i patch_entity.pl \{\} \; diff --git a/build/patch_entity.pl b/build/patch_entity.pl new file mode 100644 index 00000000..77b15d1c --- /dev/null +++ b/build/patch_entity.pl @@ -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 $_; +} \ No newline at end of file