Pcs

com.phasmidsoftware.xmldoc.merge.Pcs
See thePcs companion class
object Pcs

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Pcs.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def label(ref: NodeRef): String

The node's identity label for relation purposes: its Self when it has one - stable across independently edited copies of the same document, which is exactly what a label needs to be for relations from different trees to ever compare equal - otherwise its NodePath, which is only stable within one parse of one tree (any edit that shifts a sibling's index changes it). Real IDML page items (Rectangle, TextFrame, Group, Page, Spread, Story, ...) always carry Self; it's specifically wrapper elements (Properties, the PathGeometry chain, ParagraphStyleRange/CharacterStyleRange/Content, and similar) that don't - the same gap TreeMatcher/EditDetector already have, since neither looks at Self-less nodes at all. A path-labelled node will only ever match itself, within the same tree, never a node from another tree - it can't wrongly match an unrelated node, but nor can it usefully participate in a merge; that's a known limitation, not a defect, until story-text-level merging is built.

The node's identity label for relation purposes: its Self when it has one - stable across independently edited copies of the same document, which is exactly what a label needs to be for relations from different trees to ever compare equal - otherwise its NodePath, which is only stable within one parse of one tree (any edit that shifts a sibling's index changes it). Real IDML page items (Rectangle, TextFrame, Group, Page, Spread, Story, ...) always carry Self; it's specifically wrapper elements (Properties, the PathGeometry chain, ParagraphStyleRange/CharacterStyleRange/Content, and similar) that don't - the same gap TreeMatcher/EditDetector already have, since neither looks at Self-less nodes at all. A path-labelled node will only ever match itself, within the same tree, never a node from another tree - it can't wrongly match an unrelated node, but nor can it usefully participate in a merge; that's a known limitation, not a defect, until story-text-level merging is built.

Attributes

def leafIsCData(e: GenericElement): Boolean

Legacy convenience paired with leafText. PCS conversion no longer folds text into leaves.

Legacy convenience paired with leafText. PCS conversion no longer folds text into leaves.

Attributes

def leafText(e: GenericElement): Option[String]

Legacy convenience for reading all character data from a text-only leaf.

Legacy convenience for reading all character data from a text-only leaf.

Attributes

def relations(root: GenericElement, labelOf: NodeRef => String = ...): RelationSet

Decomposes root's whole subtree into Pcs and Content relations.

Decomposes root's whole subtree into Pcs and Content relations.

Value parameters

labelOf

how to label each node - label (Self-or-NodePath) by default; pass ContentMatcher.matchedLabel(base, root) instead when root is one side of a 3-way merge against base and neither has a stable identity attribute at all (see ContentMatcher's own doc for why raw NodePath alone isn't safe there).

root

the tree (or subtree) to decompose.

Attributes

Returns

every relation needed to reconstruct root's structure and content.