Attributes
- Companion
- class
- Graph
-
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
GenericElement.type
Members list
Type members
Inherited and Abstract types
The names of the product elements.
The names of the product elements.
Attributes
- Inherited from:
- Mirror
The name of the type.
The name of the type.
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
As fromNode, but for callers that know (as scala.xml.XML.loadString callers always do, since it returns Elem specifically, not the more general Node) that the result must be a GenericElement, avoiding a cast at every call site.
As fromNode, but for callers that know (as scala.xml.XML.loadString callers always do, since it returns Elem specifically, not the more general Node) that the result must be a GenericElement, avoiding a cast at every call site.
Value parameters
- elem
-
the element to convert.
Attributes
- Returns
-
a
GenericElement.
Method to convert a scala.xml.Node into a GenericContent, recursively.
Method to convert a scala.xml.Node into a GenericContent, recursively.
NOTE on namespaces: Elem.label is only the local name (e.g. "Story" for "idPkg:Story"), and an xmlns:prefix="uri" declaration is carried in Elem.scope, not in .attributes — so both have to be handled specially to avoid silently losing the "idPkg:" prefix (used throughout IDML's designmap.xml) or the namespace declaration itself. Whichever bindings in e.scope are not already visible in inheritedScope are re-materialized here as ordinary-looking xmlns[:prefix]="uri" attributes, so the output is self-contained.
Value parameters
- inheritedScope
-
the namespace bindings already in scope from an enclosing element; defaults to none, for a top-level call.
- node
-
the node to convert (typically an
Elem, but anyNodeis accepted).
Attributes
- Returns
-
a
GenericContent: aGenericElementfor anElem,GenericCDatafor a CDATA section, otherwiseGenericText.
Method to render a GenericContent back into an XML string.
Method to render a GenericContent back into an XML string.
NOTE: this is not guaranteed to be byte-identical to whatever text originally produced the equivalent GenericContent (e.g. attribute-quoting style and entity-encoding choices are normalized), but it is semantically equivalent and round-trips losslessly through fromNode again (i.e. fromNode(parse(toXmlString(g))) == g).
Value parameters
- content
-
the content to render.
Attributes
- Returns
-
an XML string.
Implicits
Implicits
An Extractor[GenericElement], for use as an ordinary field type within an otherwise-specialist extractorN, wherever a specific, named field is deliberately left generic. Fails if the node isn't an element (e.g. it's a bare text node).
An Extractor[GenericElement], for use as an ordinary field type within an otherwise-specialist extractorN, wherever a specific, named field is deliberately left generic. Fails if the node isn't an element (e.g. it's a bare text node).
Attributes
An Extractor[Option[GenericElement]], for a deliberately generic field that's optional.
An Extractor[Option[GenericElement]], for a deliberately generic field that's optional.
Attributes
A Renderer[GenericElement], the counterpart to extractor, delegating to toXmlString.
A Renderer[GenericElement], the counterpart to extractor, delegating to toXmlString.
Attributes
A Renderer[Option[GenericElement]], the counterpart to extractorOpt.
A Renderer[Option[GenericElement]], the counterpart to extractorOpt.