X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/core/PHPDebugUtils.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/core/PHPDebugUtils.java new file mode 100644 index 0000000..8b377a7 --- /dev/null +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/core/PHPDebugUtils.java @@ -0,0 +1,57 @@ +package net.sourceforge.phpeclipse.xdebug.core; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public class PHPDebugUtils { + public static String getAttributeValue (Node CurrentNode, String AttributeName) { + String strValue = ""; + if (CurrentNode.hasAttributes()) { + NamedNodeMap listAttribute = CurrentNode.getAttributes(); + Node attribute = listAttribute.getNamedItem(AttributeName); + if (attribute !=null) + strValue = attribute.getNodeValue(); + } + return strValue; + } + + public static String escapeString(String string) { + StringBuffer escString=new StringBuffer(); + Pattern pattern = Pattern.compile("[a-zA-Z0-9\\._-]"); + Matcher matcher; + for (int i= 0; i2) + string.append(s[i].substring(2)); + + } + return string.toString(); + + } + + +}