Skip to content

Clarify doc for NodeSeq projection #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions shared/src/main/scala/scala/xml/NodeSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S
/**
* Projection function, which returns elements of `this` sequence based
* on the string `that`. Use:
* - `this \ "foo"` to get a list of all elements that are labelled with `"foo"`;
* - `\ "_"` to get a list of all elements (wildcard);
* - `ns \ "@foo"` to get the unprefixed attribute `"foo"`;
* - `ns \ "@{uri}foo"` to get the prefixed attribute `"pre:foo"` whose
* - `this \ "foo"` to get a list of all children that are labelled with `"foo"`;
* - `this \ "_"` to get a list of all child elements (wildcard);
* - `this \ "@foo"` to get the unprefixed attribute `"foo"` of `this`;
* - `this \ "@{uri}foo"` to get the prefixed attribute `"pre:foo"` whose
* prefix `"pre"` is resolved to the namespace `"uri"`.
*
* For attribute projections, the resulting [[scala.xml.NodeSeq]] attribute
Expand Down Expand Up @@ -125,10 +125,11 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S
/**
* Projection function, which returns elements of `this` sequence and of
* all its subsequences, based on the string `that`. Use:
* - `this \\ 'foo` to get a list of all elements that are labelled with `"foo"`;
* - `\\ "_"` to get a list of all elements (wildcard);
* - `ns \\ "@foo"` to get the unprefixed attribute `"foo"`;
* - `ns \\ "@{uri}foo"` to get each prefixed attribute `"pre:foo"` whose
* - `this \\ "foo" to get a list of all elements that are labelled with `"foo"`,
* including `this`;
* - `this \\ "_"` to get a list of all elements (wildcard), including `this`;
* - `this \\ "@foo"` to get all unprefixed attributes `"foo"`;
* - `this \\ "@{uri}foo"` to get all prefixed attribute `"pre:foo"` whose
* prefix `"pre"` is resolved to the namespace `"uri"`.
*
* For attribute projections, the resulting [[scala.xml.NodeSeq]] attribute
Expand Down