Hi,
 i want to access element child of following file :
<?xml version="1.0" encoding="UTF-8" ?>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:iris="http://www.irisindia.net/2010-03-31" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" elementFormDefault="qualified" targetNamespace="http://www.irisindia.net/2010-03-31">
- <annotation xmlns="">
- <appinfo>
- <link:roleType xlink:id="StatementOfConsolidatedFinancialPosition" xlink:roleURI="http://www.irisindia.net/StatementOfConsolidatedFinancialPosition">
  <link:definition>0020 - StatementOfConsolidatedFinancialPosition</link:definition>
  <link:usedOn>presentationLink</link:usedOn>
  <link:usedOn>calculationLink</link:usedOn>
  </link:roleType>
  </appinfo>
  </annotation>
  <element xmlns="" abstract="false" balance="debit" id="iris_Asset" name="Asset" nillable="true" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType" xbrli:periodType="instant" />
  <element xmlns="" abstract="false" balance="debit" id="iris_Asset123" name="Asset123" nillable="true" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType" xbrli:periodType="instant" />
  </schema>

my code is following :
public static boolean isFound(String parent, String child,String attr,String value,Document domDocument){
        try {
           
            con.getStaticContext().declareNamespace(
                    "xsd","http://www.w3.org/2001/XMLSchema");
        con.getStaticContext().declareNamespace(
                "link","http://www.xbrl.org/2003/linkbase");
        con.getStaticContext().declareNamespace(
                "xbrli", "http://www.xbrl.org/2003/instance");
        con.getStaticContext().setDefaultElementTypeNamespace(
                "http://www.xbrl.org/2003/linkbase");
        con.getStaticContext().setDefaultElementTypeNamespace(
                "http://www.w3.org/2001/XMLSchema");

            String parameter =parent+"/"+child;
            XQExpression xqe = con.createExpression();
            xqe.bindNode(XQConstants.CONTEXT_ITEM, domDocument, null);
            XQSequence rs1 = xqe.executeQuery("let $doc := . for $x in $doc//schema/element return $x");

            while (rs1.next()) {
                SaxonXQItem item1 = (SaxonXQItem) rs1.getItem();
                System.out.println( parameter+ "---" + item1.getNode().getNodeName());
                 if (item1.getSaxonItem() instanceof NodeInfo && item1.getNode().getAttributes().getNamedItem(attr).getNodeValue().equals(value)) {
                       
                     System.out.println("===inside=====");NodeInfo node = (NodeInfo) item1.getSaxonItem();
                        con.close();
                        return true;
                    } else if (item1.getSaxonItem() instanceof AtomicValue) {
                         System.out.println("===insideelse=====");
                        con.close();
                       
                        return false;
                    }
            }

            con.close();
        } catch (javax.xml.xquery.XQException xq) {
        xq.printStackTrace();
          System.out.println(xq.getStackTrace().toString());
        } catch (Exception ex) {
            //ex.printStackTrace();
        }
        return false;
    }


    public static void main(String args[]) {
  
         try{
   
        
             {
                 Document document = XMLReader.getReader("D:/bvf-20081231/bvf-20081231.xsd");
                 System.out.println(isFound("schema","element","id","iris_Asset123",document));
             }
         }
         catch (Exception e){
             e.printStackTrace();
         }

    }
}


bt its not working. if we change the query XQSequence rs1 = xqe.executeQuery("let $doc := . for $x in $doc//schema return $x"); then it return schema element.
pls help.
--
Regards,
Pushpendra