Project

General

Profile

« Previous | Next » 

Revision 4346

Added by daigle over 15 years ago

add closing </distribution> tag to regex for inline data.

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
1369 1369
	 */
1370 1370
    private String stripInlineData(String xmlFileContents, String inLineKey) {
1371 1371
    	String changedString = xmlFileContents;
1372
    	String regex = "(<distribution .*id=\"" + inLineKey + "\">.*)<inline>.*</inline>";
1372
    	String regex = "(<distribution .*id=\"" + inLineKey + "\">.*)<inline>.*</inline>(.*<\\distribution>)";
1373 1373
    	Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); 
1374 1374
    	Matcher matcher = pattern.matcher(xmlFileContents);
1375 1375
    	if (matcher.find()) {
1376
    		changedString = matcher.replaceFirst(matcher.group(1) + "<inline></inline>");
1376
    		changedString = matcher.replaceFirst(matcher.group(1) + "<inline></inline>" + matcher.group(2));
1377 1377
    	}	
1378 1378
    	
1379 1379
    	return changedString;

Also available in: Unified diff