/** * Gets the JavaScript property "parseError" for the document. * * @return the ParserError object for the document */ public XMLDOMParseError jsxGet_parseError() { if (parseError_ == null) { parseError_ = new XMLDOMParseError(); parseError_.setPrototype(getPrototype(parseError_.getClass())); parseError_.setParentScope(getParentScope()); } return parseError_; }
/** * Gets the JavaScript property "parseError" for the document. * * @return the ParserError object for the document */ @JsxGetter({@WebBrowser(IE), @WebBrowser(CHROME)}) public XMLDOMParseError getParseError() { if (parseError_ == null) { parseError_ = new XMLDOMParseError(); parseError_.setPrototype(getPrototype(parseError_.getClass())); parseError_.setParentScope(getParentScope()); } return parseError_; }
/** * Loads an XML document from the specified location. * * @param xmlSource a string containing a URL that specifies the location of the XML file * @return true if the load succeeded; false if the load failed */ @JsxFunction public boolean load(final String xmlSource) { if (async_) { if (LOG.isDebugEnabled()) { LOG.debug("XMLDocument.load(): 'async' is true, currently treated as false."); } } try { final HtmlPage htmlPage = (HtmlPage) getWindow().getWebWindow().getEnclosedPage(); final WebRequest request = new WebRequest(htmlPage.getFullyQualifiedUrl(xmlSource)); final WebResponse webResponse = getWindow().getWebWindow().getWebClient().loadWebResponse(request); final XmlPage page = new XmlPage(webResponse, getWindow().getWebWindow(), false); setDomNode(page); return true; } catch (final IOException e) { final XMLDOMParseError parseError = getParseError(); parseError.setErrorCode(-1); parseError.setFilepos(1); parseError.setLine(1); parseError.setLinepos(1); parseError.setReason(e.getMessage()); parseError.setSrcText("xml"); parseError.setUrl(xmlSource); if (LOG.isDebugEnabled()) { LOG.debug("Error parsing XML from '" + xmlSource + "'", e); } return false; } }