Menu

Basic Idea on parsing XML documents ?

2003-05-19
2003-06-11
  • Harry Manson

    Harry Manson - 2003-05-19

    Hello,

    could any of the programmers supply me the basic idea about parsing the xml data ? Ive seen that you made it (although tiny and "easy") still complex with classes for nodes and attributes... i wish to write a parser on my very own (far more simplier than yours)... but i dont know exactly how to parse the data... i wish to parse an xml file into a list or a tree (objects)... now im not exactly sure on how to get startet parsing the data.. maybe recursivly ?

    If any of you could point out some basics in parsing this kind of syntax it would be of great help and really appreicated... i thought something like this, i parse every tag till i found the same tag again which closes one node. Than i call my parse method itself with just all childrends of that node... now in java this would be more simplier but im doing this in c++ and therefor ive found your solution and maybe i could adopt some ideas from you.

    thanks.

     
    • B Sizer

      B Sizer - 2003-06-11

      Basically I made it a recursive thing... from your XML document, you get a list of elements. For each element, you create an object, then you call that object's parse function on the nodes inside the current element.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.