public static Element createElementNS(Document root, QName name) { return createElementNS(root, name.getNamespaceURI(), name.getLocalPart()); }
public static Document parse(InputSource is) throws ParserConfigurationException, SAXException, IOException { return getParser().parse(is); }
public static QName convertStringToQName(String expandedQName) { return convertStringToQName(expandedQName, ""); }
public static void generateXMLFile(Element element, Writer writer) { try { Transformer it = newTransformer(); it.setOutputProperty(OutputKeys.METHOD, "xml"); it.setOutputProperty(OutputKeys.INDENT, "yes"); it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); it.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); it.transform(new DOMSource(element), new StreamResult(writer)); } catch (Exception e) { e.printStackTrace(); } }
public static Transformer newTransformer() throws TransformerConfigurationException { return getTransformerFactory().newTransformer(); } public static Transformer newTransformer(int indent) throws TransformerConfigurationException {
public W3CDOMStreamWriter() throws ParserConfigurationException { document = XMLUtils.newDocument(); }
public static DocumentBuilder getParser() throws ParserConfigurationException { return getDocumentBuilderFactory().newDocumentBuilder(); }
public static Text createTextNode(Node node, String data) { return createTextNode(node.getOwnerDocument(), data); }
public static Document parse(String in) throws ParserConfigurationException, SAXException, IOException { return parse(in.getBytes()); }
public OutTransformWriter(XMLStreamWriter writer, Map<String, String> outEMap, Map<String, String> append, List<String> dropEls, Map<String, String> outAMap, boolean attributesToElements, String defaultNamespace) { super(writer); elementsMap = new QNamesMap(outEMap == null ? 0 : outEMap.size()); attributesMap = new QNamesMap(outAMap == null ? 0 : outAMap.size()); TransformUtils.convertToQNamesMap(outEMap, elementsMap, nsMap); TransformUtils.convertToQNamesMap(outAMap, attributesMap, null); TransformUtils.convertToMapOfElementProperties(append, appendMap); dropElements = XMLUtils.convertStringsToQNames(dropEls); this.attributesToElements = attributesToElements; namespaceContext = new DelegatingNamespaceContext( writer.getNamespaceContext(), nsMap); this.defaultNamespace = defaultNamespace; }
public static void generateXMLFile(Element element, Writer writer) { try { Transformer it = newTransformer(); it.setOutputProperty(OutputKeys.METHOD, "xml"); it.setOutputProperty(OutputKeys.INDENT, "yes"); it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); it.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); it.transform(new DOMSource(element), new StreamResult(writer)); } catch (Exception e) { e.printStackTrace(); } }
public static Transformer newTransformer() throws TransformerConfigurationException { return getTransformerFactory().newTransformer(); } public static Transformer newTransformer(int indent) throws TransformerConfigurationException {
private Document createDocument() { Document doc = null; try { doc = XMLUtils.newDocument(); } catch (ParserConfigurationException e) { throw new RuntimeException("DOM configuration problem", e); } return doc; }
public static DocumentBuilder getParser() throws ParserConfigurationException { return getDocumentBuilderFactory().newDocumentBuilder(); }
public static Text createTextNode(Node node, String data) { return createTextNode(node.getOwnerDocument(), data); }
public static Document parse(String in) throws ParserConfigurationException, SAXException, IOException { return parse(in.getBytes()); }
public OutTransformWriter(XMLStreamWriter writer, Map<String, String> outEMap, Map<String, String> append, List<String> dropEls, Map<String, String> outAMap, boolean attributesToElements, String defaultNamespace) { super(writer); elementsMap = new QNamesMap(outEMap == null ? 0 : outEMap.size()); attributesMap = new QNamesMap(outAMap == null ? 0 : outAMap.size()); TransformUtils.convertToQNamesMap(outEMap, elementsMap, nsMap); TransformUtils.convertToQNamesMap(outAMap, attributesMap, null); TransformUtils.convertToMapOfElementProperties(append, appendMap); dropElements = XMLUtils.convertStringsToQNames(dropEls); this.attributesToElements = attributesToElements; namespaceContext = new DelegatingNamespaceContext( writer.getNamespaceContext(), nsMap); this.defaultNamespace = defaultNamespace; }
public static Document parse(File is) throws ParserConfigurationException, SAXException, IOException { return getParser().parse(is); }
public static QName convertStringToQName(String expandedQName) { return convertStringToQName(expandedQName, ""); }
public static Element createElementNS(Document root, QName name) { return createElementNS(root, name.getNamespaceURI(), name.getLocalPart()); }