title: Saxon 8 (Java version) problem
body: <p>I'll point out now, that I'm new to using saxon, and I've tried following the docs and examples in the package, but I'm just not having luck with this problem.</p>
  
  <p>Basically, I'm trying to do some xml processing in java using saxon v8.  In order to get something working, I took one of the sample files included in the package and modified to my needs.  It works so long as I'm not using namespaces, and that is my question.  How can I get around the namespace problem?  I don't really care to use it, but it exists in my xml, so I either have to use it or ignore it.  Either solution is fine.</p>
  
  <p>Anyway, here is my starter code.  It doesn't do anything but take an xpath query try to use it against the hard coded xml doc.</p>
  
  <pre><code>public static void main(String[] args) {
      String query = args[0];
  
      File XMLStream=null;
      String xmlFileName="doc.xml";
      OutputStream destStream=System.out;
      XQueryExpression exp=null;
      Configuration C=new Configuration();
      C.setSchemaValidation(false);
      C.setValidation(false);
  
      StaticQueryContext SQC=new StaticQueryContext(C);
      DynamicQueryContext DQC=new DynamicQueryContext(C);      
      QueryProcessor processor = new QueryProcessor(SQC);
      Properties props=new Properties();
      try{   
          exp=processor.compileQuery(query);
          XMLStream=new File(xmlFileName);
          InputSource XMLSource=new InputSource(XMLStream.toURI().toString());
          SAXSource SAXs=new SAXSource(XMLSource); 
          DocumentInfo DI=SQC.buildDocument(SAXs);
          DQC.setContextNode(DI);
  
          SequenceIterator iter = exp.iterator(DQC);
          while(true){
              Item i = iter.next();
              if(i != null){
                  System.out.println(i.getStringValue());
              }
              else break;
          }
      }
      catch (Exception e){
          System.err.println(e.getMessage());
      }
  }   
  </code></pre>
  
  <p>An example XML file is here...</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;ns1:animal xmlns:ns1="http://my.catservice.org/"&gt;
      &lt;cat&gt;
          &lt;catId&gt;8889&lt;/catId&gt;
          &lt;fedStatus&gt;true&lt;/fedStatus&gt;
      &lt;/cat&gt;
  &lt;/ns1:animal&gt;
  </code></pre>
  
  <p>If I run this with a query including the namespace, I get an error.  For example:
  <code>/ns1:animal/cat/</code> gives the error: "Prefix ns1 has not been declared".</p>
  
  <p>If I remove the ns1: from the query, it gives me nothing.  If I doctor the xml to remove the "ns1:" prepended to "animal" I can run the query <code>/animal/cat/</code> with success.</p>
  
  <p>Any help would be greatly appreciated.  Thanks.</p>