LegacyParser
in package
Parse legacy contentv3.xml project data.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- parse() : array<string, mixed>
- Parse a legacy XML document.
- collectPages() : void
- Build normalized page information.
- parseElement() : mixed
- Recursively parse a contentv3 value.
- recursiveStringExtraction() : array<int, string>
- Recursively collect non-empty XML strings.
Properties
$htmlText
private
HtmlText
$htmlText
$slugger
private
Slugger
$slugger
Methods
__construct()
public
__construct([Slugger|null $slugger = null ][, HtmlText|null $htmlText = null ]) : mixed
Parameters
parse()
Parse a legacy XML document.
public
parse(SimpleXMLElement $xml) : array<string, mixed>
Parameters
- $xml : SimpleXMLElement
-
Parsed XML.
Return values
array<string, mixed>collectPages()
Build normalized page information.
private
collectPages(array<string, mixed> $node, int $level, array<int, array<string, mixed>> &$pages) : void
Parameters
- $node : array<string, mixed>
-
Legacy page node.
- $level : int
-
Current depth.
- $pages : array<int, array<string, mixed>>
-
Collected pages.
parseElement()
Recursively parse a contentv3 value.
private
parseElement(SimpleXMLElement $element) : mixed
Parameters
- $element : SimpleXMLElement
-
XML element.
recursiveStringExtraction()
Recursively collect non-empty XML strings.
private
recursiveStringExtraction(SimpleXMLElement $element) : array<int, string>
Parameters
- $element : SimpleXMLElement
-
XML element.