Packages

p

pl.msitko.xml

entities

package entities

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. final case class Attribute(key: ResolvedName, value: String) extends Product with Serializable
  2. final case class CData(text: String) extends Node with Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-CDSect

  3. final case class Comment(comment: String) extends Node with Misc with Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-Comment

  4. final case class DoctypeDeclaration(text: String) extends Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-doctypedecl

  5. final case class Element(attributes: Seq[Attribute] = Seq.empty, children: Seq[Node] = Seq.empty, namespaceDeclarations: Seq[NamespaceDeclaration] = Seq.empty) extends Product with Serializable
  6. final case class EntityReference(name: String, replacement: String) extends Node with Product with Serializable
  7. final case class LabeledElement(label: ResolvedName, element: Element) extends Node with Product with Serializable

    First - why we need different entities than plain scala-xml ones?

    First - why we need different entities than plain scala-xml ones?

    The problem appeared when testing lawfulness of Optional[Elem, NonEmptyList[Elem]] It was impossible to satisfy get what you set law as modify function may modify label which at the same time is the key for a lookup.

    // just pseudo-code - elem is not a case class so it has no copy val res = elemOptional.get("abc").modify(_.copy(label = "someNewLabel")) res.get("abc") // will return None instead of modified elem...

    To restrict user not to modify label of "zoomed-in" element we need to create our own Element

  8. sealed trait Misc extends AnyRef

    According to https://www.w3.org/TR/xml/#NT-Misc it is: Misc ::= Comment | PI | S

    According to https://www.w3.org/TR/xml/#NT-Misc it is: Misc ::= Comment | PI | S

    For sake of simplicity xml-lens defines it as: Misc ::= Comment | PI

    That means that we do not preserve whitespaces outside of root element

  9. final case class NamespaceDeclaration(prefix: String, uri: String) extends Product with Serializable
  10. sealed trait Node extends AnyRef

    As documented here: https://www.w3.org/TR/xml/#NT-content

  11. final case class ProcessingInstruction(target: String, data: String) extends Node with Misc with Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-PI

  12. final case class Prolog(xmlDeclaration: Option[XmlDeclaration], miscs: Seq[Misc], doctypeDeclaration: Option[(DoctypeDeclaration, Seq[Misc])]) extends Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-prolog

  13. final case class ResolvedName(prefix: String, uri: String, localName: String) extends Product with Serializable

    empty prefix is encoded as "" (empty string) empty uri is encoded as "" (empty string)

    empty prefix is encoded as "" (empty string) empty uri is encoded as "" (empty string)

    Such encoding was used instead of Option[String] because with Option encoding there will be 2 encodings (i.e. None and "") for the same situations. I was also a bit scared of performance penalty but haven't really checked that

  14. final case class Text(text: String) extends Node with Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-CharData

  15. final case class XmlDeclaration(version: String, encoding: Option[String]) extends Product with Serializable

    As documented here: https://www.w3.org/TR/xml/#NT-XMLDecl

  16. final case class XmlDocument(prolog: Prolog, root: LabeledElement) extends Product with Serializable

    According to https://www.w3.org/TR/xml/#sec-well-formed document is: document ::= prolog element Misc*

    According to https://www.w3.org/TR/xml/#sec-well-formed document is: document ::= prolog element Misc*

    But for sake of simplicity xml-lens defines it rather as:

    document ::= prolog element

    That means that comments and processing instructions that are placed after the root element cannot be expressed using xml-lens AST. Mind that it does not apply to comments and processing instructions which are placed outside of root element but before it. Those items can be expressed in terms of xml-lens AST as part of Prolog.

Value Members

  1. object Attribute extends Serializable
  2. object LabeledElement extends Serializable
  3. object ResolvedName extends Serializable
  4. object XmlDocument extends Serializable

Ungrouped