Search code examples
javascriptxmlparsingxmlreader

Unable to parse dc:creator/dc:content using node-xmlreader


I'm experiencing an issue while using the node-xmlreader parser (https://github.com/SamDecrock/node-xmlreader) and trying to parse from my feed two nodes: to be specific, the "dc:creator" node and "dc:content".

What I get is a "TypeError" on this line of code:

object.set("Autore",actualItem.dc:creator.text());

It looks like the compiler doesn't want to "recnognize" the colon. Has somebody got an error like this? Is there a way to fix it or i should change xml parser? In this case, which one is the best one (keep in mind that i'm creating code to be used in Parse.com)?

Thanks at all :)


Solution

  • just use array-style notation:

    object.set("Autore", actualItem['dc:creator'].text());