You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Alexandre Porcelli <al...@gmail.com> on 2005/03/01 19:39:36 UTC

Execute XPath or XQuery

When I try to execute the folowing code, I got an Exception with the
folowing message : "No query engine found".

Source Code:

import java.io.File;
import org.apache.xmlbeans.XmlObject;
import br.com.devexp.xttv1.XTTDocument;

public class TesteExec {

	public static void main(String[] args) 
	{
		try
		{
	        String xttName = "C:\\Documents and
Settings\\Administrator\\workspace\\TesteXPath\\file.xtt";
			XTTDocument xttDoc = XTTDocument.Factory.parse(new File(xttName));
		
			XmlObject xob[] = xttDoc.getXTT().execQuery(
"$this/XToken[@Name=\"ROOT\"]" );

			System.out.println ( xob.length );
			System.out.println ( xob[0].getDomNode().getNodeName() );

			for (XmlObject mobject : xob)
			{
				mobject.dump();
			}
		}
		catch (Exception e )
		{
			System.out.println ( e.getMessage() );
		}
	}
}


What I did wrong?

Regards,
Alexandre Porcelli

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Execute XPath or XQuery

Posted by Alexandre Porcelli <al...@gmail.com>.
When I try to execute the folowing code, I got an Exception with the
folowing message : "No query engine found".

Source Code:

import java.io.File;
import org.apache.xmlbeans.XmlObject;
import br.com.devexp.xttv1.XTTDocument;

public class TesteExec {

        public static void main(String[] args)
        {
                try
                {
                String xttName = "C:\\Documents and
Settings\\Administrator\\workspace\\TesteXPath\\file.xtt";
                        XTTDocument xttDoc =
XTTDocument.Factory.parse(new File(xttName));

                        XmlObject xob[] = xttDoc.getXTT().execQuery(
"$this/XToken[@Name=\"ROOT\"]" );

                        System.out.println ( xob.length );
                        System.out.println (
xob[0].getDomNode().getNodeName() );

                        for (XmlObject mobject : xob)
                        {
                                mobject.dump();
                        }
                }
                catch (Exception e )
                {
                        System.out.println ( e.getMessage() );
                }
        }
}

What I did wrong?

Regards,
Alexandre Porcelli

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org