"return if($dtds) then $dtds[1] else \"NONE\"" ;
"return if($dtds) then $dtds[1] else \""+NOGRAMMAR+"\"" ; } else { logger.error("Unknown grammar type, not able to find query.");
    public String getGrammarQuery(int type, String id){ // TODO double        String query="NOQUERY";        if(type==GRAMMAR_XSD){            query = "let $top := collection('"+XSDBASE+"') " +                    "let $schemas := $top/xs:schema[ @targetNamespace = \"" + id+ "\" ] "+                    "return if($schemas) then document-uri($schemas[1]) else \"NONE\" " ;        } else if(type==GRAMMAR_DTD){            query = "let $top := doc('"+DTDCATALOG+"') "+                    "let $dtds := $top//public[@publicId = \""+id+"\"]/@uri " +                    "return if($dtds) then $dtds[1] else \"NONE\"" ;        }        logger.info(query);        return query;    }