|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Find out whether a document has namespace defined
HI: I have the following code that parses an input file into an xml doc.This input file has namespace associated with it. XMLDocument xmlDocument = null; DOMParser parser = new DOMParser(); parser.setValidationMode(XMLConstants.NONVALIDATING); parser.parse(in_xml_url); //input file xmlDocument = parser.getDocument(); LocalNSResolver lnsr = new LocalNSResolver(); lnsr.addNamespacePrefix("ns", "http://www.oracle.com/discoverer/configuration"); NodeList nodeList=xmlDocument.selectNodes("/ns:applet/transport", lnsr); I want to feed an input file having no namespace or prefix to this code, is there a method or something available on the xmlDocument object that can give this information. If Doc has NS and Prefix then { add namespace select nodes from namespace } else { do not add namespace } Thanks.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||






