本文整理汇总了Java中com.evolveum.midpoint.util.DOMUtil.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java DOMUtil.getAttribute方法的具体用法?Java DOMUtil.getAttribute怎么用?Java DOMUtil.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.evolveum.midpoint.util.DOMUtil
的用法示例。
在下文中一共展示了DOMUtil.getAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processWsdl
import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void processWsdl(Path filePath, File workDir, File outDir) throws MojoExecutionException, MojoFailureException {
Document dom = DOMUtil.parseFile(filePath.toFile());
if (translateSchemaLocation) {
Element rootElement = DOMUtil.getFirstChildElement(dom);
List<Element> importElements = DOMUtil.getChildElements(rootElement, DOMUtil.WSDL_IMPORT_ELEMENT);
for(Element importElement: importElements) {
String namespace = DOMUtil.getAttribute(importElement, DOMUtil.WSDL_ATTR_NAMESPACE);
String schemaLocation;
try {
schemaLocation = resolveSchemaLocation(namespace, filePath, workDir);
} catch (IOException e) {
throw new MojoExecutionException("Error resolving namespace "+namespace+" in file "+filePath+": "+ e.getMessage(), e);
}
importElement.setAttribute(DOMUtil.WSDL_ATTR_LOCATION.getLocalPart(),
schemaLocation);
}
List<Element> typesElements = DOMUtil.getChildElements(rootElement, DOMUtil.WSDL_TYPES_ELEMENT);
for(Element typesElement: typesElements) {
processXsdElement(DOMUtil.getFirstChildElement(typesElement),filePath,workDir,outDir);
}
}
serializeXml(dom, filePath, workDir, outDir);
}
示例2: fetchBasicInfoFromSchema
import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void fetchBasicInfoFromSchema() throws SchemaException {
Element rootElement = getDomElement();
if (DOMUtil.XSD_SCHEMA_ELEMENT.equals(DOMUtil.getQName(rootElement))) {
String targetNamespace = DOMUtil.getAttribute(rootElement,DOMUtil.XSD_ATTR_TARGET_NAMESPACE);
if (targetNamespace != null) {
this.namespace = targetNamespace;
} else {
throw new SchemaException("Schema "+sourceDescription+" does not have targetNamespace attribute");
}
} else {
throw new SchemaException("Schema "+sourceDescription+" does not start with xsd:schema element");
}
}
示例3: initSchema
import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void initSchema(Element xsdSchema) throws SchemaException {
String targetNamespace = DOMUtil.getAttribute(xsdSchema, DOMUtil.XSD_ATTR_TARGET_NAMESPACE);
if (StringUtils.isEmpty(targetNamespace)) {
throw new SchemaException("Schema does not have targetNamespace specification");
}
schema.setNamespace(targetNamespace);
}