如何知道DOMDocument是否由解析器拥有 [英] How to know if a DOMDocument is owned by a parser

查看:173
本文介绍了如何知道DOMDocument是否由解析器拥有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调查一个API从两个不同的来源调用的问题。
我们有一个叫dispatch的API。其签名如下。

  DOMDocument * dispatch(DOMDocument * requestDocument)
/ pre>

我们观察到这个API可以通过传递一个DOMDocument对象来调用


  1. 使用DOMImplementation :: createDocument创建的独立DOMDocument对象
    http://xerces.apache.org/xerces-c/apiDocs-3/classDOMImplementation.html


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


如果我使用方法1创建了一个文档,它不会被解析器拥有。但是,如果我使用方法2创建它,它将由解析器拥有。



我的问题是,如果我有一个文档,我怎么知道它是否由解析器拥有?。



你能帮我上这个或指点我一些资源。

解决方案



div>

它们都是解析的结果。


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.

解决方案

They're both the result of parsing.

这篇关于如何知道DOMDocument是否由解析器拥有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆