gpt4 book ai didi

org.apache.woden.XMLElement.getSource()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 13:03:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.woden.XMLElement.getSource()方法的一些代码示例,展示了XMLElement.getSource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLElement.getSource()方法的具体详情如下:
包路径:org.apache.woden.XMLElement
类名称:XMLElement
方法名:getSource

XMLElement.getSource介绍

[英]Returns an Object representing an XML element, which the caller must cast to the expected type. For example, for DOM implementation we might cast it to an org.w3c.dom.Element whereas an AXIOM implementation might cast it to an org.apache.axiom.om.OMElement.
[中]返回一个表示XML元素的对象,调用方必须将其转换为预期类型。例如,对于DOM实现,我们可以将其转换为一个组织。w3c。多姆。元素,而AXIOM实现可能会将其强制转换为组织。阿帕奇。公理嗯。OMElement。

代码示例

代码示例来源: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

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

private String getAttributeNS (XMLElement xmlElement,
                String namespaceURI,
                String localPart) {
  String sRet = null;
  if (xmlElement.getSource() instanceof Element){
    Element el = (Element)xmlElement.getSource();
    Attr   attr = el.getAttributeNodeNS (namespaceURI, localPart);
    if (attr != null) {
      sRet = attr.getValue ();
    }
  }
  return sRet;
}

代码示例来源:origin: org.apache.woden/woden-api

private String getAttributeNS (XMLElement xmlElement,
                String namespaceURI,
                String localPart) {
  String sRet = null;
  if (xmlElement.getSource() instanceof Element){
    Element el = (Element)xmlElement.getSource();
    Attr   attr = el.getAttributeNodeNS (namespaceURI, localPart);
    if (attr != null) {
      sRet = attr.getValue ();
    }
  }
  return sRet;
}

代码示例来源:origin: org.apache.woden/woden-impl-om

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.
  OMElement omElement = (OMElement)element.getSource();
  String attr = omElement.getAttributeValue(new QName("http://www.w3.org/XML/1998/namespace", "id"));
  return attr != null && attr.equals(shorthand);
}

代码示例来源:origin: org.apache.woden/woden-impl-om

/**
 * Evaluates the XPointer on the root Element and returns the resulting
 * Element or null.
 * 
 * @return an Element from the resultant evaluation of the root Element or
 *         null if evaluation fails.
 */
public OMElement evaluateElement() {
  XMLElement element = evaluate();
  if (element != null) return (OMElement) element.getSource();
  return null;
}

代码示例来源:origin: org.apache.woden/woden-impl-dom

/**
 * Evaluates the XPointer on the root Element and returns the resulting Element or null.
 * 
 * @return an Element from the resultant evaluation of the root Element or null if evaluation fails.
 */
public Element evaluateElement(){
  XMLElement element = evaluate();
  if (element != null) return (Element)element.getSource();
  return null;
}

代码示例来源:origin: org.apache.woden/woden-core

/**
 * Evaluates the XPointer on the root Element and returns the resulting Element or null.
 * 
 * @return an Element from the resultant evaluation of the root Element or null if evaluation fails.
 */
public Element evaluateElement(){
  XMLElement element = evaluate();
  if (element != null) return (Element)element.getSource();
  return null;
}

代码示例来源:origin: org.apache.woden/woden-core

throws WSDLException
Element domEl = (Element)extEl.getSource();
NamedNodeMap nodeMap = domEl.getAttributes();
int length = nodeMap.getLength();

代码示例来源:origin: org.apache.woden/woden-impl-dom

protected void parseNamespaceDeclarations(XMLElement xmlElem, WSDLElement wsdlElem) 
  throws WSDLException {
  Element elem = (Element)xmlElem.getSource();
      
  NamedNodeMap attrs = elem.getAttributes();
  int size = attrs.getLength();
  for (int i = 0; i < size; i++)
  {
   Attr attr = (Attr)attrs.item(i);
   String namespaceURI = attr.getNamespaceURI();
   String localPart = attr.getLocalName();
   String value = attr.getValue();
   if ((Constants.NS_STRING_XMLNS).equals(namespaceURI))
   {
    if (!(Constants.ATTR_XMLNS).equals(localPart))
    {
     wsdlElem.addNamespace(localPart, getURI(value));  //a prefixed namespace
    }
    else
    {
     wsdlElem.addNamespace(null, getURI(value));       //the default namespace
    }
   }
  }
}

代码示例来源:origin: org.apache.woden/woden-core

protected void parseNamespaceDeclarations(XMLElement xmlElem, WSDLElement wsdlElem) 
  throws WSDLException {
  Element elem = (Element)xmlElem.getSource();
      
  NamedNodeMap attrs = elem.getAttributes();
  int size = attrs.getLength();
  for (int i = 0; i < size; i++)
  {
   Attr attr = (Attr)attrs.item(i);
   String namespaceURI = attr.getNamespaceURI();
   String localPart = attr.getLocalName();
   String value = attr.getValue();
   if ((Constants.NS_STRING_XMLNS).equals(namespaceURI))
   {
    if (!(Constants.ATTR_XMLNS).equals(localPart))
    {
     wsdlElem.addNamespace(localPart, getURI(value));  //a prefixed namespace
    }
    else
    {
     wsdlElem.addNamespace(null, getURI(value));       //the default namespace
    }
   }
  }
}

代码示例来源:origin: org.apache.woden/woden-core

Object o = docEle.getContent().getSource();
org.w3c.dom.Element domEl = (org.w3c.dom.Element)o;

代码示例来源:origin: org.apache.woden/woden-core

/**
 * Serialize  the InlinedSchemas of the  WSDL element model.
 *
 * @param inlinedSchema an array of InlinedSchemas.
 * @param des corresponding  DescriptionElement.
 * @param pw the Writer to write the xml to.
 */
protected void printInlinedSchemas(InlinedSchema[] inlinedSchema,
                     DescriptionElement des,
                     PrintWriter pw)
                     throws WSDLException
{
  /* previous method
  *
  *  XmlSchema xs=null;
  // TODO used XmlSchema serialiser.Cause extra info like
  // attributeFormDefault="unqualified" elementFormDefault="unqualified" ..etc
  for(int i=0;i<inlinedSchema.length;i++){
    xs=inlinedSchema[i].getSchemaDefinition();
    xs.write(pw);
  }*/
  for(int i=0;i<inlinedSchema.length;i++){
    InlinedSchema schema=inlinedSchema[i];
    XMLElement ele=schema.getXMLElement();
    DOM2Writer.serializeAsXML(((Node)ele.getSource()), pw);
  }
}

代码示例来源:origin: org.apache.woden/woden-impl-om

OMElement contextEl = (OMElement)fContextElement.getSource();
OMElement typesEl = (OMElement)contextEl.getParent();
Iterator inlineSchemas = typesEl.

代码示例来源:origin: org.apache.woden/woden-impl-om

pw.print("    <" + tagName);                    
pw.println('>');
Object o = docEle.getContent().getSource();
OMElement omEl = (OMElement)o;                 
pw.println(((OMText)omEl.getFirstOMChild()).getText());

代码示例来源:origin: org.apache.woden/woden-impl-om

/**
 * Serialize  the InlinedSchemas of the  WSDL element model.
 *
 * @param inlinedSchema an array of InlinedSchemas.
 * @param des corresponding  DescriptionElement.
 * @param pw the Writer to write the xml to.
 */
protected void printInlinedSchemas(InlinedSchema[] inlinedSchema,
                     DescriptionElement des,
                     PrintWriter pw)
                     throws WSDLException
{
  /*
   * previous method
   * 
   * XmlSchema xs=null; 
   * like // attributeFormDefault="unqualified"
   * elementFormDefault="unqualified" ..etc for(int i=0;i<inlinedSchema.length;i++){
   * xs=inlinedSchema[i].getSchemaDefinition(); xs.write(pw); }
   */
  for (int i = 0; i < inlinedSchema.length; i++) {
    InlinedSchema schema = inlinedSchema[i];
    XMLElement ele = schema.getXMLElement();          
    OMWriter.serializeAsXML((OMNode)ele.getSource(), pw);
  }
  }

代码示例来源:origin: org.apache.woden/woden-impl-dom

/**
 * Serialize  the InlinedSchemas of the  WSDL element model.
 *
 * @param inlinedSchema an array of InlinedSchemas.
 * @param des corresponding  DescriptionElement.
 * @param pw the Writer to write the xml to.
 */
protected void printInlinedSchemas(InlinedSchema[] inlinedSchema,
                     DescriptionElement des,
                     PrintWriter pw)
                     throws WSDLException
{
  /* previous method
  *
  *  XmlSchema xs=null;
  // TODO used XmlSchema serialiser.Cause extra info like
  // attributeFormDefault="unqualified" elementFormDefault="unqualified" ..etc
  for(int i=0;i<inlinedSchema.length;i++){
    xs=inlinedSchema[i].getSchemaDefinition();
    xs.write(pw);
  }*/
  for(int i=0;i<inlinedSchema.length;i++){
    InlinedSchema schema=inlinedSchema[i];
    XMLElement ele=schema.getXMLElement();
    DOM2Writer.serializeAsXML(((Node)ele.getSource()), pw);
  }
}

代码示例来源:origin: apache/axis2-java

/**
 * Adds documentation details to a given AxisDescription.
 * The documentation details is extracted from the WSDL element given.
 * @param axisDescription - The documentation will be added to this
 * @param element - The element that the documentation is extracted from.
 */
private void addDocumentation(AxisDescription axisDescription, DocumentableElement element) {
  DocumentationElement[] documentationElements = element.getDocumentationElements();
  String documentation = "";
  for (int i = 0; i < documentationElements.length; i++) {
    DocumentationElement documentationElement = documentationElements[i];
    XMLElement contentElement = documentationElement.getContent();
    Element content = (Element)contentElement.getSource();
    if (content != null) {
      documentation = documentation + DOM2Writer.nodeToString(content.getFirstChild());
    }
  }
  if (!"".equals(documentation)) {
    axisDescription.setDocumentation(documentation);
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

/**
 * Adds documentation details to a given AxisDescription.
 * The documentation details is extracted from the WSDL element given.
 * @param axisDescription - The documentation will be added to this
 * @param element - The element that the documentation is extracted from.
 */
private void addDocumentation(AxisDescription axisDescription, DocumentableElement element) {
  DocumentationElement[] documentationElements = element.getDocumentationElements();
  String documentation = "";
  for (int i = 0; i < documentationElements.length; i++) {
    DocumentationElement documentationElement = documentationElements[i];
    XMLElement contentElement = documentationElement.getContent();
    Element content = (Element)contentElement.getSource();
    if (content != null) {
      documentation = documentation + DOM2Writer.nodeToString(content.getFirstChild());
    }
  }
  if (!"".equals(documentation)) {
    axisDescription.setDocumentation(documentation);
  }
}

代码示例来源:origin: org.apache.woden/woden-impl-om

protected void parseNamespaceDeclarations(
    XMLElement xmlElem, 
    WSDLElement wsdlElem) 
    throws WSDLException {
  OMElement omDescription = (OMElement)xmlElem.getSource();
  
  Iterator namespaces = omDescription.getAllDeclaredNamespaces();
  while(namespaces.hasNext()){
    OMNamespace namespace = (OMNamespace)namespaces.next();
    String localPart = namespace.getPrefix();
    String value = namespace.getNamespaceURI();
   if (!(Constants.ATTR_XMLNS).equals(localPart)){
    wsdlElem.addNamespace(localPart, getURI(value));  //a prefixed namespace
   }
   else{
    wsdlElem.addNamespace(null, getURI(value));       //the default namespace
   }
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com