Expand|Select|Wrap|Line Numbers
- if(isPathNode(appRoot+"ExternalAddress/InternationalAddress/IntAddressLine"))
Then in the following block of code, 'doc' is a valid xml document.
Expand|Select|Wrap|Line Numbers
- private boolean isPathNode(String strPath) {
- return(isXPathNode(doc,strPath));
- }
- private boolean isXPathNode(org.w3c.dom.Node objRoot,String strPath) {
- try {
- org.w3c.dom.Node objNode;
- if(strPath.length()==0) {
- return(false);
- }
- if((objNode=XPathAPI.selectSingleNode(objRoot,strPath))==null) {
- return(false);
- }
- return(true);
- } catch(Exception e) {
- System.out.println("isXPathValue: "+e.toString());
- return(false);
- }
- }