private static String dealxmlHeader(String xmlText)
{
String localXmlText=xmlText;
StringBuilder sb=new StringBuilder(xmlText);
StringBuilder newsb=new StringBuilder("");
String startstring=sb.substring(0,xmlText.indexOf("<?xml"));
String endstring=sb.substring(xmlText.indexOf("?>") + 2,xmlText.length());
newsb.append(startstring+endstring);
xmlText=new String(newsb.toString());
return xmlText;
}
private static String dealxml(String xmlText)
{
String localXmlText=new String(xmlText);
boolean flag=true;
while (flag){
localXmlText= dealxmlHeader(localXmlText);
if(localXmlText.indexOf("?>")<0)
{
flag=false;
}
}
return localXmlText;
}
|