How to properly parse XML with SAX?

后端 未结 6 1119
梦谈多话
梦谈多话 2020-12-30 15:56

I am receiving an XML document from a REST service which shall be parsed using SAX. Please see the following example which was generated out of the XSD.

Setting up th

6条回答
  •  佛祖请我去吃肉
    2020-12-30 16:02

    I usually put objects on a stack, and push/pop them while parsing the XML file (particularly useful if objects are nested, but that's not your case).

    If you want a simpler approach, you need at a pointer to the current ConnectionList and to the current Connection. Since you already know the structure of your file, this could be easier than using a stack-based parser.

提交回复
热议问题