xml string fixer

- The entity name must immediately follow the ‘&’ in the entity reference

gibi hatalarda aşağıdaki xml fixer’ı kullanabilirsiniz. Bu tarz hatalar xml’e çevirmeye çalıştığınız stringdeki yapısal bozukluklardan kaynaklanmaktadır.

private String xmlFixer(String xmlString) {
xmlString = xmlString.replaceAll(“&([^; ]*);”, “||VALIDXMLTAG||$1;”);
xmlString = xmlString.replaceAll(“&”,”&”);
xmlString = xmlString.replaceAll(“\\|\\|VALIDXMLTAG\\|\\|([^; ]*);”, “&$1;”);
return (xmlString);
}

 

java genel kategorisinde yayınlandı. » yorum bırak;

Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s

Follow

Get every new post delivered to your Inbox.