You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2005/07/08 22:53:10 UTC

[jira] Created: (AXIS2-70) XPath support for AXIOM

XPath support for AXIOM
-----------------------

         Key: AXIS2-70
         URL: http://issues.apache.org/jira/browse/AXIS2-70
     Project: Apache Axis 2.0 (Axis2)
        Type: New Feature
    Reporter: Davanum Srinivas


Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
http://jaxen.org/apidocs/org/jaxen/Navigator.html

More details in their FAQ (http://jaxen.org/faq.html)

I'd highly recommend adding this to our 1.0 list.

thanks,
dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-70?page=all ]

Davanum Srinivas updated AXIS2-70:
----------------------------------

    Attachment: TestXPath2.java

Here's the Jaxen based test case. you need jaxen's java sources to compile this class and you need to run it in the directory where jaxen is unzipped.

thanks,


> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: TestXPath2.java, x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315375 ] 

Davanum Srinivas commented on AXIS2-70:
---------------------------------------

Can someone please help me complete the XPath support by getting AXIOM's XPath to pass the tests in JAXEN? If you download jaxen, the tests are in src\java\test\org\jaxen\XPathTestBase.java, we need to extend that test case for AXIOM (for example see src\java\test\org\jaxen\dom\DocumentNavigatorTest.java on how they do it for DOM). 

thanks,
dims

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas

>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315458 ] 

Davanum Srinivas commented on AXIS2-70:
---------------------------------------

down to 14 errors (see attach test case) out of 62 total. finding holes in AXIOM. Ajith, please pick this up ASAP. 

-- dims

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: TestXPath2.java, x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-70?page=all ]
     
Davanum Srinivas resolved AXIS2-70:
-----------------------------------

    Resolution: Fixed

Done. Code is in SVN including the test harness from jaxen.

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: TestXPath2.java, x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-70?page=all ]

Davanum Srinivas updated AXIS2-70:
----------------------------------

    Attachment: x.xml

sample soap envelope

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315374 ] 

Davanum Srinivas commented on AXIS2-70:
---------------------------------------

FYI, Got this sample working...

=============================================================
import org.apache.axis2.om.xpath.DocumentNavigator;
import org.jaxen.BaseXPath;
import org.jaxen.Navigator;
import org.jaxen.XPath;

import java.io.File;
import java.util.Iterator;
import java.util.List;

public class TestXPath {
    public static void main(String[] args) throws Exception {
        File f = new File("C:\\JUNK\\x.xml");
        String url = f.toURL().toString();
        Navigator nav = new DocumentNavigator();
        System.out.println("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("/", nav);
        System.out.println("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            System.out.println(iter.next());
        }
    }
}
=============================================================


> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas

>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315407 ] 

Davanum Srinivas commented on AXIS2-70:
---------------------------------------

FYI, got all the example XPath statements here (http://webservices.xml.com/pub/a/ws/2003/09/16/jaxen.html) working. 

//*
//soap-env:Envelope/*
//soap-env:Envelope/soap-env:Body/*
//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/*
//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/Summary/*
//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/Summary/Mean
//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/Values/*
//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/Values/Value[@id='0']

using the following test program.
=========================================================================================
import org.apache.axis2.om.impl.llom.OMElementImpl;
import org.apache.axis2.om.xpath.DocumentNavigator;
import org.jaxen.BaseXPath;
import org.jaxen.Navigator;
import org.jaxen.SimpleNamespaceContext;
import org.jaxen.XPath;

import java.io.File;
import java.util.Iterator;
import java.util.List;

public class TestXPath {
    public static void main(String[] args) throws Exception {
        File f = new File("x.xml");
        String url = f.toURL().toString();
        Navigator nav = new DocumentNavigator();
        SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
        nsContext.addNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
        nsContext.addNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        nsContext.addNamespace("soapenc", "http://schemas.xmlsoap.org/soap/encoding/");
        nsContext.addNamespace("ns1", "http://namespaces.bigatti.it");
        System.out.println("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("//soap-env:Envelope/soap-env:Body/ns1:CalculateResponse/Values/Value[@id='0']", nav);
        contextpath.setNamespaceContext(nsContext);
        System.out.println("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Object o = iter.next();
            if (o instanceof OMElementImpl) {
                OMElementImpl omElement = ((OMElementImpl) o);
                if (omElement.getNamespace() != null)
                    System.out.println(omElement.getNamespace().getPrefix() + omElement.getLocalName() + "=" + omElement.getText());
                else
                    System.out.println(omElement.getLocalName() + "=" + omElement.getText());
            } else {
                System.out.println(o);
            }
        }
    }
}
=========================================================================================

will upload the x.xml as well.

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Ajith Harshana Ranabahu (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315478 ] 

Ajith Harshana Ranabahu commented on AXIS2-70:
----------------------------------------------

Hello Dims,
Sorry I did not comment on this issue earlier. I am definitley happy to help you and to tell the truth I did an Xpath implementation on AXIOM (based on Jaxen of course) sometime back . My code is at https://svn.apache.org/repos/asf/webservices/axis/trunk/archive/java/scratch/Ajith/XPath/src. I haven't had time to improve it or even go through it later. 
BTW I will have a look at your code tonight and pick it up from here.

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas
>  Attachments: TestXPath2.java, x.xml
>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315376 ] 

Davanum Srinivas commented on AXIS2-70:
---------------------------------------

Newly added code is here - http://svn.apache.org/viewcvs.cgi/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/

DocumentNavigator.java is where all the code is present that needs thorough review.

-- dims

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas

>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-70) XPath support for AXIOM

Posted by "Srinath Perera (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-70?page=comments#action_12315398 ] 

Srinath Perera commented on AXIS2-70:
-------------------------------------

As far as I know Ajith was doing (at least reserching) about the XPath support for AXIOM, belive he is the correct person to help you get the jaxen test case done. He was out of the preceeding becouse he was doing GRE, TOFEL at India. But he will be back by monday!

+1 for get it done for 1.0 if we can get it done without major hassle

> XPath support for AXIOM
> -----------------------
>
>          Key: AXIS2-70
>          URL: http://issues.apache.org/jira/browse/AXIS2-70
>      Project: Apache Axis 2.0 (Axis2)
>         Type: New Feature
>     Reporter: Davanum Srinivas

>
> Adding XPath support can be easily done using Jaxen. Involves implementing org.jaxen.Navigator.
> http://jaxen.org/apidocs/org/jaxen/Navigator.html
> More details in their FAQ (http://jaxen.org/faq.html)
> I'd highly recommend adding this to our 1.0 list.
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira