JavaScrip code to loop/parse a string

Lengkap Disiarkan 2 tahun lepas Dibayar semasa penghantaran
Lengkap Dibayar semasa penghantaran

I have this partial XML string taked from a DOM :

<ArticleIdList>

<ArticleId IdType="pubmed">26096938</ArticleId>

<ArticleId IdType="pii">onc2015238</ArticleId>

<ArticleId IdType="doi">10.1038/onc.2015.238</ArticleId>

<ArticleId IdType="pmc">PMC4688046</ArticleId>

<ArticleId IdType="mid">NIHMS694867</ArticleId>

</ArticleIdList>

And I want to end up with :

[{IdType: "pubmed", value: "26096938"},

{IdType: "pii", value: "onc2015238"},

{IdType: "doi", value: "10.1038/onc.2015.238"}

{IdType: "pmc", value: "PMC4688046"}

{IdType: "mid", value: "NIHMS694867"}]

The XML string may or MAYNOT have the same nodes each time so it cannot theow an error if one or more are missing. I would rather have code that loops the entire ArticleIdList reading each node rather than parseing the string with substrings. No PHP and no jQuery. This is going into a Quasar project so stright JavaScript, XML DOM is fine

JavaScript XML

ID Projek: #30366596

Tentang projek

8 cadangan Projek jarak jauh Aktif 2 tahun lepas

Dianugerahkan kepada:

xamling

Hello I have been working with them for a long time. Reading through the job description, I can get it done with confidence in a short time. I can work on it immediately. Please leave a message in my chat box. Than Lagi

$20 USD dalam sehari
(7 Ulasan)
3.0

8 pekerja bebas membida secara purata $26 untuk pekerjaan ini

aodinaev000

Hi there. I will be glad to help you if you give me a chance. Please check my profile. Thanks.

$30 USD dalam sehari
(10 Ulasan)
4.1
technicalfoodie

Dear Sir, I can do this work in fast manner, I have sound good knowelde of js, while providing you solution I am going to provide you general solution not static type i.e. node name can vary and even node's number can Lagi

$30 USD dalam sehari
(4 Ulasan)
3.7
bmoatar1

Hi, I have full experience with javascript, xml ========================================================== I can carry out your project on time with high quality guarantee. I hope to discuss more in detail. Best regard Lagi

$20 USD dalam sehari
(3 Ulasan)
1.6
josehusam

*****javascript, xml EXPERT ***** Hello, there? You can hire me for your job. I have read your description. I am appropriate to your description. I am full-stack, full-time senior developer and have rich experience wi Lagi

$30 USD dalam sehari
(1 Ulasan)
0.8
JuanPFreelancer

Hi I would like to work in your project, please if are interesting contact with me Regards.

$25 USD dalam 3 hari
(0 Ulasan)
0.0