Why use XML to Pike instead of JSON to Pike?
Choose XML to Pike when the source payload is XML and the generated classes need to reflect nested elements, repeated nodes, and document structure rather than JSON objects and arrays.
Generate Pike classes from XML samples when your service, script, or config tooling still parses XML documents into typed models.
<user>
<id>101</id>
<name>Ada Lovelace</name>
<active>true</active>
<roles>
<role>admin</role>
<role>editor</role>
</roles>
<profile>
<email>ada@example.com</email>
<score>9.8</score>
</profile>
</user>
class UserModel
{
int id;
string name;
int active;
array(string) roles;
}
Choose XML to Pike when the source payload is XML and the generated classes need to reflect nested elements, repeated nodes, and document structure rather than JSON objects and arrays.
Yes. Nested XML elements become child Pike classes, and repeated nodes are inferred into array-based field types from the parsed XML sample.