本文整理了Java中nu.xom.Element.getDocument()
方法的一些代码示例,展示了Element.getDocument()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getDocument()
方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getDocument
暂无
代码示例来源:origin: org.xml-cml/cmlxom
public static Document ensureDocument(Element rootElement) {
Document doc = null;
if (rootElement != null) {
doc = rootElement.getDocument();
if (doc == null) {
doc = new Document(rootElement);
}
}
return doc;
}
代码示例来源:origin: spring-projects/spring-ws
private Source convertResponse(Element responseElement) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Serializer serializer = createSerializer(os);
Document document = responseElement.getDocument();
if (document == null) {
document = new Document(responseElement);
}
serializer.write(document);
byte[] bytes = os.toByteArray();
return new StreamSource(new ByteArrayInputStream(bytes));
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
private Source convertResponse(Element responseElement) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Serializer serializer = createSerializer(os);
Document document = responseElement.getDocument();
if (document == null) {
document = new Document(responseElement);
}
serializer.write(document);
byte[] bytes = os.toByteArray();
return new StreamSource(new ByteArrayInputStream(bytes));
}
代码示例来源:origin: apache/servicemix-bundles
private Source convertResponse(Element responseElement) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Serializer serializer = createSerializer(os);
Document document = responseElement.getDocument();
if (document == null) {
document = new Document(responseElement);
}
serializer.write(document);
byte[] bytes = os.toByteArray();
return new StreamSource(new ByteArrayInputStream(bytes));
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
private Source convertResponse(Element responseElement) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Serializer serializer = createSerializer(os);
Document document = responseElement.getDocument();
if (document == null) {
document = new Document(responseElement);
}
serializer.write(document);
byte[] bytes = os.toByteArray();
return new StreamSource(new ByteArrayInputStream(bytes));
}
代码示例来源:origin: apache/servicemix-bundles
@Override
protected Source createResponsePayload(MethodParameter returnType, Object returnValue)
throws ParserConfigurationException {
Element returnedElement = (Element) returnValue;
Document document = returnedElement.getDocument();
if (document == null) {
document = new Document(returnedElement);
}
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
DOMImplementation domImplementation = documentBuilder.getDOMImplementation();
org.w3c.dom.Document w3cDocument = DOMConverter.convert(document, domImplementation);
return new DOMSource(w3cDocument);
}
代码示例来源:origin: org.concordion/concordion
public Element getRootElement() {
return new Element(xomElement.getDocument().getRootElement());
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
@Override
protected Source createResponsePayload(MethodParameter returnType, Object returnValue)
throws ParserConfigurationException {
Element returnedElement = (Element) returnValue;
Document document = returnedElement.getDocument();
if (document == null) {
document = new Document(returnedElement);
}
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
DOMImplementation domImplementation = documentBuilder.getDOMImplementation();
org.w3c.dom.Document w3cDocument = DOMConverter.convert(document, domImplementation);
return new DOMSource(w3cDocument);
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
@Override
protected Source createResponsePayload(MethodParameter returnType, Object returnValue)
throws ParserConfigurationException {
Element returnedElement = (Element) returnValue;
Document document = returnedElement.getDocument();
if (document == null) {
document = new Document(returnedElement);
}
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
DOMImplementation domImplementation = documentBuilder.getDOMImplementation();
org.w3c.dom.Document w3cDocument = DOMConverter.convert(document, domImplementation);
return new DOMSource(w3cDocument);
}
代码示例来源:origin: spring-projects/spring-ws
@Override
protected Source createResponsePayload(MethodParameter returnType, Object returnValue)
throws ParserConfigurationException {
Element returnedElement = (Element) returnValue;
Document document = returnedElement.getDocument();
if (document == null) {
document = new Document(returnedElement);
}
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
DOMImplementation domImplementation = documentBuilder.getDOMImplementation();
org.w3c.dom.Document w3cDocument = DOMConverter.convert(document, domImplementation);
return new DOMSource(w3cDocument);
}
代码示例来源:origin: concordion/concordion
public Element getRootElement() {
return new Element(xomElement.getDocument().getRootElement());
}
代码示例来源:origin: org.xml-cml/cmlxom
doc = newRoot.getDocument();
} catch (Exception e) {
throw new RuntimeException("BUG "+e);
内容来源于网络,如有侵权,请联系作者删除!