- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.metawidget.util.XmlUtils.combineElements()
方法的一些代码示例,展示了XmlUtils.combineElements()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtils.combineElements()
方法的具体详情如下:
包路径:org.metawidget.util.XmlUtils
类名称:XmlUtils
方法名:combineElements
[英]Combine the attributes and child elements of the second element into the first element.
Combining is performed purely by matching a topLevelAttributeToCombineOn attribute on the element. The child element ordering of the first element is respected.
Child elements are matched recursively on childAttributeToCombineOn.
[中]将第二个元素的属性和子元素组合到第一个元素中。
合并纯粹通过匹配元素上的topLevelAttributeToCombineOn属性来执行。第一个元素的子元素顺序得到尊重。
子元素在childAttributeToCombineOn上递归匹配。
代码示例来源:origin: org.metawidget.modules/metawidget-core
protected Document combineInspectionResult( Document masterDocument, Document inspectionDocument ) {
// Short circuit...
if ( inspectionDocument == null || !inspectionDocument.hasChildNodes() ) {
return masterDocument;
}
if ( masterDocument == null || !masterDocument.hasChildNodes() ) {
return inspectionDocument;
}
// ...or full combine
XmlUtils.combineElements( masterDocument.getDocumentElement(), inspectionDocument.getDocumentElement(), TYPE, NAME );
return masterDocument;
}
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
protected Document combineInspectionResult( Document masterDocument, Document inspectionDocument ) {
// Short circuit...
if ( inspectionDocument == null || !inspectionDocument.hasChildNodes() ) {
return masterDocument;
}
if ( masterDocument == null || !masterDocument.hasChildNodes() ) {
return inspectionDocument;
}
// ...or full combine
XmlUtils.combineElements( masterDocument.getDocumentElement(), inspectionDocument.getDocumentElement(), TYPE, NAME );
return masterDocument;
}
}
代码示例来源:origin: org.metawidget.modules/metawidget-core
combineElements( masterChild, childToAdd, childAttributeToCombineOn, childAttributeToCombineOn );
continue outerLoop;
代码示例来源:origin: org.metawidget.modules/metawidget-all
combineElements( masterChild, childToAdd, childAttributeToCombineOn, childAttributeToCombineOn );
continue outerLoop;
代码示例来源:origin: org.metawidget.modules/metawidget-all
@Override
protected Element getDocumentElement( ResourceResolver resolver, InputStream... files )
throws Exception {
Document document = XmlUtils.newDocument();
Element root = document.createElement( FORMSET_ELEMENT );
document.appendChild( root );
for ( InputStream file : files ) {
Document documentParsed = XmlUtils.parse( file );
Element formSet = XmlUtils.getChildNamed( documentParsed.getDocumentElement(), FORMSET_ELEMENT );
if ( formSet == null ) {
continue;
}
XmlUtils.combineElements( root, formSet, getTopLevelTypeAttribute(), getNameAttribute() );
}
return root;
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
@Override
protected Element getDocumentElement( ResourceResolver resolver, InputStream... files )
throws Exception {
Document document = XmlUtils.newDocument();
Element root = document.createElement( FORM_BEANS_ELEMENT );
document.appendChild( root );
for ( InputStream file : files ) {
Document documentParsed = XmlUtils.parse( file );
Element formBeans = XmlUtils.getChildNamed( documentParsed.getDocumentElement(), FORM_BEANS_ELEMENT );
if ( formBeans == null ) {
continue;
}
XmlUtils.combineElements( root, formBeans, getTopLevelTypeAttribute(), getNameAttribute() );
}
return root;
}
代码示例来源:origin: org.metawidget.modules/metawidget-core
/**
* Merge the given DOM Documents into a single Document, and return its root.
*/
protected Element getDocumentElement( Document... documents )
throws Exception {
Document documentMaster = null;
for ( Document document : documents ) {
if ( !document.hasChildNodes() ) {
continue;
}
preprocessDocument( document );
if ( documentMaster == null || !documentMaster.hasChildNodes() ) {
documentMaster = document;
continue;
}
XmlUtils.combineElements( documentMaster.getDocumentElement(), document.getDocumentElement(), getTopLevelTypeAttribute(), getNameAttribute() );
}
if ( documentMaster == null ) {
return null;
}
return documentMaster.getDocumentElement();
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
/**
* Merge the given DOM Documents into a single Document, and return its root.
*/
protected Element getDocumentElement( Document... documents )
throws Exception {
Document documentMaster = null;
for ( Document document : documents ) {
if ( !document.hasChildNodes() ) {
continue;
}
preprocessDocument( document );
if ( documentMaster == null || !documentMaster.hasChildNodes() ) {
documentMaster = document;
continue;
}
XmlUtils.combineElements( documentMaster.getDocumentElement(), document.getDocumentElement(), getTopLevelTypeAttribute(), getNameAttribute() );
}
if ( documentMaster == null ) {
return null;
}
return documentMaster.getDocumentElement();
}
代码示例来源:origin: org.metawidget.modules/metawidget-core
/**
* Inspect the <code>toInspect</code> for properties and actions.
* <p>
* This method can be overridden by clients wishing to modify the inspection process. Most
* clients will find it easier to override one of the sub-methods, such as
* <code>inspectTrait</code> or <code>inspectProperty</code>.
*/
protected void inspectTraits( Element toInspect, Element toAddTo ) {
if ( toInspect == null ) {
return;
}
Document document = toAddTo.getOwnerDocument();
// Do 'extends' attribute first
String extendsAttribute = getExtendsAttribute();
if ( extendsAttribute != null ) {
if ( toInspect.hasAttribute( extendsAttribute ) ) {
inspectTraits( (Element) traverse( null, toInspect.getAttribute( extendsAttribute ), false ).getValue(), toAddTo );
}
}
// Next, inspect each child...
Element element = document.createElementNS( NAMESPACE, ENTITY );
inspectTraitSiblings( element, XmlUtils.getFirstChildElement( toInspect ) );
// ...and combine them all. Note the element may already exist from the superclass,
// and its attributes will get overridden by the subclass
XmlUtils.combineElements( toAddTo, element, NAME, NAME );
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
/**
* Inspect the <code>toInspect</code> for properties and actions.
* <p>
* This method can be overridden by clients wishing to modify the inspection process. Most
* clients will find it easier to override one of the sub-methods, such as
* <code>inspectTrait</code> or <code>inspectProperty</code>.
*/
protected void inspectTraits( Element toInspect, Element toAddTo ) {
if ( toInspect == null ) {
return;
}
Document document = toAddTo.getOwnerDocument();
// Do 'extends' attribute first
String extendsAttribute = getExtendsAttribute();
if ( extendsAttribute != null ) {
if ( toInspect.hasAttribute( extendsAttribute ) ) {
inspectTraits( (Element) traverse( null, toInspect.getAttribute( extendsAttribute ), false ).getValue(), toAddTo );
}
}
// Next, inspect each child...
Element element = document.createElementNS( NAMESPACE, ENTITY );
inspectTraitSiblings( element, XmlUtils.getFirstChildElement( toInspect ) );
// ...and combine them all. Note the element may already exist from the superclass,
// and its attributes will get overridden by the subclass
XmlUtils.combineElements( toAddTo, element, NAME, NAME );
}
代码示例来源:origin: org.metawidget.modules/metawidget-all
XmlUtils.combineElements( documentMaster.getDocumentElement(), parsed, getTopLevelTypeAttribute(), getNameAttribute() );
代码示例来源:origin: org.metawidget.modules/metawidget-all
protected Element inspect() {
TypeAndNames typeAndNames = PathUtils.parsePath( mPath, StringUtils.SEPARATOR_DOT_CHAR );
String type = typeAndNames.getType();
// Inspect using the 'raw' type (eg. contactForm)
Element inspectionResult = mPipeline.inspectAsDom( null, type, typeAndNames.getNamesAsArray() );
// (pageContext may be null in unit tests)
if ( pageContext != null ) {
// Try to locate the runtime bean. This allows some Inspectors
// to act on it polymorphically.
Object obj = pageContext.findAttribute( type );
if ( obj != null ) {
Element additionalInspectionResult = mPipeline.inspectAsDom( obj, obj.getClass().getName(), typeAndNames.getNamesAsArray() );
// Combine the subtrees
//
// Note the top-level types attribute will be different, because one is the 'raw'
// type (eg. contactForm) and one the runtime bean (eg.
// org.metawidget.example.struts.addressbook.form.BusinessContactForm)
if ( inspectionResult == null ) {
inspectionResult = additionalInspectionResult;
} else if ( additionalInspectionResult != null ) {
Element inspectionResultEntity = XmlUtils.getFirstChildElement( inspectionResult );
Element additionalInspectionResultEntity = XmlUtils.getFirstChildElement( additionalInspectionResult );
XmlUtils.combineElements( inspectionResultEntity, additionalInspectionResultEntity, NAME, null );
}
}
}
return inspectionResult;
}
无法弄清楚为什么 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()的具体用法。
我是一名优秀的程序员,十分优秀!