public XdmNode read() throws SaxonApiException { read = true; if (doc != null) { return doc; } if (nodes != null) { // Find the document element so we can get the base URI XdmNode node = null; for (int pos = 0; pos < nodes.size() && node == null; pos++) { if (((XdmNode) nodes.get(pos)).getNodeKind() == XdmNodeKind.ELEMENT) { node = (XdmNode) nodes.get(pos); } } XdmDestination dest = new XdmDestination(); try { S9apiUtils.writeXdmValue(cfgProcessor, nodes, dest, node.getBaseURI()); doc = dest.getXdmNode(); if (excludeUris.size() != 0) { doc = S9apiUtils.removeNamespaces(cfgProcessor, doc, excludeUris, true); } } catch (SaxonApiException sae) { throw new XProcException(sae); } } else { doc = readXML(href, base); } return doc; }
public XdmNode read() throws SaxonApiException { read = true; if (doc != null) { return doc; } if (nodes != null) { // Find the document element so we can get the base URI XdmNode node = null; for (int pos = 0; pos < nodes.size() && node == null; pos++) { if (((XdmNode) nodes.get(pos)).getNodeKind() == XdmNodeKind.ELEMENT) { node = (XdmNode) nodes.get(pos); } } XdmDestination dest = new XdmDestination(); try { S9apiUtils.writeXdmValue(cfgProcessor, nodes, dest, node.getBaseURI()); doc = dest.getXdmNode(); if (excludeUris.size() != 0) { doc = S9apiUtils.removeNamespaces(cfgProcessor, doc, excludeUris, true); } } catch (SaxonApiException sae) { throw new XProcException(sae); } } else { doc = readXML(href, base); } return doc; }