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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -