Use SimpleXML for XML handling and rendering in export

Created on 16 March 2010, almost 15 years ago
Updated 8 March 2023, almost 2 years ago

Moving from πŸ› XML export mangles <, >, and & Closed: outdated .

In that issue Steven Jones has posted an interesting patch that uses SimpleXML to provide XML handling instead of the custom handling currently in use.

Since this is a significant reworking, I'm moving to a separate issue to decouple from the original bug reported in that issue.

The major question likely is: Should SimpleXML be added as an alternative (use it if present, default to current approach if not) or should it instead be required?

The main downside of introducing an alternative is that it significantly increases the complexity of the code, as there are two distinct and very different approaches that both need to be supported.

Introducing a dependency could greatly simplify the code, but it would require PHP 5 and also a test for SimpleXML (optional in PHP 5 though enabled by default). A SimpleXML dependency could be done in a D7 upgrade, where we can count on PHP 5.

SimpleXML would require a different approach to rendering. Currently theme overrides may be used to customize the XML format. SimpleXML rendering doesn't look to lend itself readily to theme overriding. However, a different approach may be used. E.g., possibly, pass the XML object through a drupal_alter() call.

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada nedjo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024