Scala Library Documentation
|
|
scala/xml/parsing/MarkupParser.scala
]
trait
MarkupParser
extends
TokenTestsConstructingParser
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.Value Summary | |
protected val
|
cbuf
: StringBuilder
character buffer, for names
|
var
|
ch
: Char
holds the next character
|
var
|
curInput : Source |
protected var
|
doc : Document |
var
|
dtd : DTD |
var
|
eof : Boolean |
var
|
extIndex : Int |
var
|
inpStack
: List[Source]
stack of inputs
|
abstract val
|
input : Source |
var
|
pos
: Int
holds the position in the source file
|
abstract val
|
preserveWS
: Boolean
if true, does not remove surplus whitespace
|
var
|
tmppos
: Int
holds temporary values of pos
|
Method Summary | |
def
|
appendText (pos : Int, ts : NodeBuffer, txt : String) : Unit |
def
|
attrDecl
: Unit
<! attlist := ATTLIST
|
def
|
content
(pscope : NamespaceBinding) : NodeSeq
content1 ::= '<' content1 | '&' charref ...
|
def
|
content1
(pscope : NamespaceBinding, ts : NodeBuffer) : Unit
'<' content1 ::= ...
|
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
|
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
|
def
|
extSubset : Unit |
def
|
externalID
: ExternalID
externalID ::= SYSTEM S syslit
PUBLIC S pubid S syslit
|
abstract def
|
externalSource (systemLiteral : String) : Source |
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
|
normalizeAttributeValue
(attval : String) : String
for the moment, replace only character references
see spec 3.3.3
precond: cbuf empty
|
def
|
notationDecl
: Unit
'N' notationDecl ::= "OTATION"
|
def
|
parseDTD
: Unit
parses document type declaration and assigns it to instance variable
dtd.
<! parseDTD ::= DOCTYPE name ... >
|
def
|
pop : Unit |
def
|
prolog
: (Option[String], Option[String], Option[Boolean])
<? prolog ::= xml S
// this is a bit more lenient than necessary...
|
def
|
pubidLiteral : String |
def
|
push (entityName : String) : Unit |
def
|
pushExternal (systemId : String) : Unit |
protected def
|
putChar
(c : Char) : StringBuilder
append Unicode character to name buffer
|
def
|
reportSyntaxError (str : String) : Unit |
def
|
reportSyntaxError
(pos : Int, str : String) : Unit
report a syntax error
|
def
|
reportValidationError
(pos : Int, str : String) : Unit
report a syntax error
|
def
|
systemLiteral
: String
attribute value, terminated by either ' or ". value may not contain <.
AttValue ::= `'` { _ } `'`
| `"` { _ } `"`
|
def
|
textDecl
: (Option[String], Option[String])
prolog, but without standalone
|
def
|
xAttributeValue
: String
attribute value, terminated by either ' or ". value may not contain <.
AttValue ::= `'` { _ } `'`
| `"` { _ } `"`
|
def
|
xAttributes
(pscope : NamespaceBinding) : (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
(ch : () => Char, nextch : () => Unit) : 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 ". value may not contain <.
AttValue ::= `'` { _ } `'`
| `"` { _ } `"`
|
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) : (String, MetaData, NamespaceBinding)
parse a start or empty tag.
[40] STag ::= '<' Name { S Attribute } [S]
[44] EmptyElemTag ::= '<' Name { S Attribute } [S]
|
def
|
xText
: String
parse character data.
precondition: xEmbeddedBlock == false (we are not in a scala block)
|
def
|
xToken (that : Seq[Char]) : Unit |
def
|
xToken
(that : Char) : Unit
munch expected XML token, report syntax error for unexpected
|
def
|
xmlProcInstr
: MetaData
<? prolog ::= xml S ... ?>
|
Methods inherited from TokenTests | |
isSpace, isSpace, isNameChar, isNameStart, isName, isPubIDChar, isValidIANAEncoding, checkSysID, checkPubID |
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 |
abstract
val
input : Source
abstract
val
preserveWS : Boolean
var
curInput : Source
var
pos : Int
var
extIndex : Int
var
tmppos : Int
var
ch : Char
protected
val
cbuf : StringBuilder
var
dtd : DTD
protected
var
doc : Document
var
eof : Boolean
Method Details |
def
xmlProcInstr : MetaData
def
document : Document
protected
def
putChar(c : Char) : StringBuilder
def
nextch : Unit
def
xAttributes(pscope : NamespaceBinding) : (MetaData, NamespaceBinding)
def
xAttributeValue : String
def
xEntityValue : String
protected
def
xTag(pscope : NamespaceBinding) : (String, MetaData, NamespaceBinding)
def
xCharData : NodeSeq
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
pop : Unit
Scala Library Documentation
|
|