Project

General

Profile

Actions

Feature #59384

closed

Make GeneralUtility::xml2tree configurable

Added by Tizian Schmidlin about 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-06-06
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Hello there,

I recently ran into a problem with GeneralUtility::xml2tree (formerly known as t3lib_div::xml2tree) where I tried to parse a file that had a tag that was empty. Now because of the strict behavior of xml2tree, the file failed to parse.

Indeed the xml parser is set to not skip white (empty) entries which leeds to an error and then stops parsing.

It would be nice to have the possibility to either modify the behavior of xml2tree globally or to have it to be configurable by parameters. Both could be implemented without risking backwards incompatibility.

Personally I'm a fan of the additional function parameters which I'd implement like this:

...
static public function xml2tree($string, $depth = 999, $caseFolding = 0, $skipWhite = 0) {
    $parser = xml_parser_create();
    $vals = array();
    $index = array();
    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, $caseFolding);
    xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, $skipWhite);
...

Thank you for you're feedback!

Best Regards
Tizian

Actions #1

Updated by Philipp Gampe about 10 years ago

Would you mind to provide a patch in push that to Gerrit? http://wiki.typo3.org/CWT

Actions #2

Updated by Gerrit Code Review about 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30973

Actions #3

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #4

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #5

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #6

Updated by Gerrit Code Review over 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #7

Updated by Gerrit Code Review over 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #8

Updated by Gerrit Code Review over 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #9

Updated by Gerrit Code Review over 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #10

Updated by Gerrit Code Review almost 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/30973

Actions #11

Updated by Markus Hölzle almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack almost 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF