scala.xml.parsing

class ConstructingParser

[source: scala/xml/parsing/ConstructingParser.scala]

class ConstructingParser(inp : Source, presWS : Boolean)
extends ConstructingHandler with ExternalSources with MarkupParser
An xml parser. parses XML and invokes callback methods of a MarkupHandler. Don't forget to call next.ch on a freshly instantiated parser in order to initialize it. If you get the parser from the object method, initialization is already done for you.
object parseFromURL {
  def main(args:Array[String]): Unit = {
    val url = args(0);
    val src = scala.io.Source.fromURL(url);
    val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, false); // fromSource initializes automatically
    val doc = cpa.document();
    // let's see what it is
    val ppr = new scala.xml.PrettyPrinter(80,5);
    val ele = doc.docElem;
    Console.println("finished parsing");
    val out = ppr.format(ele);
    Console.println(out);
  }
}
Value Summary
val input : Source
val preserveWS : Boolean
if true, does not remove surplus whitespace
Values and Variables inherited from MarkupParser
curInput, inpStack, pos, extIndex, tmppos, ch, cbuf, dtd, doc, eof
Values and Variables inherited from MarkupHandler
isValidating, decls, ent
Method Summary
override def log (msg : java.lang.String) : Unit
This method should log the message given as argument somewhere as a side-effect.
Methods inherited from MarkupParser
xmlProcInstr, prolog, textDecl, document, putChar, nextch, xToken, xToken, xAttributes, xAttributeValue, xEntityValue, xTag, xEndTag, xCharData, xCharRef, xComment, appendText, content1, content, externalID, parseDTD, element, element1, xName, xEQ, xSpaceOpt, xSpace, xProcInstr, xText, systemLiteral, pubidLiteral, extSubset, markupDecl1, markupDecl, intSubset, elementDecl, attrDecl, entityDecl, notationDecl, reportSyntaxError, reportSyntaxError, reportValidationError, push, pushExternal, pop, normalizeAttributeValue
Methods inherited from TokenTests
isSpace, isSpace, isNameChar, isNameStart, isName, isPubIDChar, isValidIANAEncoding, checkSysID, checkPubID
Methods inherited from ExternalSources
externalSource
Methods inherited from ConstructingHandler
elem, procInstr, comment, entityRef, text
Methods inherited from MarkupHandler
lookupElemDecl, replacementText, endDTD, elemStart, elemEnd, elemDecl, attListDecl, parameterEntityDecl, parsedEntityDecl, unparsedEntityDecl, notationDecl, peReference
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
val preserveWS : Boolean
if true, does not remove surplus whitespace
Overrides
ConstructingHandler.preserveWS, MarkupParser.preserveWS

val input : Source
Overrides
MarkupParser.input

Method Details
override def log(msg : java.lang.String) : Unit
This method should log the message given as argument somewhere as a side-effect.
Parameters
msg - ...