Serializes a JavaScript object to XML format
The object to serialize
The name of the root XML element
XML string representation of the object
StatictransformTransforms a tag name to camelCase format for XML serialization
This method handles special cases like OJP prefixes and preserves uppercase-only tags. It converts hyphenated or underscored names to camelCase while ensuring the first character is lowercase.
The original tag name to transform
Transformed tag name in camelCase format
// Transform various tag name formats
XmlSerializer.transformTagName('OJP_Feature'); // Returns: 'OJP_Feature'
XmlSerializer.transformTagName('FIRST_NAME'); // Returns: 'FIRST_NAME'
XmlSerializer.transformTagName('first-name'); // Returns: 'firstName'
XmlSerializer.transformTagName('user_name'); // Returns: 'userName'
Serializes JavaScript objects to XML format with configurable options.
The XmlSerializer provides methods to convert JavaScript objects into XML strings using a configurable XML configuration. It includes automatic tag name transformation to handle different naming conventions.
Example