Moving from #603420: XML export mangles <, >, and &.

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.

Comments

Aren Cambre’s picture

Requiring PHP >= 5.2 seems like a no-brainer to me. Why not assume the user is on a supported, stable release of PHP as of the release date?

neclimdul’s picture

Status: Active » Postponed

Yeah my reservation to committing the SimpleXML patch doesn't have much to do with SimpleXML support since that should be a pretty ubiquitous feature now thanks to the GoPHP5 movement. The problem is more the drastic change in the rendering and the general disconnect in methodology it would have compared to the other export plugins. Since this module is already seeing a lot of usage as is, I'm going to postpone this to a new branch. Either a 6.x-2.x or 7.x-*,

tripper54’s picture

If you do decide to require simpleXML, please check for that function rather than php 5.2. Those of us stuck on RHEL packages, and thus php 5.1, can enable simpleXML via PECL.

neclimdul’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)