ELP Parser API

LegacyParser
in package

Parse legacy contentv3.xml project data.

Tags
category

Parser

author

INTEF cedec@educacion.gob.es

license

MIT https://opensource.org/licenses/MIT

link
https://github.com/exelearning/elp-parser

Table of Contents

Properties

$htmlText  : HtmlText
$slugger  : Slugger

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

Methods

__construct()

public __construct([Slugger|null $slugger = null ][, HtmlText|null $htmlText = null ]) : mixed
Parameters
$slugger : Slugger|null = null

Optional slugger.

$htmlText : HtmlText|null = null

Optional HTML text converter.

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.

Return values
array<int, string>
On this page

Search results