- if (c.keys[i] == null) continue;
- if (c.keys[i].endsWith(":image")) {
- String uri = (String)c.urimap.get(c.keys[i].substring(0, c.keys[i].indexOf(':')));
- c.keys[i] = c.keys[i].substring(c.keys[i].lastIndexOf(':') + 1);
- c.vals[i] = uri + "." + c.vals[i];
- }
- if ((c.keys[i].equals("preapply") || c.keys[i].endsWith(":preapply")) && c.localName.equals("template")) {
- String uri = "";
- if (c.keys[i].endsWith(":preapply")) {
- uri = "." + c.urimap.get(c.keys[i].substring(0, c.keys[i].indexOf(':')));
- c.keys[i] = c.keys[i].substring(c.keys[i].lastIndexOf(':') + 1);
- }
+ if (c.keys[i] == null) throw new RuntimeException("XML parser returned a null key position="+i);
+ if (c.keys[i].equals("font") && c.uris[i] != null) c.vals[i] = c.uris[i] + "." + c.vals[i];
+ if (c.keys[i].equals("preapply")) {
+ // process preapply and 'remove' from array
+ String uri = c.uris[i] == null ? "" : c.uris[i] + '.';