Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.selectPath()


        InterfaceDefinitionPart part = parts.get( i );
        String content = part.getContent();
        // XmlObject xml = XmlObject.Factory.parse( content );
        XmlObject xml = XmlUtils.createXmlObject( content );
        // include paths for both namespaces
        XmlObject[] paths = xml.selectPath( "declare namespace wsp='" + WS_W3_POLICY_NAMESPACE + "';"
            + "//wsp:Policy" );
        List<XmlObject> listOfXmlObjcts = Arrays.asList( paths );

        XmlObject[] paths1 = xml.selectPath( "declare namespace wsp='" + WS_XMLSOAP_POLICY_NAMESPACE + "';"
            + "//wsp:Policy" );
View Full Code Here


        // include paths for both namespaces
        XmlObject[] paths = xml.selectPath( "declare namespace wsp='" + WS_W3_POLICY_NAMESPACE + "';"
            + "//wsp:Policy" );
        List<XmlObject> listOfXmlObjcts = Arrays.asList( paths );

        XmlObject[] paths1 = xml.selectPath( "declare namespace wsp='" + WS_XMLSOAP_POLICY_NAMESPACE + "';"
            + "//wsp:Policy" );
        listOfXmlObjcts.addAll( Arrays.asList( paths1 ) );
        paths = ( XmlObject[] )listOfXmlObjcts.toArray();

        for( XmlObject obj : paths )
View Full Code Here

    XmlCursor cursor = null;
    try
    {
      // XmlObject xmlObject = XmlObject.Factory.parse( faultResponse );
      XmlObject xmlObject = XmlUtils.createXmlObject( faultResponse );
      XmlObject[] detail = xmlObject.selectPath( "//detail" );
      if( detail.length > 0 )
      {
        cursor = detail[0].newCursor();

        cursor.toFirstContentToken();
View Full Code Here

    // check manually before resource intensive xpath
    if( responseContent.indexOf( ":Fault" ) > 0 || responseContent.indexOf( "<Fault" ) > 0 )
    {
      // XmlObject xml = XmlObject.Factory.parse( responseContent );
      XmlObject xml = XmlUtils.createXmlObject( responseContent );
      XmlObject[] paths = xml.selectPath( "declare namespace env='" + soapVersion.getEnvelopeNamespace() + "';"
          + "//env:Fault" );
      if( paths.length > 0 )
        return true;
    }
View Full Code Here

  public static String removeEmptySoapHeaders( String content, SoapVersion soapVersion ) throws XmlException
  {
    // XmlObject xmlObject = XmlObject.Factory.parse( content );
    XmlObject xmlObject = XmlUtils.createXmlObject( content );
    XmlObject[] selectPath = xmlObject.selectPath( "declare namespace soap='" + soapVersion.getEnvelopeNamespace()
        + "';/soap:Envelope/soap:Header" );
    if( selectPath.length > 0 )
    {
      Node domNode = selectPath[0].getDomNode();
      if( !domNode.hasChildNodes() && !domNode.hasAttributes() )
View Full Code Here

    try
    {
      // XmlObject source = XmlObject.Factory.parse( requestContent );
      XmlObject source = XmlUtils.createXmlObject( requestContent );
      String headerXPath = "declare namespace ns='" + soapVersion.getEnvelopeNamespace() + "'; //ns:Header";
      XmlObject[] header = source.selectPath( headerXPath );
      if( header.length == 1 )
      {
        Element headerElm = ( Element )header[0].getDomNode();
        NodeList childNodes = headerElm.getChildNodes();
        if( childNodes.getLength() > 0 )
View Full Code Here

        NodeList childNodes = headerElm.getChildNodes();
        if( childNodes.getLength() > 0 )
        {
          // XmlObject dest = XmlObject.Factory.parse( newRequest );
          XmlObject dest = XmlUtils.createXmlObject( newRequest );
          header = dest.selectPath( headerXPath );
          Element destElm = null;

          if( header.length == 0 )
          {
            Element docElm = ( ( Document )dest.getDomNode() ).getDocumentElement();
View Full Code Here

        // XmlObject xmlObject = XmlObject.Factory.parse(
        // testRequest.getResponse().getContentAsXml() );
        XmlObject xmlObject = XmlUtils.createXmlObject( testRequest.getResponse().getContentAsXml() );

        String expression = PropertyExpander.expandProperties( context, getExpression() );
        XmlObject[] selectPath = xmlObject.selectPath( expression );
        if( selectPath.length == 1 && selectPath[0] instanceof XmlBoolean )
        {
          if( ( ( XmlBoolean )selectPath[0] ).getBooleanValue() )
          {
            return true;
View Full Code Here

    try
    {
      // XmlObject xmlObject = XmlObject.Factory.parse( getContentAsString()
      // );
      XmlObject xmlObject = XmlUtils.createXmlObject( getContentAsString() );
      XmlObject[] includes = xmlObject
          .selectPath( "declare namespace xop='http://www.w3.org/2004/08/xop/include'; //xop:Include" );

      for( XmlObject include : includes )
      {
        Element elm = ( Element )include.getDomNode();
View Full Code Here

      //       since XMLBeans v1 does not support specifying a namespace context when calling
      //       selectPath()

      try
      {
         return propsDocXBean.selectPath( xpathExpr.getValue(  ) );
      }
      catch ( RuntimeException re )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.QUERY_FAILED, xpathExpr.getValue(  ),re.getLocalizedMessage(  ) ));
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.