本文整理了Java中org.apache.woden.XMLElement
类的一些代码示例,展示了XMLElement
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLElement
类的具体详情如下:
包路径:org.apache.woden.XMLElement
类名称:XMLElement
[英]This interface represents an XML element information item in a format to be interpreted by the Woden implementation. It permits different representations of an element to be used as method arguments or return values without making the Woden API dependent on any particular XML parser or XML object model.
[中]此接口表示一个XML元素信息项,其格式由Woden实现解释。它允许将元素的不同表示形式用作方法参数或返回值,而不会使Woden API依赖于任何特定的XML解析器或XML对象模型。
代码示例来源:origin: org.apache.woden/woden-impl-dom
public boolean testElementShorthand(XMLElement element, String shorthand) {
//Simple http://www.w3.org/TR/xml-id/ support for now until we support full scheme based ID's.
Element domElement = (Element)element.getSource();
String attr = domElement.getAttributeNS("http://www.w3.org/XML/1998/namespace", "id");
return attr != null && attr.equals(shorthand);
}
代码示例来源:origin: org.apache.woden/woden-core
protected XMLElement[] doGetChildElements() {
List children = new Vector();
XMLElement temp = doGetFirstChildElement();
while(temp != null)
{
children.add(temp);
temp = temp.getNextSiblingElement();
}
XMLElement[] array = new XMLElement[children.size()];
children.toArray(array);
return array;
}
代码示例来源:origin: org.apache.woden/woden-impl-commons
public Object next() {
//Get next element.
XMLElement element;
try {
element = (XMLElement)stack.pop();
} catch (EmptyStackException e) {
throw new NoSuchElementException();
}
//Add children to top of stack in reverse order.
List children = Arrays.asList(element.getChildElements());
Collections.reverse(children);
stack.addAll(children);
return element;
}
代码示例来源:origin: org.apache.woden/woden-core
String ref = bindFaultEl.getAttributeValue(Constants.ATTR_REF);
if(ref != null)
intFltQN = bindFaultEl.getQName(ref);
fault.setRef(intFltQN);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {ref, bindFaultEl.getQName()},
ErrorReporter.SEVERITY_ERROR);
XMLElement[] children = bindFaultEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
tempElQN = tempEl.getQName();
代码示例来源:origin: org.apache.woden/woden-core
if(Constants.ELEM_INFAULT.equals(faultRefEl.getLocalName())) {
faultRef.setDirection(Direction.IN);
else if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName())){
faultRef.setDirection(Direction.OUT);
String ref = faultRefEl.getAttributeValue(Constants.ATTR_REF);
if(ref != null)
QName qname = faultRefEl.getQName(ref);
faultRef.setRef(qname);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {ref, faultRefEl.getQName()},
ErrorReporter.SEVERITY_ERROR);
String msgLabel = faultRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
if(msgLabel != null)
if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName()))
if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName()))
XMLElement[] children = faultRefEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
代码示例来源:origin: org.apache.woden/woden-impl-commons
soapHdr.setParentElement((WSDLElement)parent);
String elemDeclQN = extEl.getAttributeValue(Constants.ATTR_ELEMENT);
if(elemDeclQN != null)
QName qname = extEl.getQName(elemDeclQN);
soapHdr.setElementName(qname);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {elemDeclQN, extEl.getLocalName()},
ErrorReporter.SEVERITY_ERROR);
String mustUnderstand = extEl.getAttributeValue(SOAPConstants.ATTR_MUSTUNDERSTAND);
soapHdr.setMustUnderstand(new Boolean(mustUnderstand));
String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
soapHdr.setRequired(new Boolean(required));
XMLElement tempEl = extEl.getFirstChildElement();
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempEl.getQName()))
tempEl = tempEl.getNextSiblingElement();
代码示例来源:origin: org.apache.woden/woden-impl-om
schema.setXMLElement(schemaElement);
schema.setId(schemaElement.getAttributeValue(Constants.ATTR_ID));
String tns = schemaElement.getAttributeValue(Constants.ATTR_TARGET_NAMESPACE);
if(tns != null) {
schema.setNamespace(getURI(tns));
OMElement omSchemaElem = (OMElement)schemaElement.getSource();
InputSource schemaSource = OMUtils.getInputSource(omSchemaElem);
XmlSchemaCollection xsc = new XmlSchemaCollection();
代码示例来源:origin: org.apache.woden/woden-impl-commons
httpHdr.setParentElement((WSDLElement)parent);
String name = extEl.getAttributeValue(Constants.ATTR_NAME);
httpHdr.setName(name);
String typeQN = extEl.getAttributeValue(Constants.ATTR_TYPE);
if(typeQN != null)
QName qname = extEl.getQName(typeQN);
httpHdr.setTypeName(qname);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {typeQN, extEl.getLocalName()},
ErrorReporter.SEVERITY_ERROR);
String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
httpHdr.setRequired(new Boolean(required));
代码示例来源:origin: org.apache.woden/woden-core
private ImportElement parseImport(
XMLElement importEl,
DescriptionElement desc,
Map wsdlModules)
throws WSDLException {
ImportElement imp = desc.addImportElement();
String namespaceURI = importEl.getAttributeValue(Constants.ATTR_NAMESPACE);
String locationURI = importEl.getAttributeValue(Constants.ATTR_LOCATION);
parseExtensionAttributes(importEl, ImportElement.class, imp, desc);
if(namespaceURI != null)
{
//TODO handle missing namespace attribute (REQUIRED attr)
imp.setNamespace(getURI(namespaceURI));
}
if(locationURI != null)
{
//TODO handle missing locationURI (OPTIONAL attr)
URI resolvedLocationURI = resolveURI(getURI(locationURI));
imp.setLocation(resolvedLocationURI);
DescriptionElement importedDesc =
getWSDLFromLocation(resolvedLocationURI.toString(), desc, wsdlModules);
imp.setDescriptionElement(importedDesc);
}
return imp;
}
代码示例来源:origin: org.apache.woden/woden-impl-commons
private QName convertQName(XMLElement ownerEl, String qnameStr)
throws WSDLException {
QName qname = null;
try {
qname = ownerEl.getQName(qnameStr);
} catch (WSDLException e) {
// TODO: line&col nos.
// TODO: use correct error number
getErrorReporter().reportError(new ErrorLocatorImpl(), "WSDL510",
new Object[] { qnameStr }, ErrorReporter.SEVERITY_ERROR, e);
}
return qname;
}
代码示例来源:origin: org.apache.woden/woden-core
throws WSDLException {
QName elementType = el.getQName();
URI namespaceURI = el.getNamespaceURI();
代码示例来源:origin: org.apache.woden/woden-impl-commons
XMLElement[] children = typesEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
tempElQN = tempEl.getQName();
代码示例来源:origin: org.apache.woden/woden-core
protected XMLElement doGetFirstChildElement() {
XMLElement xmlElement = new DOMXMLElement(fErrorReporter);
Element el = (Element)fSource;
for (Node node = el.getFirstChild(); node!=null; node=node.getNextSibling()){
if (node.getNodeType() == Node.ELEMENT_NODE){
xmlElement.setSource(node);
return xmlElement;
}
}
return null; //no child element found
}
代码示例来源:origin: org.apache.woden/woden-core
/**
* Filters an XMLElement[] for nodes which are not xml tag elements.
*
* @param nodes an XMLElement[] of the nodes to filter.
* @return an XMLElement[] of the remaining nodes.
*/
private static XMLElement[] filterNoneElementNodes(XMLElement[] nodes) {
List nodeList = Arrays.asList(nodes);
for(Iterator it = nodeList.iterator(); it.hasNext(); ) {
XMLElement node = (XMLElement)it.next();
if(node.getLocalName().indexOf('#') > -1) {
it.remove();
}
}
XMLElement[] nNodes = new XMLElement[nodeList.size()];
nodeList.toArray(nNodes);
return nNodes;
}
代码示例来源:origin: org.apache.woden/woden-impl-commons
String ref = bindFaultEl.getAttributeValue(Constants.ATTR_REF);
if(ref != null)
intFltQN = bindFaultEl.getQName(ref);
fault.setRef(intFltQN);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {ref, bindFaultEl.getQName()},
ErrorReporter.SEVERITY_ERROR);
XMLElement[] children = bindFaultEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
tempElQN = tempEl.getQName();
代码示例来源:origin: org.apache.woden/woden-core
if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
message.setDirection(Direction.IN);
else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
message.setDirection(Direction.OUT);
String msgLabel = msgRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
if(msgLabel != null)
XMLElement[] children = msgRefEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
tempElQN = tempEl.getQName();
代码示例来源:origin: org.apache.woden/woden-core
soapHdr.setParentElement((WSDLElement)parent);
String elemDeclQN = extEl.getAttributeValue(Constants.ATTR_ELEMENT);
if(elemDeclQN != null)
QName qname = extEl.getQName(elemDeclQN);
soapHdr.setElementName(qname);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {elemDeclQN, extEl.getLocalName()},
ErrorReporter.SEVERITY_ERROR);
String mustUnderstand = extEl.getAttributeValue(SOAPConstants.ATTR_MUSTUNDERSTAND);
soapHdr.setMustUnderstand(new Boolean(mustUnderstand));
String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
soapHdr.setRequired(new Boolean(required));
XMLElement tempEl = extEl.getFirstChildElement();
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempEl.getQName()))
tempEl = tempEl.getNextSiblingElement();
代码示例来源:origin: org.apache.woden/woden-impl-dom
schema.setXMLElement(schemaEl);
schema.setId(schemaEl.getAttributeValue(SchemaConstants.ATTR_ID));
String tns = schemaEl.getAttributeValue(SchemaConstants.ATTR_TARGET_NAMESPACE);
if(tns != null) {
schema.setNamespace(getURI(tns));
Element domSchemaEl = (Element)schemaEl.getSource();
XmlSchemaCollection xsc = new XmlSchemaCollection();
xsc.setBaseUri(baseURI);
代码示例来源:origin: org.apache.woden/woden-core
httpHdr.setParentElement((WSDLElement)parent);
String name = extEl.getAttributeValue(Constants.ATTR_NAME);
httpHdr.setName(name);
String typeQN = extEl.getAttributeValue(Constants.ATTR_TYPE);
if(typeQN != null)
QName qname = extEl.getQName(typeQN);
httpHdr.setTypeName(qname);
} catch (WSDLException e) {
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {typeQN, extEl.getLocalName()},
ErrorReporter.SEVERITY_ERROR);
String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
httpHdr.setRequired(new Boolean(required));
代码示例来源:origin: org.apache.woden/woden-impl-commons
private ImportElement parseImport(
XMLElement importEl,
DescriptionElement desc,
Map wsdlModules)
throws WSDLException {
ImportElement imp = desc.addImportElement();
String namespaceURI = importEl.getAttributeValue(Constants.ATTR_NAMESPACE);
String locationURI = importEl.getAttributeValue(Constants.ATTR_LOCATION);
parseExtensionAttributes(importEl, ImportElement.class, imp, desc);
if(namespaceURI != null)
{
//TODO handle missing namespace attribute (REQUIRED attr)
imp.setNamespace(getURI(namespaceURI));
}
if(locationURI != null)
{
//TODO handle missing locationURI (OPTIONAL attr)
URI resolvedLocationURI = resolveURI(getURI(locationURI));
imp.setLocation(resolvedLocationURI);
DescriptionElement importedDesc =
getWSDLFromLocation(resolvedLocationURI.toString(), desc, wsdlModules);
imp.setDescriptionElement(importedDesc);
}
return imp;
}
内容来源于网络,如有侵权,请联系作者删除!