.replaceFirst("^urn:us:gov:dod:nga:def:geo-political:", "geo-political/")
.replaceFirst("^ge:", "geo-political:")
.replaceAll("/", ":");
String code = countryCode.getValue();
if (!codespace.matches("^geo-political:GENC:[23n]:ed\\d$"))
throw new InvalidDDMSException(
"ddms:countryCode must use a geo-political URN or URL, as specified in the DDMS Schematron file.");
else if (codespace.contains("GENC:3:") && !code.matches("^[A-Z]{3}$"))
throw new InvalidDDMSException(
"A GENC country code in a 3-alpha codespace (e.g. geo-political:GENC:3:ed1) must consist of exactly 3 uppercase alpha characters.");
else if (codespace.contains("GENC:2:") && !code.matches("^[A-Z]{2}$"))
throw new InvalidDDMSException(
"A GENC country code in a 2-alpha codespace (e.g. geo-political:GENC:2:ed1) must consist of exactly 2 uppercase alpha characters.");
else if (codespace.contains("GENC:n:") && !code.matches("^[0-9]{3}$"))
throw new InvalidDDMSException(
"A GENC country code in a numeric codespace (e.g. geo-political:GENC:n:ed1) must consist of exactly 3 numerals.");
}