String[] rootPathFrags = rootPath.replaceAll(Constants.XPATH_ELEM_INDEX_PATTERN,"").split(Constants.XPATH_SLASH); String[] columnPathFrags = columnPath.replaceAll(Constants.XPATH_ELEM_INDEX_PATTERN,"").split(Constants.XPATH_SLASH);
String[] rootPathFrags = rootPath.replaceAll(UtilConstants.XPATH_ELEM_INDEX_PATTERN,"").split(UtilConstants.XPATH_SLASH); String[] columnPathFrags = columnPath.replaceAll(UtilConstants.XPATH_ELEM_INDEX_PATTERN,"").split(UtilConstants.XPATH_SLASH);
	private static String getXPathExpression( String rootPath, String columnPath )	{		String[] rootPathFrags = rootPath.replaceAll(Constants.XPATH_ELEM_INDEX_PATTERN,"").split(Constants.XPATH_SLASH);		String[] columnPathFrags = columnPath.replaceAll(Constants.XPATH_ELEM_INDEX_PATTERN,"").split(Constants.XPATH_SLASH);				//The length of rootPathFrags and columnPathFrags should larger than 2,		//for the simplest path would be /elementName, which, if being splitted by "/",		//would produces a 2 element string array.		if( rootPathFrags.length < 2 || columnPathFrags.length < 2 )			return null;				//The position which starting the common part of root path and column path in columnPathFrags array.		int startingIndex = 0;				//The position which ending the common part of root path and column path in columnPathFrags array 		int endingIndex = 0;				//If rootPath starting with "//", then mean the rootPath is a relative path, else,		//the rootPath is an absolute path		if( !rootPath.startsWith(Constants.XPATH_DOUBLE_SLASH))		{			//If rootPath is absolute path, then the startingIndex must be 1.If not then			//the rootPath and columnPath has nothing in common.			if( !is2FragmentsEqual(columnPathFrags[1],rootPathFrags[1]))				return null;			else			{				rootPathFrags = (Constants.XPATH_SLASH+rootPath).split(Constants.XPATH_SLASH);			}		}				assert rootPathFrags.length >= 3;				String commonRoot = rootPathFrags[2];				startingIndex = getStartingIndex( columnPathFrags, commonRoot );				//If startingIndex == 0, that means the given column path do not have common		if( columnPathFrags.length < startingIndex+1 || startingIndex == 0)			return null;		endingIndex = getEndingIndex( rootPathFrags, columnPathFrags, startingIndex );				return populateXpathExpression( columnPath, rootPathFrags, startingIndex, endingIndex );	}