com.alachisoft.ncache.ncactivate.utils.XmlUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-activate Show documentation
Show all versions of nc-activate Show documentation
internal package of Alachisoft.
/*
* XmlUtil.java
*
* Created on October 7, 2006, 3:50 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.alachisoft.ncache.ncactivate.utils;
/**
* @author Administrator
*/
public class XmlUtil {
/**
* Creates a new instance of XmlUtil
*/
public XmlUtil() {
}
//////////////
//
// Extracts text between a starting and ending xml-tag.
//
public static boolean ExtractFromXML(String szTag, String szSource, StringRef szDestination) {
String szCloseTag = new String("");
int iStart, iEnd;
//public int indexOf(String str, int fromIndex)
szCloseTag += szTag.substring(1, szTag.length() - 1);
iStart = szSource.indexOf(szTag);//starting index of this xml tag
if (iStart == -1) return false;
iStart += szTag.length();
iEnd = szSource.indexOf(szCloseTag, iStart);
if (iEnd == -1) return false;
szDestination.strData = szSource.substring(iStart, iEnd);
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy