transformParameters.put("sequenceCounters", new HashMap<String, Integer>() ); transformParameters.put("bookmarkIdCounter", new BookmarkCounter(bookmarkId) ); BindingTraverserState bindingTraverserState = new BindingTraverserState(); transformParameters.put("bindingTraverserState", bindingTraverserState ); // new for 3.3.0 pathMap = domToXPathMap.getPathMap(); bindingTraverserState.setPathMap(pathMap);
/** * Workaround for the fact that Xalan doesn't let us pass an AtomicInteger into an extension * function. Instead, it converts it into an int, which means the object in our * bookmarkIdCounter parameter isn't updated. * * So here we wrap the AtomicInteger in a class, * * @author jharrop * */ public static class BookmarkCounter { protected AtomicInteger bookmarkId; BookmarkCounter(AtomicInteger bookmarkId) { this.bookmarkId = bookmarkId; } }
transformParameters.put("sequenceCounters", new HashMap<String, Integer>() ); transformParameters.put("bookmarkIdCounter", new BookmarkCounter(bookmarkId) ); BindingTraverserState bindingTraverserState = new BindingTraverserState(); transformParameters.put("bindingTraverserState", bindingTraverserState ); // new for 3.3.0 pathMap = domToXPathMap.getPathMap(); bindingTraverserState.setPathMap(pathMap);
if (bindingTraverserState.getPathMap()!=null ) { r = bindingTraverserState.getPathMap().get(normalisePath(xpathExp));
/** * Workaround for the fact that Xalan doesn't let us pass an AtomicInteger into an extension * function. Instead, it converts it into an int, which means the object in our * bookmarkIdCounter parameter isn't updated. * * So here we wrap the AtomicInteger in a class, * * @author jharrop * */ public static class BookmarkCounter { protected AtomicInteger bookmarkId; BookmarkCounter(AtomicInteger bookmarkId) { this.bookmarkId = bookmarkId; } }
if (bindingTraverserState.getPathMap()!=null ) { r = bindingTraverserState.getPathMap().get(normalisePath(xpathExp));