xml2js: how is the output?

后端 未结 6 733
暗喜
暗喜 2020-12-28 14:36

I m trying to use the node.js module xml2js

My code is quite simple:

function testparse(pathname, callback) {
    var parser = require(\'xml2js\').Pa         


        
6条回答
  •  执念已碎
    2020-12-28 15:16

    For those who are wondering, xml2js use and abuse of array

    For my file, the tree would be:

    .result //Object
    |_.head //Array
    |_.body //Array
      |_.update //Array
      | |_.$ //Object
      |   |_.fields //Strings
      |
      |_.stream //Array
      | |_.$ //Object
      |   |_.fields //Strings
      |
      |_.playlist //Array
        |_.$ //Object
          |_.fields //Strings
          |
          |_.video //Array
            |_.$ //Object
              |_.fields //Strings
    

提交回复
热议问题