Skip to content
Permalink
Browse files

Merge pull request #68 from jamesrdf/multiple-saxon-processors

Allow multiple saxon processors to be used
  • Loading branch information
ndw committed Jan 28, 2013
2 parents 2877dac + aa1fb59 commit 1f22d78200216fc9e1f259caa0acd6225ec15407
Showing with 5 additions and 15 deletions.
  1. +5 −15 src/com/xmlcalabash/util/TypeUtils.java
@@ -44,8 +44,6 @@
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++;
@@ -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

0 comments on commit 1f22d78

Please sign in to comment.
You can’t perform that action at this time.