Package net.sf.saxon.expr

Examples of net.sf.saxon.expr.Tokenizer


    return xml;
  }

  public static String replaceNameInPathOrQuery( String pathOrQuery, String oldName, String newName ) throws Exception
  {
    Tokenizer t = new Tokenizer();
    t.tokenize( pathOrQuery, 0, -1, 1 );
    StringBuffer result = new StringBuffer();
    int lastIx = 0;

    while( t.currentToken != Token.EOF )
    {
      if( t.currentToken == Token.NAME && t.currentTokenValue.equals( oldName ) )
      {
        result.append( pathOrQuery.substring( lastIx, t.currentTokenStartOffset ) );
        result.append( newName );
        lastIx = t.currentTokenStartOffset + t.currentTokenValue.length();
      }

      t.next();
    }

    if( lastIx < pathOrQuery.length() )
      result.append( pathOrQuery.substring( lastIx ) );
    //
View Full Code Here


        return xml;
    }

    public static String replaceNameInPathOrQuery(String pathOrQuery, String oldName, String newName) throws Exception {
        Tokenizer t = new Tokenizer();
        t.tokenize(pathOrQuery, 0, -1, 1);
        StringBuffer result = new StringBuffer();
        int lastIx = 0;

        while (t.currentToken != Token.EOF) {
            if (t.currentToken == Token.NAME && t.currentTokenValue.equals(oldName)) {
                result.append(pathOrQuery.substring(lastIx, t.currentTokenStartOffset));
                result.append(newName);
                lastIx = t.currentTokenStartOffset + t.currentTokenValue.length();
            }

            t.next();
        }

        if (lastIx < pathOrQuery.length()) {
            result.append(pathOrQuery.substring(lastIx));
        }
View Full Code Here

TOP

Related Classes of net.sf.saxon.expr.Tokenizer

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.