package xml
- Source
- package.scala
- Alphabetic
- By Inheritance
- xml
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- case class Attr(name: QName, value: List[XmlTexty]) extends Product with Serializable
-
sealed abstract
class
NSError extends XmlError
Represents a namespace constraint as defined in the XML namespaces recommendation.
- case class QName(prefix: Option[String], local: String) extends Product with Serializable
-
sealed abstract
class
WFError extends XmlError
Represents a Well-formedness constraint as defined in the XML specification.
-
abstract
class
XmlError extends AnyRef
All errors encountered in processing an Xml documents have a kind.
All errors encountered in processing an Xml documents have a kind. These errors are unique code defined in the various normative documents and recommendations.
- sealed trait XmlEvent extends AnyRef
- case class XmlException(error: XmlError, msg: String) extends Exception with Product with Serializable
- implicit final class XmlInterpolators extends AnyVal
-
case class
XmlSyntax(id: String) extends XmlError with Product with Serializable
Represents a syntax error according to an XML production rule.
Value Members
-
def
events[F[_], T](includeComments: Boolean = false)(implicit F: RaiseThrowable[F], T: CharLikeChunks[F, T]): Pipe[F, T, XmlEvent]
Transforms a stream of characters into a stream of XML events.
Transforms a stream of characters into a stream of XML events. Emitted tokens are guaranteed to be valid up to that point. If the streams ends without failure, the sequence of tokens is ensured to represent a (potentially empty) sequence of valid XML documents.
if
includeComments
istrue
, then comment events will be emitted together with the comment content. - def isNCNameChar(c: Char): Boolean
- def isNCNameStart(c: Char): Boolean
- def isXmlWhitespace(c: Char): Boolean
-
def
namespaceResolver[F[_]](implicit F: MonadError[F, Throwable]): Pipe[F, XmlEvent, XmlEvent]
Resolves all prefixes in QNames.
Resolves all prefixes in QNames. Assumes that entity and character references have been resolved already. Make stream go through referenceResolver first if you need it (not needed if you xml doesn't contain any such reference).
- val ncNameChar: CharRanges
- val ncNameStart: CharRanges
-
def
normalize[F[_]]: Pipe[F, XmlEvent, XmlEvent]
Performs some event normalizations:
Performs some event normalizations:
- group consecutive non CDATA XmlEvent.XmlStrings This can be useful to merge texts once references have been resolved. Attribute values are also normalized, so that they will end up being one single string after normalization if references have been replaced.
-
def
referenceResolver[F[_]](entities: Map[String, String] = xmlEntities)(implicit F: MonadError[F, Throwable]): Pipe[F, XmlEvent, XmlEvent]
Resolves the character and entity references in the XML stream.
Resolves the character and entity references in the XML stream. Entities are already defined and validated (especially no recursion), hence the
entities
map contains the resolved text to replace the entity by. -
val
xmlEntities: Map[String, String]
The predefined XML character entities
- object Attr extends AbstractFunction2[QName, List[XmlTexty], Attr] with Serializable
- object NSCAttributesUnique extends NSError with Product with Serializable
- object NSCNoPrefixUndeclaring extends NSError with Product with Serializable
- object NSCPrefixDeclared extends NSError with Product with Serializable
- object QName extends Serializable
- object WFCElementTypeMatch extends WFError with Product with Serializable
- object WFCEntityDeclared extends WFError with Product with Serializable
- object WFCNoRecursion extends WFError with Product with Serializable
- object XmlEvent
-
object
collector
XML event stream collectors.
-
object
render
XML Event stream pipes to render XML values.
Deprecated Value Members
-
def
events[F[_], T](implicit F: RaiseThrowable[F], T: CharLikeChunks[F, T]): Pipe[F, T, XmlEvent]
Transforms a stream of characters into a stream of XML events.
Transforms a stream of characters into a stream of XML events. Emitted tokens are guaranteed to be valid up to that point. If the streams ends without failure, the sequence of tokens is ensured to represent a (potentially empty) sequence of valid XML documents.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.4.0) Use
fs2.data.xml.events()
instead.
-
def
render[F[_]](collapseEmpty: Boolean = true): Pipe[F, XmlEvent, String]
Render the incoming xml events to their string representation.
Render the incoming xml events to their string representation. The output will be concise, without additional (or original) whitespace and with empty tags being collapsed to the short self-closed form <x/> if collapseEmpty is true.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.11.0) Use
fs2.data.xml.render.raw() instead.