The Easiest Way to Parse XML with JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

ความคิดเห็น •

  • @sondrepedersen7919
    @sondrepedersen7919 ปีที่แล้ว +5

    Wow, exactly what I needed! I was about to go crazy with some regex, but I think you just saved me a lot of pain

    • @dcode-software
      @dcode-software  ปีที่แล้ว

      Absolutely! I'm glad to hear that I prevented you from going down that path (it would have been a pain)

  • @xawoo6655
    @xawoo6655 ปีที่แล้ว

    🦩 Hello everyone!
    🟢 00:00 - introduction
    🟢 01:00 - handle xml from string
    🟢 01:40 - use of DOM parser
    🟢 03:24 - element navigation
    🟢 05:20 - handle xml from fetch request

  • @alvarobyrne
    @alvarobyrne ปีที่แล้ว +1

    Humble and humbling DOMParser, nice, didn't know,

  • @ahmedAltariqi
    @ahmedAltariqi ปีที่แล้ว

    You're awesome!
    Thank you so much for this great tutorial -- because of you now I don't have to ttml-to-json python package, and my code runs way much faster!

  • @crownkiwifactoryNZ
    @crownkiwifactoryNZ ปีที่แล้ว

    Thank you for the tutorial, it helps me a lot at work. ❤

  • @cutefunnypets3164
    @cutefunnypets3164 ปีที่แล้ว

    keep up the awesome work bro!💪

  • @Dhiraj_Chaudhari
    @Dhiraj_Chaudhari ปีที่แล้ว

    Can you please tell how to parse any content data from dynamic html file

  • @ivanetinajero
    @ivanetinajero ปีที่แล้ว +2

    Great content. How can I ask If an element exists inside the XML document? Thanks for this great an easy tutorial.

  • @aleksandrkobelev8868
    @aleksandrkobelev8868 ปีที่แล้ว

    If you have error put in your xml

  • @thierrysandre440
    @thierrysandre440 ปีที่แล้ว

    Excellent !👍

  • @mariumbegum7325
    @mariumbegum7325 ปีที่แล้ว

    great video!

  • @zegarek840525
    @zegarek840525 ปีที่แล้ว

    What about big file?? Is there in 2023 native SAX parser??

  • @arnosolo2008
    @arnosolo2008 ปีที่แล้ว

    Thank you so much! 😸

  • @fgscaglioni
    @fgscaglioni ปีที่แล้ว

    Excelente!! Me ajudou muito!

  • @SuviTuuliAllan
    @SuviTuuliAllan ปีที่แล้ว

    Is it true that text/xml is parsed as US-ASCII while application/xml is parsed as UTF-8?

  • @ubermensch-mne
    @ubermensch-mne ปีที่แล้ว

    Useful video, thanks.

  • @tamerlone5094
    @tamerlone5094 ปีที่แล้ว

    When I paste in the xml as he has it (1st part of the video), the editor throws an error and doesn't like the XML pasted. Anyone else have this problem?

    • @danielcook237
      @danielcook237 ปีที่แล้ว

      Yeah I did, I was using ' instead of ` .

  • @Konslufius
    @Konslufius ปีที่แล้ว +2

    Where were you like 2 months ago??

    • @dcode-software
      @dcode-software  ปีที่แล้ว +1

      Were you looking to parse XML 2 months ago? 😆

  • @kipo44
    @kipo44 ปีที่แล้ว

    thanks, bro

  • @christianromero7982
    @christianromero7982 ปีที่แล้ว

    i can not split my string literal across multiple lines

  • @madalabhavyasri-nr6pr
    @madalabhavyasri-nr6pr ปีที่แล้ว

    How to convert this XML string to json??

    • @weixiaolisa
      @weixiaolisa ปีที่แล้ว

      function xml2json(xml) {
      if (xml.children.length === 0)
      return xml.textContent.trim()
      const obj = {}
      for (let child of xml.children) {
      const name = child.nodeName
      if (obj[name] === undefined)
      obj[name] = xml2json(child)
      else {
      if (!Array.isArray(obj[name]))
      obj[name] = [obj[name]]
      obj[name].push(xml2json(child))
      }
      }
      return obj
      }

  • @khamzateedira9021
    @khamzateedira9021 ปีที่แล้ว

    Can you do somme video about react

  • @mohamedsimo6021
    @mohamedsimo6021 ปีที่แล้ว

    Can you please do a video about how to create like vuejs library I mean reactivity etc I watched the your spa video and I like it .

  • @erturkyorulmaz7376
    @erturkyorulmaz7376 ปีที่แล้ว

    Verry helpful channel!.. 👏 Do you have a link for codes? Or shall I write it! :) 🌹

    • @dcode-software
      @dcode-software  ปีที่แล้ว +1

      Hey, thank you! I assume you have some XML somewhere else but if not there's plenty of XML examples online - any of them should work 😎👍

    • @erturkyorulmaz7376
      @erturkyorulmaz7376 ปีที่แล้ว

      @@dcode-software Hi! I mean the JS code you write in your videos. But, no prblem I can write again. Thank you for your kindness and videos that help us. 👋

  • @learn_through_building
    @learn_through_building ปีที่แล้ว