Homepage platformOS Logo

New xml_to_hash filter

November 22, 2021

NEW

  • added new xml_to_hash filter

Returns:
Hash - Hash created based on XML

Params
xml (String) - String containing valid XML

Example


{% liquid
  assign text = '<?xml version="1.0" encoding="UTF-8"?><letter><title maxlength="10"> Quote Letter </title></letter>'
  assign object = text | xml_to_hash
%}
{{ object }} => '{"letter":[{"title":[{"maxlength":"10","content":" Quote Letter "}]}]}'
asset_path

Questions?

We are always happy to help with any questions you may have.

contact us