I encountered a strange issue where the XML
files contain periods (.)
within them.
<member>
<name>ABCD</name>
<value>
<date.of.birth>02.05.2000</date.of.birth>
</value>
</member>
As a result, I am facing difficulty parsing the XML
in javascript
. I typically convert this XML
into JSON
and utilize JSON.parse()
.
If you have any insights on how to efficiently replace all periods in XML
Tags with an underscore or another character using Javascript
, please share your expertise. Here is an example of what I am looking for:
<member>
<name>ABCD</name>
<value>
<date_of_birth>02.05.2000</date_of_birth>
</value>
</member>
Thank you in advance.