gpt4 book ai didi

org.apache.cxf.helpers.XMLUtils类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:19:40 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.cxf.helpers.XMLUtils类的一些代码示例,展示了XMLUtils类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUtils类的具体详情如下:
包路径:org.apache.cxf.helpers.XMLUtils
类名称:XMLUtils

XMLUtils介绍

暂无

代码示例

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static Element createElementNS(Document root, QName name) {
  return createElementNS(root, name.getNamespaceURI(), name.getLocalPart());
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static Document parse(InputSource is) throws ParserConfigurationException, SAXException,
  IOException {
  return getParser().parse(is);
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

public static QName convertStringToQName(String expandedQName) {
  return convertStringToQName(expandedQName, "");
}

代码示例来源:origin: org.apache.cxf/cxf-api

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();
  }
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static Transformer newTransformer() throws TransformerConfigurationException {
  return getTransformerFactory().newTransformer();
}
public static Transformer newTransformer(int indent) throws TransformerConfigurationException {

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

public W3CDOMStreamWriter() throws ParserConfigurationException {
  document = XMLUtils.newDocument();
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static DocumentBuilder getParser() throws ParserConfigurationException {
  return getDocumentBuilderFactory().newDocumentBuilder();
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static Text createTextNode(Node node, String data) {
  return createTextNode(node.getOwnerDocument(), data);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static Document parse(String in) throws ParserConfigurationException, SAXException, IOException {
  return parse(in.getBytes());
}

代码示例来源:origin: org.apache.cxf/cxf-api

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;
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

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();
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static Transformer newTransformer() throws TransformerConfigurationException {
  return getTransformerFactory().newTransformer();
}
public static Transformer newTransformer(int indent) throws TransformerConfigurationException {

代码示例来源:origin: org.apache.cxf/cxf-rt-core

private Document createDocument() {
  Document doc = null;
  try {
    doc = XMLUtils.newDocument();
  } catch (ParserConfigurationException e) {
    throw new RuntimeException("DOM configuration problem", e);
  }
  return doc;
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static DocumentBuilder getParser() throws ParserConfigurationException {
  return getDocumentBuilderFactory().newDocumentBuilder();
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

public static Text createTextNode(Node node, String data) {
  return createTextNode(node.getOwnerDocument(), data);
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static Document parse(String in) throws ParserConfigurationException, SAXException, IOException {
  return parse(in.getBytes());
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

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;
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static Document parse(File is) throws ParserConfigurationException, SAXException,
  IOException {
  return getParser().parse(is);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static QName convertStringToQName(String expandedQName) {
  return convertStringToQName(expandedQName, "");
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

public static Element createElementNS(Document root, QName name) {
  return createElementNS(root, name.getNamespaceURI(), name.getLocalPart());
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com