- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sun.xml.ws.util.xml.XmlUtil
类的一些代码示例,展示了XmlUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtil
类的具体详情如下:
包路径:com.sun.xml.ws.util.xml.XmlUtil
类名称:XmlUtil
暂无
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
/**
* Creates an {@link EntityResolver} that consults {@code /WEB-INF/jax-ws-catalog.xml}.
*/
private EntityResolver createEntityResolver() {
try {
return XmlUtil.createEntityResolver(loader.getCatalogFile());
} catch (MalformedURLException e) {
throw new WebServiceException(e);
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public static QName getQName(XMLStreamReader reader, String tag){
String localName = XmlUtil.getLocalPart(tag);
String pfix = XmlUtil.getPrefix(tag);
String uri = reader.getNamespaceURI(fixNull(pfix));
return new QName(uri, localName);
}
代码示例来源:origin: com.sun.xml.ws/rt
private static void displayDOM(Node node, java.io.OutputStream ostream) {
try {
System.out.println("\n====\n");
XmlUtil.newTransformer().transform(
new DOMSource(node), new StreamResult(ostream));
System.out.println("\n====\n");
}
catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: javaee/metro-jax-ws
public void registerNamespaces(Element e) {
for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
Attr a = (Attr) iter.next();
if (a.getName().equals(PREFIX_XMLNS)) {
// default namespace declaration
_nsSupport.declarePrefix("", a.getValue());
} else {
String prefix = XmlUtil.getPrefix(a.getName());
if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
String nsPrefix = XmlUtil.getLocalPart(a.getName());
String uri = a.getValue();
_nsSupport.declarePrefix(nsPrefix, uri);
}
}
}
}
代码示例来源:origin: com.sun.xml.ws/rt
/**
* Performs identity transformation.
* @param <T>
* @param src
* @param result
* @return
* @throws javax.xml.transform.TransformerException
* @throws java.io.IOException
* @throws org.xml.sax.SAXException
* @throws javax.xml.parsers.ParserConfigurationException
*/
public static <T extends Result> T identityTransform(Source src, T result)
throws TransformerException, SAXException, ParserConfigurationException, IOException {
if (src instanceof StreamSource) {
// work around a bug in JAXP in JDK6u4 and earlier where the namespace processing
// is not turned on by default
StreamSource ssrc = (StreamSource) src;
TransformerHandler th = ((SAXTransformerFactory) transformerFactory.get()).newTransformerHandler();
th.setResult(result);
XMLReader reader = saxParserFactory.get().newSAXParser().getXMLReader();
reader.setContentHandler(th);
reader.setProperty(LEXICAL_HANDLER_PROPERTY, th);
reader.parse(toInputSource(ssrc));
} else {
newTransformer().transform(src, result);
}
return result;
}
代码示例来源:origin: com.sun.xml.ws/rt
msEpr.addr = new MemberSubmissionEndpointReference.Address();
msEpr.addr.uri = XmlUtil.getTextForNode(child);
String prefix = XmlUtil.getPrefix(service);
String name = XmlUtil.getLocalPart(service);
String prefix = XmlUtil.getPrefix(portType);
String name = XmlUtil.getLocalPart(portType);
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
/**
* Returns true if body has explicit parts declaration
*/
private static boolean parseSOAPBodyBinding(XMLStreamReader reader, Map<String, ParameterBinding> parts) {
String partsString = reader.getAttributeValue(null, "parts");
if (partsString != null) {
List<String> partsList = XmlUtil.parseTokenList(partsString);
if (partsList.isEmpty()) {
parts.put(" ", ParameterBinding.BODY);
} else {
for (String part : partsList) {
parts.put(part, ParameterBinding.BODY);
}
}
return true;
}
return false;
}
代码示例来源:origin: javaee/metro-jax-ws
public void writeTo(SOAPMessage saaj) throws SOAPException {
try {
// TODO what about in-scope namespaces
// Not very efficient consider implementing a stream buffer
// processor that produces a DOM node from the buffer.
Transformer t = XmlUtil.newTransformer();
SOAPHeader header = saaj.getSOAPHeader();
if (header == null)
header = saaj.getSOAPPart().getEnvelope().addHeader();
// TODO workaround for oracle xdk bug 16555545, when this bug is fixed the line below can be
// uncommented and all lines below, except the catch block, can be removed.
// t.transform(epr.asSource(localName), new DOMResult(header));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLStreamWriter w = XMLOutputFactory.newFactory().createXMLStreamWriter(baos);
epr.writeTo(localName, w);
w.flush();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DocumentBuilderFactory fac = XmlUtil.newDocumentBuilderFactory(false);
fac.setNamespaceAware(true);
Node eprNode = fac.newDocumentBuilder().parse(bais).getDocumentElement();
Node eprNodeToAdd = header.getOwnerDocument().importNode(eprNode, true);
header.appendChild(eprNodeToAdd);
} catch (Exception e) {
throw new SOAPException(e);
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
void addSchema(Source schema) {
assert schema.getSystemId() != null;
String systemId = schema.getSystemId();
try {
XMLStreamBufferResult xsbr = XmlUtil.identityTransform(schema, new XMLStreamBufferResult());
SDDocumentSource sds = SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer());
SDDocument sdoc = SDDocumentImpl.create(sds, new QName(""), new QName(""));
docs.put(systemId, sdoc);
nsMapping.put(((SDDocument.Schema)sdoc).getTargetNamespace(), sdoc);
} catch(Exception ex) {
LOGGER.log(Level.WARNING, "Exception in adding schemas to resolver", ex);
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-tools
@Override
protected XPathFactory initialValue() throws Exception {
return XmlUtil.newXPathFactory(true);
}
};
代码示例来源:origin: com.sun.xml.ws/jaxws-tools
public static String getRequiredAttribute(Element element, String name) {
String result = XmlUtil.getAttributeOrNull(element, name);
if (result == null)
fail(
"parsing.missingRequiredAttribute",
element.getTagName(),
name);
return result;
}
代码示例来源:origin: javaee/metro-jax-ws
public void registerNamespaces(Element e) {
for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
Attr a = (Attr) iter.next();
if (a.getName().equals(PREFIX_XMLNS)) {
// default namespace declaration
_nsSupport.declarePrefix("", a.getValue());
} else {
String prefix = XmlUtil.getPrefix(a.getName());
if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
String nsPrefix = XmlUtil.getLocalPart(a.getName());
String uri = a.getValue();
_nsSupport.declarePrefix(nsPrefix, uri);
}
}
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
msEpr.addr = new MemberSubmissionEndpointReference.Address();
msEpr.addr.uri = XmlUtil.getTextForNode(child);
String prefix = XmlUtil.getPrefix(service);
String name = XmlUtil.getLocalPart(service);
String prefix = XmlUtil.getPrefix(portType);
String name = XmlUtil.getLocalPart(portType);
代码示例来源:origin: com.sun.xml.ws/rt
/**
* Returns true if body has explicit parts declaration
*/
private static boolean parseSOAPBodyBinding(XMLStreamReader reader, Map<String, ParameterBinding> parts) {
String partsString = reader.getAttributeValue(null, "parts");
if (partsString != null) {
List<String> partsList = XmlUtil.parseTokenList(partsString);
if (partsList.isEmpty()) {
parts.put(" ", ParameterBinding.BODY);
} else {
for (String part : partsList) {
parts.put(part, ParameterBinding.BODY);
}
}
return true;
}
return false;
}
代码示例来源:origin: javaee/metro-jax-ws
/**
* Performs identity transformation.
* @param <T>
* @param src
* @param result
* @return
* @throws javax.xml.transform.TransformerException
* @throws java.io.IOException
* @throws org.xml.sax.SAXException
* @throws javax.xml.parsers.ParserConfigurationException
*/
public static <T extends Result> T identityTransform(Source src, T result)
throws TransformerException, SAXException, ParserConfigurationException, IOException {
if (src instanceof StreamSource) {
// work around a bug in JAXP in JDK6u4 and earlier where the namespace processing
// is not turned on by default
StreamSource ssrc = (StreamSource) src;
TransformerHandler th = ((SAXTransformerFactory) transformerFactory.get()).newTransformerHandler();
th.setResult(result);
XMLReader reader = saxParserFactory.get().newSAXParser().getXMLReader();
reader.setContentHandler(th);
reader.setProperty(LEXICAL_HANDLER_PROPERTY, th);
reader.parse(toInputSource(ssrc));
} else {
newTransformer().transform(src, result);
}
return result;
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public void writeTo(SOAPMessage saaj) throws SOAPException {
try {
// TODO what about in-scope namespaces
// Not very efficient consider implementing a stream buffer
// processor that produces a DOM node from the buffer.
Transformer t = XmlUtil.newTransformer();
SOAPHeader header = saaj.getSOAPHeader();
if (header == null)
header = saaj.getSOAPPart().getEnvelope().addHeader();
// TODO workaround for oracle xdk bug 16555545, when this bug is fixed the line below can be
// uncommented and all lines below, except the catch block, can be removed.
// t.transform(epr.asSource(localName), new DOMResult(header));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLStreamWriter w = XMLOutputFactory.newFactory().createXMLStreamWriter(baos);
epr.writeTo(localName, w);
w.flush();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DocumentBuilderFactory fac = XmlUtil.newDocumentBuilderFactory(false);
fac.setNamespaceAware(true);
Node eprNode = fac.newDocumentBuilder().parse(bais).getDocumentElement();
Node eprNodeToAdd = header.getOwnerDocument().importNode(eprNode, true);
header.appendChild(eprNodeToAdd);
} catch (Exception e) {
throw new SOAPException(e);
}
}
代码示例来源:origin: com.sun.xml.ws/rt
void addSchema(Source schema) {
assert schema.getSystemId() != null;
String systemId = schema.getSystemId();
try {
XMLStreamBufferResult xsbr = XmlUtil.identityTransform(schema, new XMLStreamBufferResult());
SDDocumentSource sds = SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer());
SDDocument sdoc = SDDocumentImpl.create(sds, new QName(""), new QName(""));
docs.put(systemId, sdoc);
nsMapping.put(((SDDocument.Schema)sdoc).getTargetNamespace(), sdoc);
} catch(Exception ex) {
LOGGER.log(Level.WARNING, "Exception in adding schemas to resolver", ex);
}
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
@Override
protected XPathFactory initialValue() throws Exception {
return XmlUtil.newXPathFactory(true);
}
};
代码示例来源:origin: org.glassfish.metro/webservices-tools
public static String getRequiredAttribute(Element element, String name) {
String result = XmlUtil.getAttributeOrNull(element, name);
if (result == null)
fail(
"parsing.missingRequiredAttribute",
element.getTagName(),
name);
return result;
}
代码示例来源:origin: javaee/metro-jax-ws
public static QName getQName(XMLStreamReader reader, String tag){
String localName = XmlUtil.getLocalPart(tag);
String pfix = XmlUtil.getPrefix(tag);
String uri = reader.getNamespaceURI(fixNull(pfix));
return new QName(uri, localName);
}
无法弄清楚为什么 XMLUtils.outputDOM 没有输出任何内容 import org.apache.xml.security.utils.XMLUtils; DocumentBuilderF
我正在使用 XmlUtils 解析并提取列表中 id 属性的值,但它返回空。 我哪里出错了?请推荐 XML:
本文整理了Java中org.metawidget.util.XmlUtils.getSiblingWithAttribute()方法的一些代码示例,展示了XmlUtils.getSiblingWith
本文整理了Java中org.metawidget.util.XmlUtils.inspectionResultToJsonSchema()方法的一些代码示例,展示了XmlUtils.inspectio
本文整理了Java中org.metawidget.util.XmlUtils.getChildWithAttributeValue()方法的一些代码示例,展示了XmlUtils.getChildWit
本文整理了Java中org.metawidget.util.XmlUtils.newDocument()方法的一些代码示例,展示了XmlUtils.newDocument()的具体用法。这些代码示例主
本文整理了Java中org.metawidget.util.XmlUtils.setMapAsAttributes()方法的一些代码示例,展示了XmlUtils.setMapAsAttributes(
本文整理了Java中org.metawidget.util.XmlUtils.getFirstChildElement()方法的一些代码示例,展示了XmlUtils.getFirstChildElem
本文整理了Java中org.metawidget.util.XmlUtils.getNextSiblingElement()方法的一些代码示例,展示了XmlUtils.getNextSiblingEl
本文整理了Java中org.metawidget.util.XmlUtils.arrayToJsonSchema()方法的一些代码示例,展示了XmlUtils.arrayToJsonSchema()的
本文整理了Java中org.metawidget.util.XmlUtils.escapeForXml()方法的一些代码示例,展示了XmlUtils.escapeForXml()的具体用法。这些代码示
本文整理了Java中org.metawidget.util.XmlUtils.getLocalName()方法的一些代码示例,展示了XmlUtils.getLocalName()的具体用法。这些代码示
本文整理了Java中org.metawidget.util.XmlUtils.getChildWithAttribute()方法的一些代码示例,展示了XmlUtils.getChildWithAttr
本文整理了Java中org.metawidget.util.XmlUtils.importElement()方法的一些代码示例,展示了XmlUtils.importElement()的具体用法。这些代
本文整理了Java中org.metawidget.util.XmlUtils.combineElements()方法的一些代码示例,展示了XmlUtils.combineElements()的具体用法
本文整理了Java中org.metawidget.util.XmlUtils.getAttributesAsMap()方法的一些代码示例,展示了XmlUtils.getAttributesAsMap(
本文整理了Java中org.metawidget.util.XmlUtils.documentFromString()方法的一些代码示例,展示了XmlUtils.documentFromString(
本文整理了Java中org.metawidget.util.XmlUtils.documentToString()方法的一些代码示例,展示了XmlUtils.documentToString()的具体
本文整理了Java中org.intermine.util.XmlUtil.getFragmentFromURI()方法的一些代码示例,展示了XmlUtil.getFragmentFromURI()的具
本文整理了Java中org.intermine.util.XmlUtil.writeIndentation()方法的一些代码示例,展示了XmlUtil.writeIndentation()的具体用法。
我是一名优秀的程序员,十分优秀!