|
Scala
1.4.0.3 |
|||
ConstructingParser
if you just want to parse XML to
construct instances of scala.xml.Node
.
While XML elements are returned, DTD declarations - if handled - are
collected using side-effects.
Field Summary | |
protected
|
val cbuf: StringBuffer
character buffer, for names |
abstract
|
val input: Source
|
abstract
|
val preserveWS: Boolean
if true, does not remove surplus whitespace |
Method Summary | |
def appendText(pos: Int, ts: NodeBuffer, txt: String): Unit
|
|
def attrDecl(): Unit
<! attlist := ATTLIST |
|
var ch: Char
holds the next character |
|
def content(pscope: NamespaceBinding): NodeSeq
content1 ::= '<' content1 | '&' charref ... |
|
def content1(pscope: NamespaceBinding, ts: NodeBuffer): Unit
'<' content1 ::= ... |
|
var curInput: Source
|
|
def document(): Document
[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') [25] Eq ::= S? '=' S? [26] VersionNum ::= '1.0' [27] Misc ::= Comment | PI | S |
|
var dtd: DTD
|
|
def element(pscope: NamespaceBinding): NodeSeq
|
|
def element1(pscope: NamespaceBinding): NodeSeq
'<' element ::= xmlTag1 '>' { xmlExpr | '{' simpleExpr '}' } ETag | xmlTag1 '/' '>' |
|
def elementDecl(): Unit
<! element := ELEMENT |
|
def entityDecl(): Unit
<! element := ELEMENT |
|
var eof: Boolean
|
|
var extIndex: Int
|
|
def extSubset(): Unit
|
|
def externalID(): ExternalID
externalID ::= SYSTEM S syslit PUBLIC S pubid S syslit |
|
abstract
|
def externalSource(systemLiteral: String): Source
|
var inpStack: List[Source]
stack of inputs |
|
def intSubset(): Unit
"rec-xml/#ExtSubset" pe references may not occur within markup declarations |
|
def markupDecl(): Unit
|
|
def markupDecl1(): Any
|
|
def nextch: Unit
this method assign the next character to ch and advances in input |
|
def notationDecl(): Unit
'N' notationDecl ::= "OTATION" |
|
def parseDTD(): Unit
parses document type declaration and assigns it to instance variable dtd. |
|
def pop(): Unit
|
|
var pos: Int
holds the position in the source file |
|
def prolog(): Tuple3[Option[String],Option[String],Option[Boolean]]
<? prolog ::= xml S |
|
def pubidLiteral(): String
|
|
def push(entityName: String): Unit
|
|
def pushExternal(systemId: String): Unit
|
|
protected
|
def putChar(c: Char): StringBuffer
append Unicode character to name buffer |
def reportSyntaxError(pos: Int, str: String): Unit
report a syntax error |
|
def reportSyntaxError(str: String): Unit
|
|
def reportValidationError(pos: Int, str: String): Unit
report a syntax error |
|
def systemLiteral(): String
attribute value, terminated by either ' or ". |
|
def textDecl(): Tuple2[Option[String],Option[String]]
prolog, but without standalone |
|
var tmppos: Int
holds temporary values of pos |
|
def xAttributeValue(): String
attribute value, terminated by either ' or ". |
|
def xAttributes(pscope: NamespaceBinding): Tuple2[MetaData,NamespaceBinding]
parse attribute and create namespace scope, metadata [41] Attributes ::= { S Name Eq AttValue } |
|
def xCharData: NodeSeq
'<! CharData ::= [CDATA[ ( {char} - {char}"]]>"{char} ) ']]>' see [15] |
|
def xCharRef: String
CharRef ::= "&#" '0'..'9' {'0'..'9'} ";" | "&#x" '0'..'9'|'A'..'F'|'a'..'f' { hexdigit } ";" see [66] |
|
def xComment: NodeSeq
Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' see [15] |
|
def xEQ: Unit
scan [S] '=' [S] |
|
def xEndTag(n: String): Unit
[42] '<' xmlEndTag ::= '<' '/' Name S? '>' |
|
def xEntityValue(): String
entity value, terminated by either ' or ". |
|
def xName: String
Name ::= (Letter | '_' | ':') (NameChar)* see [5] of XML 1.0 specification |
|
def xProcInstr: NodeSeq
'<?' ProcInstr ::= Name [S ({Char} - ({Char}'>?' {Char})]'?>' see [15] |
|
def xSpace: Unit
scan [3] S ::= (#x20 | #x9 | #xD | #xA)+ |
|
def xSpaceOpt: Unit
skip optional space S? |
|
protected
|
def xTag(pscope: NamespaceBinding): Tuple3[String,MetaData,NamespaceBinding]
parse a start or empty tag. |
def xText: String
parse character data. |
|
def xToken(that: Char): Unit
munch expected XML token, report syntax error for unexpected |
|
def xToken(that: Seq[Char]): Unit
|
|
def xmlProcInstr(): MetaData
<? prolog ::= xml S ... |
Methods inherited from java/lang/Object-class |
clone, eq, equals, finalize, getClass, hashCode, ne, notify, notifyAll, synchronized, toString, wait, wait, wait |
Methods inherited from scala/Any-class |
!=, ==, asInstanceOf, isInstanceOf, match |
Methods inherited from scala/ScalaObject-class |
getScalaType |
Methods inherited from scala/util/logging/Logged-class |
log |
Methods inherited from scala/xml/parsing/MarkupHandler-class |
attListDecl, comment, decls, elem, elemDecl, elemEnd, elemStart, endDTD, ent, entityRef, isValidating, lookupElemDecl, notationDecl, parameterEntityDecl, parsedEntityDecl, peReference, procInstr, replacementText, text, unparsedEntityDecl |
Methods inherited from scala/xml/parsing/TokenTests-class |
checkPubID, checkSysID, isName, isNameChar, isNameStart, isPubIDChar, isSpace, isSpace, isValidIANAEncoding |
Field Detail |
abstract val input: Source
abstract val preserveWS: Boolean
protected val cbuf: StringBuffer
Method Detail |
abstract def externalSource(systemLiteral: String): Source
var curInput: Source
var inpStack: List[Source]
var pos: Int
var extIndex: Int
var tmppos: Int
var ch: Char
var dtd: DTD
var eof: Boolean
def xmlProcInstr(): MetaData
def prolog(): Tuple3[Option[String],Option[String],Option[Boolean]]
def textDecl(): Tuple2[Option[String],Option[String]]
def document(): Document
protected def putChar(c: Char): StringBuffer
def nextch: Unit
def xToken(that: Char): Unit
def xToken(that: Seq[Char]): Unit
def xAttributes(pscope: NamespaceBinding): Tuple2[MetaData,NamespaceBinding]
def xAttributeValue(): String
def xEntityValue(): String
protected def xTag(pscope: NamespaceBinding): Tuple3[String,MetaData,NamespaceBinding]
def xEndTag(n: String): Unit
def xCharData: NodeSeq
def xCharRef: String
def xComment: NodeSeq
def appendText(pos: Int, ts: NodeBuffer, txt: String): Unit
def content1(pscope: NamespaceBinding, ts: NodeBuffer): Unit
def content(pscope: NamespaceBinding): NodeSeq
def externalID(): ExternalID
def parseDTD(): Unit
def element(pscope: NamespaceBinding): NodeSeq
def element1(pscope: NamespaceBinding): NodeSeq
def xName: String
def xEQ: Unit
def xSpaceOpt: Unit
def xSpace: Unit
def xProcInstr: NodeSeq
def xText: String
def systemLiteral(): String
def pubidLiteral(): String
def extSubset(): Unit
def markupDecl1(): Any
def markupDecl(): Unit
def intSubset(): Unit
def elementDecl(): Unit
def attrDecl(): Unit
def entityDecl(): Unit
def notationDecl(): Unit
def reportSyntaxError(pos: Int, str: String): Unit
def reportSyntaxError(str: String): Unit
def reportValidationError(pos: Int, str: String): Unit
def push(entityName: String): Unit
def pushExternal(systemId: String): Unit
def pop(): Unit
|
Scala
1.4.0.3 |
|||