javascript - Java Script - Convert Object to XML and XML to Object while using custom names of attributes -
i need convert xml object , object xml in java script. (i can use json conversion in middle of conversion process)
but, want use custom tag name , custom attribute name while converting, example:
person object:
function personobject(firstname, lastname) { this.firstname = firstname; this.lastname = lastname }
convert xml this:
<person f_name="first name" l_name="last name" />
something saving metadata every property in object (in c# did writing attribute: [xmlattribute("f_name")]
above property).
i want dynamically , not give objects properties names because want continuing code readable.
so, how can - convert object xml , vice versa while using custom names of attributes?
Comments
Post a Comment