with (classes) {
//
with (dom) {
//
with (ls) {
//
if (classes.LSParser && LSParser.parseURI) ls.LSParser = classes.LSParser;
else {
//
ls.LSParser = function (mode, schemaType)
{
 with (events.EventTarget) call(this);

 with (LSParser)
 {
  this.parse = parse;
  this.parseURI = parseURI;
  this.parseWithContext = null; // Not implemented
  this.abort = null; // Not implemented

  this.domConfig = null;
  this.filter = null;
  this.async = mode == DOMImplementationLS.MODE_ASYNCHRONOUS;
  this.busy = false;

  this.The_XMLHttpRequest = XML.XMLHttpRequest? new XML.XMLHttpRequest : null;
 }

 return this;
}
//
LSParser.ACTION_APPEND_AS_CHILDREN      = 1;
LSParser.ACTION_REPLACE_CHILDREN        = 2;
LSParser.ACTION_INSERT_BEFORE           = 3;
LSParser.ACTION_INSERT_AFTER            = 4;
LSParser.ACTION_REPLACE                 = 5;
//
LSParser.parse = function (input) { with (LSParser) with (this)
{
 if (input.stringData) return (new XML.DOMParser).parseFromString(input.stringData, "text/xml");
 if (input.systemId) return parseURI(input.systemId);
 if (input.baseURI) return parseURI(input.baseURI);

 return null;
}}
//
LSParser.parseURI = function (uri) { with (LSParser) with (this)
{
 var This = this;

 if (busy) throw new DOMException(INVALID_STATE_ERR);

 var The_Document;

 busy = true;

 try {

 if (The_XMLHttpRequest) with (The_XMLHttpRequest)
 {
  open("GET", uri, async);

  if (async) onreadystatechange = function (evt) { with (this)
  {
   switch (readyState)
   {
    case 0:
     break;
    case 4:
    {
     try {

     var The_LSLoadEvent = new ls.LSLoadEvent;

     The_LSLoadEvent.newDocument = responseXML && responseXML.documentElement? dom.Document.call(responseXML) : (new XML.DOMParser).parseFromString(responseText, "text/xml");

     This.dispatchEvent(The_LSLoadEvent);

     }
     catch (e) {}

     This.busy = false;
    }
     break;
    default: /* This.dispatchEvent(events.Event.call({ type : "progress"})); */;
   }
  }}

  send(null);

  if (async) return null;

  The_Document = responseXML && responseXML.documentElement? dom.Document.call(responseXML) : (new XML.DOMParser).parseFromString(responseText, "text/xml");
 }

 }
 catch (e) {}

 busy = false;

 if ( ! (The_Document && The_Document.documentElement)) throw new LSException(PARSE_ERR);

 return The_Document;
}}
//
}
//
}
//
}
//
}
