private void parseNamespaceBinding(XdmNode node) { String aname = node.getAttributeValue(_prefix); String avalue = node.getAttributeValue(_uri); nsBindings.put(aname, avalue); }
private void parseNamespaceBinding(XdmNode node) { String aname = node.getAttributeValue(_prefix); String avalue = node.getAttributeValue(_uri); nsBindings.put(aname, avalue); }
private void parseWithOption(XdmNode node) { String nameStr = node.getAttributeValue(_name); String value = node.getAttributeValue(_value); QName name = new QName(nameStr,node); options.put(name,value); }
private void parseWithOption(XdmNode node) { String nameStr = node.getAttributeValue(_name); String value = node.getAttributeValue(_value); QName name = new QName(nameStr,node); options.put(name,value); }
private void parseSystemProperty(XdmNode node) { String name = node.getAttributeValue(_name); String value = node.getAttributeValue(_value); if (name == null || value == null) { throw new XProcException("Configuration option 'default-system-property' cannot have null name or value"); } if (System.getProperty(name) == null) { System.setProperty(name, value); } }
private void parseFoProcessor(XdmNode node) { String value = node.getAttributeValue(_class_name); if (value == null) { throw new XProcException(node, "Missing required attribute: class-name"); } foProcessor = value; }
private void parseCssProcessor(XdmNode node) { String value = node.getAttributeValue(_class_name); if (value == null) { throw new XProcException(node, "Missing required attribute: class-name"); } cssProcessor = value; }
private void parseEntityResolver(XdmNode node) { String value = node.getAttributeValue(_class_name); if (value == null) { throw new XProcException(node, "Missing required attribute: class-name"); } entityResolver = value; }
private void parseExtensionFunction(XdmNode node) { String value = node.getAttributeValue(_class_name); if (value == null) { throw new XProcException(node, "Missing required attribute: class-name"); } extensionFunctions.put(value, null); }
private void parseXProcConfigurer(XdmNode node) { String value = node.getAttributeValue(_class_name); if (value == null) { throw new XProcException(node, "Missing required attribute: class-name"); } xprocConfigurer = value; }
private void parseHtmlParser(XdmNode node) { String value = node.getAttributeValue(_value); if (value == null) { throw new XProcException("Configuration option 'html-parser' cannot have null value"); } if ("validator.nu".equals(value) || "tagsoup".equals(value)) { htmlParser = value; } else { throw new XProcException("Unrecognized value in html-parser: " + value); } }
private void parseHtmlParser(XdmNode node) { String value = node.getAttributeValue(_value); if (value == null) { throw new XProcException("Configuration option 'html-parser' cannot have null value"); } if ("validator.nu".equals(value) || "tagsoup".equals(value)) { htmlParser = value; } else { throw new XProcException("Unrecognized value in html-parser: " + value); } }
private String getLang(XdmNode node) { String lang = null; while (lang == null && node.getNodeKind() == XdmNodeKind.ELEMENT) { lang = node.getAttributeValue(XProcConstants.xml_lang); node = node.getParent(); } return lang; } }
public XProcPipeline (XdmNode root) { pipeline = root; for (XdmNode node : new AxisNodes(runtime, root, Axis.CHILD, AxisNodes.PIPELINE)) { if (XProcConstants.p_input.equals(node.getNodeName())) { inputPorts.add(node.getAttributeValue(_port)); } if (XProcConstants.p_output.equals(node.getNodeName())) { outputPorts.add(node.getAttributeValue(_port)); } } } }
private String compactSchema(XdmNode doc) { if ("base64".equals(doc.getAttributeValue(_encoding))) { byte[] decoded = Base64.decode(doc.getStringValue()); String s = new String(decoded); return s; } else { return doc.getStringValue(); } }
private String getLang(XdmNode node) { String lang = null; while (lang == null && node.getNodeKind() == XdmNodeKind.ELEMENT) { lang = node.getAttributeValue(XProcConstants.xml_lang); node = node.getParent(); } return lang; } }
public XProcPipeline (XdmNode root) { pipeline = root; for (XdmNode node : new AxisNodes(runtime, root, Axis.CHILD, AxisNodes.PIPELINE)) { if (XProcConstants.p_input.equals(node.getNodeName())) { inputPorts.add(node.getAttributeValue(_port)); } if (XProcConstants.p_output.equals(node.getNodeName())) { outputPorts.add(node.getAttributeValue(_port)); } } } }
private String compactSchema(XdmNode doc) { if ("base64".equals(doc.getAttributeValue(_encoding))) { byte[] decoded = Base64.decode(doc.getStringValue()); String s = new String(decoded); return s; } else { return doc.getStringValue(); } }
private DocumentBinding readDocument(XdmNode node) { checkAttributes(node, new String[] { "href" }, false); String href = node.getAttributeValue(new QName("href")); DocumentBinding doc = new DocumentBinding(runtime, node); doc.setHref(href); for (XdmNode snode : new AxisNodes(runtime, node, Axis.CHILD, AxisNodes.PIPELINE)) { throw new IllegalArgumentException("Unexpected in document: " + snode.getNodeName()); } checkExtensionAttributes(node, doc); return doc; }
private DocumentBinding readDocument(XdmNode node) { checkAttributes(node, new String[] { "href" }, false); String href = node.getAttributeValue(new QName("href")); DocumentBinding doc = new DocumentBinding(runtime, node); doc.setHref(href); for (XdmNode snode : new AxisNodes(runtime, node, Axis.CHILD, AxisNodes.PIPELINE)) { throw new IllegalArgumentException("Unexpected in document: " + snode.getNodeName()); } checkExtensionAttributes(node, doc); return doc; }