Skipping nodes with sax

前端 未结 3 2107
耶瑟儿~
耶瑟儿~ 2021-01-19 04:31

Is it possible to skip nodes when parsing and how, does this skippedEntity have anything to do with it?

Consider this XML :



        
3条回答
  •  长情又很酷
    2021-01-19 05:30

    Please edit your post to include a sample XML and a description of what you mean by "skip nodes".

    Since your parser gets control on each event, you can choose to do nothing based on any criteria you desire. If you want to skip an entire subtree, you have to set a global flag when you encounter the subtree's start element and clear the flag at the end element; then use the flag to control processing of the contained nodes.

提交回复
热议问题