path = path.replaceFirst( Constants.XPATH_SLASH, "" ); prefix = Constants.XPATH_SLASH;
path = path.replaceFirst( UtilConstants.XPATH_SLASH, "" ); prefix = UtilConstants.XPATH_SLASH;
	private String buildPath( String path )	{		String prefix = "";				//First remove the leading "//" or "/"		if ( path.startsWith( Constants.XPATH_DOUBLE_SLASH ) )		{			path = path.replaceFirst( Constants.XPATH_DOUBLE_SLASH, "" );			prefix = Constants.XPATH_DOUBLE_SLASH;		}		else if ( path.startsWith( Constants.XPATH_SLASH ) )		{			path = path.replaceFirst( Constants.XPATH_SLASH, "" );			prefix = Constants.XPATH_SLASH;		}		String[] temp = path.split( Constants.XPATH_SLASH );		for ( int i = 0; i < temp.length; i++ )		{			if ( temp[i].equals( ".." ) )			{				temp[i] = null;				for ( int j = i - 1; j >= 0; j-- )				{					if ( temp[j] != null )					{						temp[j] = null;						break;					}				}			}		}				//Rebuild the path.		path = prefix;		for ( int i = 0; i < temp.length; i++ )		{			if ( temp[i] != null )				path = i == 0 ? path + temp[i] : path + (temp[i].startsWith("[")?"":Constants.XPATH_SLASH) + temp[i];		}		return path;	}