modeler/angular/app/scripts/lib/codemirror/mode/xquery/xquery.js
function tokenAttribute(stream, state) {
    var ch = stream.next();
    
    if(ch == "/" && stream.eat(">")) {
      if(isInXmlAttributeBlock(state)) popStateStack(state);
      if(isInXmlBlock(state)) popStateStack(state);
      return ret("tag", "tag");
    }
    if(ch == ">") {
      if(isInXmlAttributeBlock(state)) popStateStack(state);
      return ret("tag", "tag");
    }
    if(ch == "=")
      return ret("", "");
    // quoted string
    if (ch == '"' || ch == "'")
      return chain(stream, state, tokenString(ch, tokenAttribute));

    if(!isInXmlAttributeBlock(state)) 
      pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute});

    stream.eat(/[a-zA-Z_:]/);
    stream.eatWhile(/[-a-zA-Z0-9_:.]/);
    stream.eatSpace();

    // the case where the attribute has not value and the tag was closed
    if(stream.match(">", false) || stream.match("/", false)) {
      popStateStack(state);
      state.tokenize = tokenBase;      
    }

    return ret("attribute", "attribute");
  }
function tokenAttribute(stream, state) {
    var ch = stream.next();
    
    if(ch == "/" && stream.eat(">")) {
      if(isInXmlAttributeBlock(state)) popStateStack(state);
      if(isInXmlBlock(state)) popStateStack(state);
      return ret("tag", "tag");
    }
    if(ch == ">") {
      if(isInXmlAttributeBlock(state)) popStateStack(state);
      return ret("tag", "tag");
    }
    if(ch == "=")
      return ret("", "");
    // quoted string
    if (ch == '"' || ch == "'")
      return chain(stream, state, tokenString(ch, tokenAttribute));

    if(!isInXmlAttributeBlock(state)) 
      pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute});

    stream.eat(/[a-zA-Z_:]/);
    stream.eatWhile(/[-a-zA-Z0-9_:.]/);
    stream.eatSpace();

    // the case where the attribute has not value and the tag was closed
    if(stream.match(">", false) || stream.match("/", false)) {
      popStateStack(state);
      state.tokenize = tokenBase;      
    }

    return ret("attribute", "attribute");
  }
function tokenAttribute ( stream , state ) { var ch = stream . next ( ) ; if ( ch == "/" && stream . eat ( ">" ) ) { if ( isInXmlAttributeBlock ( state ) ) popStateStack ( state ) ; if ( isInXmlBlock ( state ) ) popStateStack ( state ) ; return ret ( "tag" , "tag" ) ; } if ( ch == ">" ) { if ( isInXmlAttributeBlock ( state ) ) popStateStack ( state ) ; return ret ( "tag" , "tag" ) ; } if ( ch == "=" ) return ret ( "" , "" ) ; // quoted string if ( ch == '"' || ch == "'" ) return chain ( stream , state , tokenString ( ch , tokenAttribute ) ) ; if ( ! isInXmlAttributeBlock ( state ) ) pushStateStack ( state , { type : "attribute" , name : name , tokenize : tokenAttribute } ) ; stream . eat ( / [a-zA-Z_:] / ) ; stream . eatWhile ( / [-a-zA-Z0-9_:.] / ) ; stream . eatSpace ( ) ; // the case where the attribute has not value and the tag was closed if ( stream . match ( ">" , false ) || stream . match ( "/" , false ) ) { popStateStack ( state ) ; state . tokenize = tokenBase ; } return ret ( "attribute" , "attribute" ) ; }
tokenizer for XML attributes
tokenizer for XML attributes