summaryrefslogtreecommitdiff
path: root/12-xml-expressions-and-patterns.md
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 16:58:12 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 16:58:12 -0700
commitb44c5980ac2f1e330acd522badabb01f5eb50c06 (patch)
treed8a128c8ce8a46c46d2b468e6b51b33113a971b4 /12-xml-expressions-and-patterns.md
parent9dec37b50be3288822b9c7c0cb5c4d263f3d05e7 (diff)
downloadscala-b44c5980ac2f1e330acd522badabb01f5eb50c06.tar.gz
scala-b44c5980ac2f1e330acd522badabb01f5eb50c06.tar.bz2
scala-b44c5980ac2f1e330acd522badabb01f5eb50c06.zip
github markdown: code blocks
Diffstat (limited to '12-xml-expressions-and-patterns.md')
-rw-r--r--12-xml-expressions-and-patterns.md24
1 files changed, 12 insertions, 12 deletions
diff --git a/12-xml-expressions-and-patterns.md b/12-xml-expressions-and-patterns.md
index 4d4ed87169..974fbc6b78 100644
--- a/12-xml-expressions-and-patterns.md
+++ b/12-xml-expressions-and-patterns.md
@@ -12,9 +12,9 @@ XML expressions are expressions generated by the following production, where the
opening bracket `<' of the first element must be in a position to start the lexical
[XML mode](#xml-mode).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
XmlExpr ::= XmlContent {Element}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
Well-formedness constraints of the XML specification apply, which
means for instance that start tags and end tags must match, and
@@ -28,7 +28,7 @@ are changed. Scala does not support declarations, CDATA
sections or processing instructions. Entity references are not
resolved at runtime.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
Element ::= EmptyElemTag
| STag Content ETag
@@ -44,7 +44,7 @@ XmlContent ::= Element
| CDSect
| PI
| Comment
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
If an XML expression is a single element, its value is a runtime
representation of an XML node (an instance of a subclass of
@@ -62,7 +62,7 @@ and consecutive occurrences of whitespace are replaced by a single space
character \\u0020. This behavior can be changed to preserve all whitespace
with a compiler option.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
Attribute ::= Name Eq AttValue
AttValue ::= ‘"’ {CharQ | CharRef} ‘"’
@@ -73,7 +73,7 @@ ScalaExpr ::= Block
CharData ::= { CharNoRef } $\mbox{\rm\em without}$ {CharNoRef}`{'CharB {CharNoRef}
$\mbox{\rm\em and without}$ {CharNoRef}`]]>'{CharNoRef}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
XML expressions may contain Scala expressions as attribute values or
within nodes. In the latter case, these are embedded using a single opening
@@ -82,7 +82,7 @@ within XML text as generated by CharData, it must be doubled. Thus, ‘{{’
represents the XML text ‘{’ and does not introduce an embedded Scala
expression.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
BaseChar, Char, Comment, CombiningChar, Ideographic, NameChar, S, Reference
::= $\mbox{\rm\em “as in W3C XML”}$
@@ -96,7 +96,7 @@ Name ::= XNameStart {NameChar}
XNameStart ::= ‘_’ | BaseChar | Ideographic
$\mbox{\rm\em (as in W3C XML, but without }$ ‘:’
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
## XML patterns
@@ -104,9 +104,9 @@ XML patterns are patterns generated by the following production, where
the opening bracket ‘<’ of the element patterns must be in a position
to start the lexical [XML mode](#xml-mode).
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
XmlPattern ::= ElementPattern
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
Well-formedness constraints of the XML specification apply.
@@ -126,7 +126,7 @@ and consecutive occurrences of whitespace are replaced by a single space
character \\u0020. This behavior can be changed to preserve all whitespace
with a compiler option.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
ElemPattern ::= EmptyElemTagP
| STagP ContentP ETagP
@@ -141,5 +141,5 @@ ContentP1 ::= ElemPattern
| Comment
| ScalaPatterns
ScalaPatterns ::= ‘{’ Patterns ‘}’
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```