- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.cxf.helpers.XMLUtils.newTransformer()
方法的一些代码示例,展示了XMLUtils.newTransformer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUtils.newTransformer()
方法的具体详情如下:
包路径:org.apache.cxf.helpers.XMLUtils
类名称:XMLUtils
方法名:newTransformer
暂无
代码示例来源: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-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-common-utilities
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-common-utilities
public static String toString(Source source, Properties props) throws TransformerException, IOException {
StringWriter bos = new StringWriter();
StreamResult sr = new StreamResult(bos);
Transformer trans = newTransformer();
if (props == null) {
props = new Properties();
props.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
trans.setOutputProperties(props);
trans.transform(source, sr);
bos.close();
return bos.toString();
}
代码示例来源:origin: org.apache.cxf/cxf-api
public static String toString(Source source, Properties props) throws TransformerException, IOException {
StringWriter bos = new StringWriter();
StreamResult sr = new StreamResult(bos);
Transformer trans = newTransformer();
if (props == null) {
props = new Properties();
props.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
trans.setOutputProperties(props);
trans.transform(source, sr);
bos.close();
return bos.toString();
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static String toString(Source source, Properties props) throws TransformerException, IOException {
StringWriter bos = new StringWriter();
StreamResult sr = new StreamResult(bos);
Transformer trans = newTransformer();
if (props == null) {
props = new Properties();
props.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
}
trans.setOutputProperties(props);
trans.transform(source, sr);
bos.close();
return bos.toString();
}
代码示例来源:origin: org.apache.cxf/cxf-common-utilities
public static void writeTo(Source src,
OutputStream os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static void writeTo(Source src,
代码示例来源:origin: org.apache.cxf/cxf-api
public static void writeTo(Source src,
OutputStream os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static void writeTo(Source src,
代码示例来源:origin: org.apache.cxf/cxf-api
public static void writeTo(Source src,
Writer os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static String toString(Source source) throws TransformerException, IOException {
代码示例来源:origin: org.apache.cxf/cxf-common-utilities
public static void writeTo(Source src,
Writer os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static String toString(Source source) throws TransformerException, IOException {
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static void writeTo(Source src,
Writer os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static String toString(Source source) throws TransformerException, IOException {
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static void writeTo(Source src,
OutputStream os,
int indent,
String charset,
String omitXmlDecl) {
Transformer it;
try {
if (StringUtils.isEmpty(charset)) {
charset = "utf-8";
}
it = newTransformer(indent);
it.setOutputProperty(OutputKeys.METHOD, "xml");
if (indent > -1) {
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
Integer.toString(indent));
}
it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
it.setOutputProperty(OutputKeys.ENCODING, charset);
it.transform(src, new StreamResult(os));
} catch (TransformerException e) {
throw new RuntimeException("Failed to configure TRaX", e);
}
}
public static void writeTo(Source src,
我面临着一个非常烦人的问题,导致服务器 Java 进程终止,从这段代码中踢出(精简): _sesXslProc = new ArrayList(); TransformerFactory tFacto
我遇到一个问题,我不知道根本原因到底是什么。 我创建了 javax.xml.transform.TransformerFactory 的实例,然后直接解析 xsltSource: protected
本文整理了Java中org.apache.cxf.helpers.XMLUtils.newTransformer()方法的一些代码示例,展示了XMLUtils.newTransformer()的具体用
TransformerFactory.newInstance().newTransformer(streamSource) 怎么会返回 null。根据 javadoc 这是不可能的: http://d
Java API 保证它永远不会返回 null - 但对我来说,它是! http://download.oracle.com/javase/6/docs/api/javax/xml/transform
在 Java 中,来自 TransformerFactory用于创建对象来处理 XSLT,它具有以下方法: newTransformer 创建 Transformer 对象,可以将 XML 转换为结果
本文整理了Java中com.sun.xml.ws.util.xml.XmlUtil.newTransformer()方法的一些代码示例,展示了XmlUtil.newTransformer()的具体用法
我是一名优秀的程序员,十分优秀!