How to know if a DOMDocument is owned by a parser

余生长醉 提交于 2019-12-25 06:22:20

问题


I am looking into an issue where an API is getting called from two different sources. We have an API called dispatch. Its signature is as follows.

DOMDocument* dispatch( DOMDocument * requestDocument )

We observed that this API can be called by passing a DOMDocument object that is

  1. A stand-alone DOMDocument object created using DOMImplementation::createDocument http://xerces.apache.org/xerces-c/apiDocs-3/classDOMImplementation.html

  2. A parse owned DOMDocument object created using AbstractDOMParser::getDocument http://xerces.apache.org/xerces-c/apiDocs-3/classAbstractDOMParser.html#143bc9285686b49f0f06a184b079292a

If i created a document using approach 1, it wont be owned by the parser. However, if i create it using approach 2, it would be owned by the parser.

My question is, if i have a document, how would i know whether it is owned by a parser or not?.

Can you please help me on this or point me to some resource. I am exploring as we speak.

Thanks, PAvan.


回答1:


They're both the result of parsing.



来源:https://stackoverflow.com/questions/23673300/how-to-know-if-a-domdocument-is-owned-by-a-parser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!