private void init(final ValidationContext ctx) {
if (prefix.isEmpty()) {
this.rootElement = Util.extractFirstElement(ctx.documentLines());
prefix.add(this.rootElement);
if (this.rootElement.getLocalPart().equals("domain")) {
prefix.add(new QName(this.rootElement.getNamespaceURI(), "profiles"));
}
prefix.add(new QName(this.rootElement.getNamespaceURI(), "profile"));
final String uri = this.rootElement.getNamespaceURI();
if (this.rootElement.getLocalPart().equals("server")) {
excludedRoots.add(new QName(uri, "domain"));
excludedRoots.add(new QName(uri, "host"));
} else if (this.rootElement.getLocalPart().equals("domain")) {
excludedRoots.add(new QName(uri, "server"));
excludedRoots.add(new QName(uri, "host"));
} else {
excludedRoots.add(new QName(uri, "domain"));
excludedRoots.add(new QName(uri, "server"));
}
}
}