When you say it's not working, what exactly do you mean? What are the symptoms?
 
If the symptoms are that the path is not selecting anything, are you sure that the path is correct? For example, does it use namespace prefixes where necessary?
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Pushpendra Singh Sengar [mailto:pushpendra1412@gmail.com]
Sent: 22 March 2010 12:01
To: saxon-help
Subject: [saxon] dom document is not binding properly

Hi,
i want to bind dom document. but its not working. my code is following :

SaxonXQConnection con = new SaxonQuery().getConnection(domDocument);
            String parameter ="/"+parent+"/"+child;
            XQExpression xqe = con.createExpression();
            xqe.bindNode(XQConstants.CONTEXT_ITEM, domDocument, null);
           
            XQSequence rs1 = xqe.executeQuery("./"+ parameter);
            System.out.println("./"+ parameter+ "---" + rs1.next());
            while (rs1.next()) {
                SaxonXQItem item1 = (SaxonXQItem) rs1.getItem();
                 if (item1.getSaxonItem() instanceof NodeInfo && item1.getNode().getAttributes().getNamedItem(attr).getNodeValue().equals(value)) {
                        NodeInfo node = (NodeInfo) item1.getSaxonItem();
                        con.close();
                        return true;
                    } else if (item1.getSaxonItem() instanceof AtomicValue) {
                        con.close();
                        return false;
                    }
            }


--
Regards,
Pushpendra