# actionpack-xml_parser **Repository Path**: mirrors_rails/actionpack-xml_parser ## Basic Information - **Project Name**: actionpack-xml_parser - **Description**: XML parameters parser for Action Pack (removed from core in Rails 4.0) - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2025-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README actionpack-xml\_parser ====================== A XML parameters parser for Action Pack (removed from core in Rails 4.0) Installation ------------ Include this gem into your Gemfile: ```ruby gem 'actionpack-xml_parser' ``` Parameters parsing rules ------------------------ The parameters parsing is handled by `ActiveSupport::XMLConverter` so there may be specific features and subtle differences depending on the chosen XML backend. ### Hashes Basically, each node represents a key. With the following XML: ```xml David ``` The resulting parameters will be: ```ruby {"person" => {"name" => "David"}} ``` ### File attachment You can specify the `type` attribute of a node to attach files: ```xml ``` The resulting parameters will include a `StringIO` object with the given content, name and content type set accordingly: ```ruby {"person" => {"avatar" => #}} ``` ### Arrays There are several ways to pass an array. You can either specify multiple nodes with the same name: ```xml
``` The resulting parameters will be: ```ruby {"person" => {"address" => [{"city" => "Chicago"}, {"city" => "Ottawa"}]}} ``` You can also specify the `type` attribute of a node and nest child nodes inside: ```xml
``` will result in: ```ruby {"person" => {"addresses" => [{"city" => "Melbourne"}, {"city" => "Paris"}]}} ```