Package org.exist.dom

Examples of org.exist.dom.QName


      AST __t82 = _t;
      t = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
      match(_t,ATOMIC_TYPE);
      _t = _t.getFirstChild();
     
              QName qn= QName.parse(staticContext, t.getText());
              int code= Type.getType(qn);
              if(!Type.subTypeOf(code, Type.ATOMIC))
                throw new XPathException(t, "Type " + qn.toString() + " is not an atomic type");
              type.setPrimaryType(code);
           
      _t = __t82;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_empty:
    {
      AST __t83 = _t;
      org.exist.xquery.parser.XQueryAST tmp59_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_empty);
      _t = _t.getFirstChild();
     
              type.setPrimaryType(Type.EMPTY);
              type.setCardinality(Cardinality.EMPTY);
           
      _t = __t83;
      _t = _t.getNextSibling();
      break;
    }
    case 107:
    {
      AST __t84 = _t;
      org.exist.xquery.parser.XQueryAST tmp60_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,107);
      _t = _t.getFirstChild();
     
              type.setPrimaryType(Type.EMPTY);
              type.setCardinality(Cardinality.EMPTY);
           
      _t = __t84;
      _t = _t.getNextSibling();
      break;
    }
    case FUNCTION_TEST:
    {
      AST __t85 = _t;
      org.exist.xquery.parser.XQueryAST tmp61_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,FUNCTION_TEST);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.FUNCTION_REFERENCE);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case STAR:
      {
        org.exist.xquery.parser.XQueryAST tmp62_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,STAR);
        _t = _t.getNextSibling();
        break;
      }
      case FUNCTION_TEST:
      case MAP_TEST:
      case ATOMIC_TYPE:
      case ATTRIBUTE_TEST:
      case LITERAL_element:
      case LITERAL_empty:
      case LITERAL_as:
      case 107:
      case LITERAL_item:
      case LITERAL_text:
      case LITERAL_node:
      case LITERAL_comment:
      case 186:
      case 187:
      {
        {
        List<SequenceType> paramTypes = new ArrayList<SequenceType>(5);
        {
        _loop89:
        do {
          if (_t==null) _t=ASTNULL;
          if ((_tokenSet_3.member(_t.getType()))) {
            SequenceType paramType = new SequenceType();
            sequenceType(_t,paramType);
            _t = _retTree;
            paramTypes.add(paramType);
          }
          else {
            break _loop89;
          }
         
        } while (true);
        }
        SequenceType returnType = new SequenceType();
        org.exist.xquery.parser.XQueryAST tmp63_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_as);
        _t = _t.getNextSibling();
        sequenceType(_t,returnType);
        _t = _retTree;
        }
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
      _t = __t85;
      _t = _t.getNextSibling();
      break;
    }
    case MAP_TEST:
    {
      AST __t90 = _t;
      org.exist.xquery.parser.XQueryAST tmp64_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,MAP_TEST);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.MAP);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case STAR:
      {
        org.exist.xquery.parser.XQueryAST tmp65_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,STAR);
        _t = _t.getNextSibling();
        break;
      }
      case 3:
      case FUNCTION_TEST:
      case MAP_TEST:
      case ATOMIC_TYPE:
      case ATTRIBUTE_TEST:
      case LITERAL_element:
      case LITERAL_empty:
      case 107:
      case LITERAL_item:
      case LITERAL_text:
      case LITERAL_node:
      case LITERAL_comment:
      case 186:
      case 187:
      {
        {
        List<SequenceType> paramTypes = new ArrayList<SequenceType>(5);
        {
        _loop94:
        do {
          if (_t==null) _t=ASTNULL;
          if ((_tokenSet_3.member(_t.getType()))) {
            SequenceType paramType = new SequenceType();
            sequenceType(_t,paramType);
            _t = _retTree;
            paramTypes.add(paramType);
          }
          else {
            break _loop94;
          }
         
        } while (true);
        }
        }
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
      _t = __t90;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_item:
    {
      AST __t95 = _t;
      org.exist.xquery.parser.XQueryAST tmp66_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_item);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.ITEM);
      _t = __t95;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_node:
    {
      AST __t96 = _t;
      org.exist.xquery.parser.XQueryAST tmp67_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_node);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.NODE);
      _t = __t96;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_element:
    {
      AST __t97 = _t;
      lelement = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_element);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.ELEMENT);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case WILDCARD:
      {
        org.exist.xquery.parser.XQueryAST tmp68_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,WILDCARD);
        _t = _t.getNextSibling();
        break;
      }
      case QNAME:
      {
        qn1 = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,QNAME);
        _t = _t.getNextSibling();
       
                  try {
                    QName qname= QName.parse(staticContext, qn1.getText());
                    type.setNodeName(qname);
                  } catch (XPathException e) {
                    e.setLocation(lelement.getLine(), lelement.getColumn());
          throw e;
                  }
               
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case QNAME:
        {
          qn12 = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
         
                      try {
                                    QName qname12= QName.parse(staticContext, qn12.getText());
                                    TypeTest test = new TypeTest(Type.getType(qname12));
                                } catch (XPathException e) {
                        e.setLocation(lelement.getLine(), lelement.getColumn());
                                  throw e;
                      }
                   
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        break;
      }
      case 3:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
      _t = __t97;
      _t = _t.getNextSibling();
      break;
    }
    case ATTRIBUTE_TEST:
    {
      AST __t100 = _t;
      lattr = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
      match(_t,ATTRIBUTE_TEST);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.ATTRIBUTE);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case QNAME:
      {
        qn2 = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,QNAME);
        _t = _t.getNextSibling();
       
                  try {
                              QName qname= QName.parse(staticContext, qn2.getText(), "");
                              qname.setNameType(ElementValue.ATTRIBUTE);
                    type.setNodeName(qname);
                  } catch (XPathException e) {
                    e.setLocation(lattr.getLine(), lattr.getColumn());
          throw e;
                  }
               
        break;
      }
      case WILDCARD:
      {
        org.exist.xquery.parser.XQueryAST tmp69_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,WILDCARD);
        _t = _t.getNextSibling();
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case QNAME:
        {
          qn21 = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
         
                      try {
                                    QName qname21= QName.parse(staticContext, qn21.getText());
                                    TypeTest test = new TypeTest(Type.getType(qname21));
                                } catch (XPathException e) {
                                  e.setLocation(lattr.getLine(), lattr.getColumn());
                                  throw e;
                                }
                   
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        break;
      }
      case 3:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
      _t = __t100;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_text:
    {
      AST __t103 = _t;
      org.exist.xquery.parser.XQueryAST tmp70_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_text);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.TEXT);
      _t = __t103;
      _t = _t.getNextSibling();
      break;
    }
    case 186:
    {
      AST __t104 = _t;
      org.exist.xquery.parser.XQueryAST tmp71_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,186);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.PROCESSING_INSTRUCTION);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case NCNAME:
      {
        nc = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,NCNAME);
        _t = _t.getNextSibling();
        break;
      }
      case STRING_LITERAL:
      {
        sl = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,STRING_LITERAL);
        _t = _t.getNextSibling();
        break;
      }
      case 3:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
     
      String value = "";
      if (nc != null)
      value = nc.getText();
      if (sl != null)
      value = sl.getText();
      QName qname= new QName(value, "", null);
      qname.setNamespaceURI(null);
      if (!"".equals(value))
      type.setNodeName(qname);
     
      _t = __t104;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_comment:
    {
      AST __t106 = _t;
      org.exist.xquery.parser.XQueryAST tmp72_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_comment);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.COMMENT);
      _t = __t106;
      _t = _t.getNextSibling();
      break;
    }
    case 187:
    {
      AST __t107 = _t;
      org.exist.xquery.parser.XQueryAST tmp73_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,187);
      _t = _t.getFirstChild();
      type.setPrimaryType(Type.DOCUMENT);
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case LITERAL_element:
      {
        AST __t109 = _t;
        lelement2 = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_element);
        _t = _t.getFirstChild();
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case QNAME:
        {
          dnqn = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
         
            try {
                          QName qname= QName.parse(staticContext, dnqn.getText());
                                    type.setNodeName(qname);
                                    NameTest test= new NameTest(Type.DOCUMENT, qname);
                                } catch(XPathException e) {
                                  e.setLocation(lelement2.getLine(), lelement2.getColumn());
                                  throw e;
                                }
         
          break;
        }
        case WILDCARD:
        {
          org.exist.xquery.parser.XQueryAST tmp74_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,WILDCARD);
          _t = _t.getNextSibling();
         
          TypeTest test= new TypeTest(Type.DOCUMENT);
         
          {
          if (_t==null) _t=ASTNULL;
          switch ( _t.getType()) {
          case QNAME:
          {
            dnqn2 = (org.exist.xquery.parser.XQueryAST)_t;
            match(_t,QNAME);
            _t = _t.getNextSibling();
           
              try {
                                            QName qname = QName.parse(staticContext, dnqn2.getText());
                                            test = new TypeTest(Type.getType(qname));
                                        } catch(XPathException e) {
                                          e.setLocation(lelement2.getLine(), lelement2.getColumn());
                                        throw e;
                                        }
View Full Code Here


   
          PathExpr body= new PathExpr(context);
          boolean inline = name.getText() == null;
       
   
          QName qn= null;
          try {
            if (!inline)
              qn = QName.parse(staticContext, name.getText(), staticContext.getDefaultFunctionNamespace());
            else
              qn = InlineFunction.INLINE_FUNCTION_QNAME;
View Full Code Here

    AST __t49 = _t;
    name = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
    match(_t,ANNOT_DECL);
    _t = _t.getFirstChild();
   
    QName qn= null;
    try {
    qn = QName.parse(staticContext, name.getText(), staticContext.getDefaultFunctionNamespace());
    } catch(XPathException e) {
    // throw exception with correct source location
    e.setLocation(name.getLine(), name.getColumn());
    throw e;
    }
   
    String ns = qn.getNamespaceURI();
   
    if(!annotationValid(qn)) {
    XPathException e = new XPathException(ErrorCodes.XQST0045,
                  "Annotation in a reserved namespace: " + qn.getNamespaceURI());
                e.setLocation(name.getLine(), name.getColumn());
                throw e;
    }
   
    annotList.add(qn);
View Full Code Here

        throw new NoViableAltException(_t);
      }
      }
      }
     
            QName qn= QName.parse(staticContext, t.getText());
            int code= Type.getType(qn);
            CastExpression castExpr= new CastExpression(context, expr, code, cardinality);
            castExpr.setASTNode(castAST);
            path.add(castExpr);
            step = castExpr;
         
      _t = __t326;
      _t = _t.getNextSibling();
      break;
    }
    case LITERAL_castable:
    {
      AST __t328 = _t;
      castableAST = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LITERAL_castable);
      _t = _t.getFirstChild();
      step=expr(_t,expr);
      _t = _retTree;
      t2 = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,ATOMIC_TYPE);
      _t = _t.getNextSibling();
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case QUESTION:
      {
        org.exist.xquery.parser.XQueryAST tmp88_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,QUESTION);
        _t = _t.getNextSibling();
        cardinality= Cardinality.ZERO_OR_ONE;
        break;
      }
      case 3:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
     
            QName qn= QName.parse(staticContext, t2.getText());
            int code= Type.getType(qn);
            CastableExpression castExpr= new CastableExpression(context, expr, code, cardinality);
            castExpr.setASTNode(castAST);
            path.add(castExpr);
            step = castExpr;
View Full Code Here

        qn = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,QNAME);
        _t = _t.getNextSibling();
       
              try {
                QName qname= QName.parse(staticContext, qn.getText());
                if (axis == Constants.ATTRIBUTE_AXIS) {
                          //qname.setNamespaceURI(null);
                          test= new NameTest(Type.ATTRIBUTE, qname);
                          qname.setNameType(ElementValue.ATTRIBUTE);
                      } else {
                          test= new NameTest(Type.ELEMENT, qname);
                      }
                ast = qn;
              } catch(XPathException ex1) {
                ex1.setLocation(qn.getLine(), qn.getColumn());
                throw ex1;
              }
           
        break;
      }
      case PREFIX_WILDCARD:
      {
        AST __t210 = _t;
        org.exist.xquery.parser.XQueryAST tmp92_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,PREFIX_WILDCARD);
        _t = _t.getFirstChild();
        nc1 = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,NCNAME);
        _t = _t.getNextSibling();
        _t = __t210;
        _t = _t.getNextSibling();
       
              try {
                QName qname= new QName(nc1.getText(), null, null);
                qname.setNamespaceURI(null);
                test= new NameTest(Type.ELEMENT, qname);
                if (axis == Constants.ATTRIBUTE_AXIS)
                  test.setType(Type.ATTRIBUTE);
                ast = nc1;
              } catch(XPathException ex2) {
                ex2.setLocation(nc1.getLine(), nc1.getColumn());
              }
           
        break;
      }
      case NCNAME:
      {
        AST __t211 = _t;
        nc = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,NCNAME);
        _t = _t.getFirstChild();
        org.exist.xquery.parser.XQueryAST tmp93_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,WILDCARD);
        _t = _t.getNextSibling();
        _t = __t211;
        _t = _t.getNextSibling();
       
              try {
                String namespaceURI= staticContext.getURIForPrefix(nc.getText());
                QName qname= new QName(null, namespaceURI, nc.getText());
                test= new NameTest(Type.ELEMENT, qname);
                if (axis == Constants.ATTRIBUTE_AXIS)
                  test.setType(Type.ATTRIBUTE);
                ast = nc;
              } catch(XPathException ex3) {
                ex3.setLocation(nc1.getLine(), nc1.getColumn());
              }
           
        break;
      }
      case WILDCARD:
      {
        w = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,WILDCARD);
        _t = _t.getNextSibling();
       
              if (axis == Constants.ATTRIBUTE_AXIS)
                test= new TypeTest(Type.ATTRIBUTE);
              else
                test= new TypeTest(Type.ELEMENT);
              ast = w;
           
        break;
      }
      case LITERAL_node:
      {
        n = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_node);
        _t = _t.getNextSibling();
       
              if (axis == Constants.ATTRIBUTE_AXIS) {
              //  throw new XPathException(n, "Cannot test for node() on the attribute axis");
                 test= new TypeTest(Type.ATTRIBUTE);
        } else {
                 test= new AnyNodeTest();
        }
              ast = n;
           
        break;
      }
      case LITERAL_text:
      {
        t = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_text);
        _t = _t.getNextSibling();
       
              if (axis == Constants.ATTRIBUTE_AXIS)
                throw new XPathException(t, "Cannot test for text() on the attribute axis");
              test= new TypeTest(Type.TEXT);
              ast = t;
           
        break;
      }
      case LITERAL_element:
      {
        AST __t212 = _t;
        e = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_element);
        _t = _t.getFirstChild();
       
                if (axis == Constants.ATTRIBUTE_AXIS)
                  throw new XPathException(e, "Cannot test for element() on the attribute axis");
                test= new TypeTest(Type.ELEMENT);
                ast = e;
             
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case QNAME:
        {
          qn2 = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
         
                    QName qname= QName.parse(staticContext, qn2.getText());
                    test= new NameTest(Type.ELEMENT, qname);
                 
          break;
        }
        case WILDCARD:
        {
          org.exist.xquery.parser.XQueryAST tmp94_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,WILDCARD);
          _t = _t.getNextSibling();
          {
          if (_t==null) _t=ASTNULL;
          switch ( _t.getType()) {
          case QNAME:
          {
            qn21 = (org.exist.xquery.parser.XQueryAST)_t;
            match(_t,QNAME);
            _t = _t.getNextSibling();
           
            QName qname= QName.parse(staticContext, qn21.getText());
            test = new TypeTest(Type.getType(qname));
                     
            break;
          }
          case 3:
          {
            break;
          }
          default:
          {
            throw new NoViableAltException(_t);
          }
          }
          }
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        _t = __t212;
        _t = _t.getNextSibling();
        break;
      }
      case ATTRIBUTE_TEST:
      {
        AST __t215 = _t;
        att = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,ATTRIBUTE_TEST);
        _t = _t.getFirstChild();
       
                test= new TypeTest(Type.ATTRIBUTE);
                ast = att;
             
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case QNAME:
        {
          qn3 = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
         
                    QName qname= QName.parse(staticContext, qn3.getText());
                    test= new NameTest(Type.ATTRIBUTE, qname);
                    qname.setNameType(ElementValue.ATTRIBUTE);
                    axis= Constants.ATTRIBUTE_AXIS;
                 
          break;
        }
        case WILDCARD:
        {
          org.exist.xquery.parser.XQueryAST tmp95_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,WILDCARD);
          _t = _t.getNextSibling();
          {
          if (_t==null) _t=ASTNULL;
          switch ( _t.getType()) {
          case QNAME:
          {
            qn31 = (org.exist.xquery.parser.XQueryAST)_t;
            match(_t,QNAME);
            _t = _t.getNextSibling();
           
            QName qname= QName.parse(staticContext, qn31.getText());
            test = new TypeTest(Type.getType(qname));
                     
            break;
          }
          case 3:
          {
            break;
          }
          default:
          {
            throw new NoViableAltException(_t);
          }
          }
          }
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        _t = __t215;
        _t = _t.getNextSibling();
        break;
      }
      case LITERAL_comment:
      {
        com = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,LITERAL_comment);
        _t = _t.getNextSibling();
       
              if (axis == Constants.ATTRIBUTE_AXIS)
                throw new XPathException(n, "Cannot test for comment() on the attribute axis");
              test= new TypeTest(Type.COMMENT);
              ast = com;
           
        break;
      }
      case 186:
      {
        AST __t218 = _t;
        pi = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,186);
        _t = _t.getFirstChild();
       
              if (axis == Constants.ATTRIBUTE_AXIS)
                throw new XPathException(n, "Cannot test for processing-instruction() on the attribute axis");
              test= new TypeTest(Type.PROCESSING_INSTRUCTION);
              ast = pi;
           
        {
        if (_t==null) _t=ASTNULL;
        switch ( _t.getType()) {
        case NCNAME:
        {
          ncpi = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,NCNAME);
          _t = _t.getNextSibling();
         
          QName qname;
          qname= new QName(ncpi.getText(), "", null);
          test= new NameTest(Type.PROCESSING_INSTRUCTION, qname);
         
          break;
        }
        case STRING_LITERAL:
        {
          slpi = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,STRING_LITERAL);
          _t = _t.getNextSibling();
         
          QName qname;
          qname= new QName(slpi.getText(), "", null);               
          test= new NameTest(Type.PROCESSING_INSTRUCTION, qname);
         
          break;
        }
        case 3:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(_t);
        }
        }
        }
        _t = __t218;
        _t = _t.getNextSibling();
        break;
      }
      case 187:
      {
        dn = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,187);
        _t = _t.getNextSibling();
       
              test= new TypeTest(Type.DOCUMENT);
              ast = dn;
           
        {
        if (_t==null) _t=ASTNULL;
        if ((_t.getType()==LITERAL_element)) {
          AST __t221 = _t;
          org.exist.xquery.parser.XQueryAST tmp96_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,LITERAL_element);
          _t = _t.getFirstChild();
          {
          if (_t==null) _t=ASTNULL;
          switch ( _t.getType()) {
          case QNAME:
          {
            dnqn = (org.exist.xquery.parser.XQueryAST)_t;
            match(_t,QNAME);
            _t = _t.getNextSibling();
           
            QName qname= QName.parse(staticContext, dnqn.getText());
            test= new NameTest(Type.DOCUMENT, qname);
           
            break;
          }
          case WILDCARD:
          {
            org.exist.xquery.parser.XQueryAST tmp97_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
            match(_t,WILDCARD);
            _t = _t.getNextSibling();
            {
            if (_t==null) _t=ASTNULL;
            switch ( _t.getType()) {
            case QNAME:
            {
              dnqn1 = (org.exist.xquery.parser.XQueryAST)_t;
              match(_t,QNAME);
              _t = _t.getNextSibling();
             
              QName qname= QName.parse(staticContext, dnqn1.getText());
              test= new TypeTest(Type.getType(qname));
             
              break;
            }
            case 3:
            {
              break;
            }
            default:
            {
              throw new NoViableAltException(_t);
            }
            }
            }
            break;
          }
          case 3:
          {
            break;
          }
          default:
          {
            throw new NoViableAltException(_t);
          }
          }
          }
          _t = __t221;
          _t = _t.getNextSibling();
        }
        else if ((_t.getType()==209)) {
          AST __t224 = _t;
          org.exist.xquery.parser.XQueryAST tmp98_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,209);
          _t = _t.getFirstChild();
          org.exist.xquery.parser.XQueryAST tmp99_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
          match(_t,QNAME);
          _t = _t.getNextSibling();
          _t = __t224;
          _t = _t.getNextSibling();
        }
        else if ((_tokenSet_7.member(_t.getType()))) {
        }
        else {
          throw new NoViableAltException(_t);
        }
       
        }
        break;
      }
      default:
      {
        throw new NoViableAltException(_t);
      }
      }
      }
     
          step= new LocationStep(context, axis, test);
          path.add(step);
          if (ast != null)
            step.setASTNode(ast);
       
      {
      _loop226:
      do {
        if (_t==null) _t=ASTNULL;
        if ((_t.getType()==PREDICATE)) {
          predicate(_t,(LocationStep) step);
          _t = _retTree;
        }
        else {
          break _loop226;
        }
       
      } while (true);
      }
      break;
    }
    case AT:
    {
      at = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,AT);
      _t = _t.getNextSibling();
      QName qname= null;
      {
      if (_t==null) _t=ASTNULL;
      switch ( _t.getType()) {
      case QNAME:
      {
        attr = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,QNAME);
        _t = _t.getNextSibling();
       
        qname= QName.parse(staticContext, attr.getText(), "");
        qname.setNameType(ElementValue.ATTRIBUTE);
       
        break;
      }
      case PREFIX_WILDCARD:
      {
        AST __t228 = _t;
        org.exist.xquery.parser.XQueryAST tmp100_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,PREFIX_WILDCARD);
        _t = _t.getFirstChild();
        nc2 = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,NCNAME);
        _t = _t.getNextSibling();
        _t = __t228;
        _t = _t.getNextSibling();
       
        qname= new QName(nc2.getText(), null, null);
        qname.setNamespaceURI(null);
        qname.setNameType(ElementValue.ATTRIBUTE);
           
        break;
      }
      case NCNAME:
      {
        AST __t229 = _t;
        nc3 = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
        match(_t,NCNAME);
        _t = _t.getFirstChild();
        org.exist.xquery.parser.XQueryAST tmp101_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,WILDCARD);
        _t = _t.getNextSibling();
        _t = __t229;
        _t = _t.getNextSibling();
       
              String namespaceURI= staticContext.getURIForPrefix(nc3.getText());
              if (namespaceURI == null)
                throw new EXistException("No namespace defined for prefix " + nc3.getText());
              qname= new QName(null, namespaceURI, null);
              qname.setNameType(ElementValue.ATTRIBUTE);
           
        break;
      }
      case WILDCARD:
      {
View Full Code Here

            //Nothing to do
        } catch (final XPathException e) {
            //Nothing to do
        }
        if (scanner.getNamespace() != null) {
            return new QName(scanner.getPrefix(), scanner.getNamespace());
        }
        return null;
    }
View Full Code Here

         
      qna = _t==ASTNULL ? null : (org.exist.xquery.parser.XQueryAST)_t;
      qnameExpr=expr(_t,qnamePathExpr);
      _t = _retTree;
     
      QName qname = QName.parse(staticContext, qna.getText());
      if (Namespaces.XMLNS_NS.equals(qname.getNamespaceURI())
      || ("".equals(qname.getNamespaceURI()) && qname.getLocalName().equals("xmlns")))
      throw new XPathException("err:XQDY0044: the node-name property of the node constructed by a computed attribute constructor is in the namespace http://www.w3.org/2000/xmlns/ (corresponding to namespace prefix xmlns), or is in no namespace and has local name xmlns.");
     
      AST __t303 = _t;
      org.exist.xquery.parser.XQueryAST tmp116_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
      match(_t,LCURLY);
View Full Code Here

        switch( getType() ) {
            case Type.DOCUMENT:
                return( "#document" );
            case Type.ELEMENT:
            case Type.PROCESSING_INSTRUCTION:
                final QName qn = document.nodeName[nodeNumber];
                //TODO : check !
                return( qn.getStringValue() );
            case Type.ATTRIBUTE:
                return( ( document.attrName[nodeNumber] ).getStringValue() );
            case Type.NAMESPACE:
                return( ( document.namespaceCode[nodeNumber] ).getStringValue() );
            case Type.TEXT:
View Full Code Here

    public QName getQName() {
        switch( getNodeType() ) {
            case Node.ATTRIBUTE_NODE:
            case Node.ELEMENT_NODE:
            case Node.PROCESSING_INSTRUCTION_NODE:
                final QName qn = document.nodeName[nodeNumber];
                return( qn );
            case Node.DOCUMENT_NODE:
                return( QName.EMPTY_QNAME );
            case Node.COMMENT_NODE:
                return( QName.EMPTY_QNAME );
View Full Code Here

                                attrs.addAttribute( "", "file", "file", "CDATA", files[i].getName() );
                                builder.startElement( BACKUP_ELEMENT, attrs );

                                for( final Iterator<Object> iter = properties.keySet().iterator(); iter.hasNext(); ) {
                                    final String key = iter.next().toString();
                                    builder.startElement( new QName( key, Namespaces.EXIST_NS, "" ), null );
                                    builder.characters( (String)properties.get( key ) );
                                    builder.endElement();
                                }
                                builder.endElement();
                            }
View Full Code Here

TOP

Related Classes of org.exist.dom.QName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.