summaryrefslogtreecommitdiff
path: root/spec/10-xml-expressions-and-patterns.md
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-09-15 12:08:51 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2014-09-17 13:40:09 +0200
commit3b0c71df60a41e13e47ec9ae8dbc606e1928aba8 (patch)
tree306897801df10e0318b454c67738156997e4b29d /spec/10-xml-expressions-and-patterns.md
parentbca19f35103c4ff1205e1c8054eb3f803217a18b (diff)
downloadscala-3b0c71df60a41e13e47ec9ae8dbc606e1928aba8.tar.gz
scala-3b0c71df60a41e13e47ec9ae8dbc606e1928aba8.tar.bz2
scala-3b0c71df60a41e13e47ec9ae8dbc606e1928aba8.zip
spec: remove trailing whitespace everywhere
Diffstat (limited to 'spec/10-xml-expressions-and-patterns.md')
-rw-r--r--spec/10-xml-expressions-and-patterns.md33
1 files changed, 16 insertions, 17 deletions
diff --git a/spec/10-xml-expressions-and-patterns.md b/spec/10-xml-expressions-and-patterns.md
index 8d4b459844..069f499ce9 100644
--- a/spec/10-xml-expressions-and-patterns.md
+++ b/spec/10-xml-expressions-and-patterns.md
@@ -14,7 +14,7 @@ changes being mandated by the possibility of embedding Scala code fragments.
## XML expressions
-XML expressions are expressions generated by the following production, where the
+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](01-lexical-syntax.html#xml-mode).
@@ -29,13 +29,13 @@ related to entity resolution.
The following productions describe Scala's extensible markup language,
designed as close as possible to the W3C extensible markup language
-standard. Only the productions for attribute values and character data are changed.
+standard. Only the productions for attribute values and character data are changed.
Scala does not support declarations, CDATA sections or processing instructions.
Entity references are not resolved at runtime.
```ebnf
Element ::= EmptyElemTag
- | STag Content ETag
+ | STag Content ETag
EmptyElemTag ::= ‘<’ Name {S Attribute} [S] ‘/>’
@@ -52,17 +52,17 @@ XmlContent ::= Element
```
If an XML expression is a single element, its value is a runtime
-representation of an XML node (an instance of a subclass of
+representation of an XML node (an instance of a subclass of
`scala.xml.Node`). If the XML expression consists of more
than one element, then its value is a runtime representation of a
-sequence of XML nodes (an instance of a subclass of
+sequence of XML nodes (an instance of a subclass of
`scala.Seq[scala.xml.Node]`).
-If an XML expression is an entity reference, CDATA section, processing
-instructions or a comments, it is represented by an instance of the
+If an XML expression is an entity reference, CDATA section, processing
+instructions or a comments, it is represented by an instance of the
corresponding Scala runtime class.
-By default, beginning and trailing whitespace in element content is removed,
+By default, beginning and trailing whitespace in element content is removed,
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.
@@ -76,13 +76,13 @@ AttValue ::= ‘"’ {CharQ | CharRef} ‘"’
ScalaExpr ::= Block
-CharData ::= { CharNoRef } $\textit{ without}$ {CharNoRef}`{'CharB {CharNoRef}
+CharData ::= { CharNoRef } $\textit{ without}$ {CharNoRef}`{'CharB {CharNoRef}
$\textit{ and without}$ {CharNoRef}`]]>'{CharNoRef}
```
<!-- {% raw %} stupid liquid borks on the double brace below; brace yourself, liquid! -->
XML expressions may contain Scala expressions as attribute values or
-within nodes. In the latter case, these are embedded using a single opening
+within nodes. In the latter case, these are embedded using a single opening
brace `{` and ended by a closing brace `}`. To express a single opening braces
within XML text as generated by CharData, it must be doubled.
Thus, `{{` represents the XML text `{` and does not introduce an embedded Scala expression.
@@ -99,7 +99,7 @@ CharB ::= Char1 $\textit{ without}$ ‘{’
Name ::= XNameStart {NameChar}
-XNameStart ::= ‘_’ | BaseChar | Ideographic
+XNameStart ::= ‘_’ | BaseChar | Ideographic
$\textit{ (as in W3C XML, but without }$ ‘:’$)$
```
@@ -110,7 +110,7 @@ the opening bracket `<` of the element patterns must be in a position
to start the lexical [XML mode](01-lexical-syntax.html#xml-mode).
```ebnf
-XmlPattern ::= ElementPattern
+XmlPattern ::= ElementPattern
```
Well-formedness constraints of the XML specification apply.
@@ -123,18 +123,18 @@ XML patterns may contain [Scala patterns](08-pattern-matching.html#pattern-match
Whitespace is treated the same way as in XML expressions.
-By default, beginning and trailing whitespace in element content is removed,
+By default, beginning and trailing whitespace in element content is removed,
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.
```ebnf
ElemPattern ::= EmptyElemTagP
- | STagP ContentP ETagP
+ | STagP ContentP ETagP
EmptyElemTagP ::= ‘<’ Name [S] ‘/>’
-STagP ::= ‘<’ Name [S] ‘>’
-ETagP ::= ‘</’ Name [S] ‘>’
+STagP ::= ‘<’ Name [S] ‘>’
+ETagP ::= ‘</’ Name [S] ‘>’
ContentP ::= [CharData] {(ElemPattern|ScalaPatterns) [CharData]}
ContentP1 ::= ElemPattern
| Reference
@@ -144,4 +144,3 @@ ContentP1 ::= ElemPattern
| ScalaPatterns
ScalaPatterns ::= ‘{’ Patterns ‘}’
```
-