以文本方式查看主题 - W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL (http://bbs.xml.org.cn/index.asp) -- 『 DOM/SAX/XPath 』 (http://bbs.xml.org.cn/list.asp?boardid=11) ---- 像高手请教一个dom 加载 xml文件的问题 (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=24863) |
-- 作者:mimimi -- 发布时间:12/1/2005 10:11:00 AM -- 像高手请教一个dom 加载 xml文件的问题 我用dom+vc解析xml文件。xml文件的一部分如下 <SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd"> 程序一部分:m_pDomDoc->async = VARIANT_FALSE; // Configure DOM properties for namespace selection. m_pDomDoc->load(“my.xml”); |
-- 作者:mimimi -- 发布时间:12/2/2005 10:38:00 AM -- 没人知道吗? |
-- 作者:wangjia184 -- 发布时间:12/15/2005 1:30:00 PM -- 给你看段代码 _bstr_t validateFile(_bstr_t strFile) // Declare and initialize variables // Create a schema cache and add books.xsd to it. // Create a DOMDocument and set its properties. // Assign the schema cache to the DOMDocument's // Load books.xml as the DOM document. pErr = pXD->parseError; // Return validation results in message to the user. return strResult; // Clean up and destroy objects. void main() void dump_com_error(_com_error &e) |
-- 作者:wangjia184 -- 发布时间:12/15/2005 1:33:00 PM -- 把 上面 代码中的 hr = pXS->add("urn:books", "sc.xsd"); 改成
|
-- 作者:wangjia184 -- 发布时间:12/15/2005 1:34:00 PM -- 把 上面 代码中的 hr = pXS->add("urn:books", "sc.xsd"); 改成 nResult = pIXMLDOMSchemaCollection2Ptr->add(_T("x-schema:books"), _T("c:\\books.xsd")); 之类的 应该就可以了 |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
7,554.688ms |