Skip to content

Commit

Permalink
Port pull request for issue #68 to Saxon 9.3, Allow multiple saxon pr…
Browse files Browse the repository at this point in the history
…ocessors to be used
  • Loading branch information
ndw committed Jan 29, 2013
1 parent e31d7d5 commit c1ce4ef
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/com/xmlcalabash/util/TypeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public class TypeUtils {
private static final QName err_XD0045 = new QName(XProcConstants.NS_XPROC_ERROR, "XD0045");

private static int anonTypeCount = 0;
private static ItemTypeFactory typeFactory = null;
private static Hashtable<QName, ItemType> types = null;

public static QName generateUniqueType(String baseName) {
anonTypeCount++;
Expand Down Expand Up @@ -92,22 +90,14 @@ public static void checkType(XProcRuntime runtime, String value, QName type, Xdm
return;
}

if (typeFactory == null) {
typeFactory = new ItemTypeFactory(runtime.getProcessor());
types = new Hashtable<QName,ItemType> ();
}
ItemTypeFactory typeFactory = new ItemTypeFactory(runtime.getProcessor());

ItemType itype = null;

if (types.containsKey(type)) {
itype = types.get(type);
} else {
try {
itype = typeFactory.getAtomicType(type);
} catch (SaxonApiException sae) {
throw new XProcException("Unexpected type: " + type);
}
types.put(type,itype);
try {
itype = typeFactory.getAtomicType(type);
} catch (SaxonApiException sae) {
throw new XProcException("Unexpected type: " + type);
}

// FIXME: There's probably a less expensive expensive way to do this
Expand Down

0 comments on commit c1ce4ef

Please sign in to comment.