msxml使用求救、。。。。。。(100分)

  • 主题发起人 主题发起人 一只笨小狗
  • 开始时间 开始时间

一只笨小狗

Unregistered / Unconfirmed
GUEST, unregistred user!
我用下面代码,如果xml文件没有DOCTYPE定义,就能得到package,如果加上DOCTYPE,就什么都得不到。请大家看看,应该怎么做?<br><br>代码如下:<br>&nbsp; &nbsp; xmlobj := CoFreeThreadedDOMDocument30.Create;<br>&nbsp; &nbsp; xmlobj.async := false;<br>&nbsp; &nbsp; xmlobj.load('default.xml');<br>&nbsp; &nbsp; items := xmlobj.SelectNodes('//package');<br>&nbsp; &nbsp; memo1.Lines.Clear;<br>&nbsp; &nbsp; for ii := 0 to items.length - 1 do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; memo1.Lines.Add(items.item[ii].xml);<br>&nbsp; &nbsp; end;<br><br>default.xml如下:<br>&lt;?xml version="1.0" encoding="utf-8" standalone="no"?&gt;<br>&lt;!DOCTYPE package PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.0 Package//EN " "oebpkg1.dtd"&gt;<br>&lt;package unique-identifier="digitallibrary"&gt;<br> &lt;metadata&gt;<br> &lt;dc-metadata xmlns:dc="http://purl.org/dc/elements/1.0/" xmlns:oebpackage="http://openebook.org/namespaces/oeb-package/1.0/"&gt;<br> &lt;/dc-metadata&gt;<br> &lt;x-metadata&gt;<br> &lt;meta name="label1" content=""/&gt;<br> &lt;meta name="label2" content=""/&gt;<br> &lt;/x-metadata&gt;<br> &lt;/metadata&gt;<br> &lt;manifest&gt;<br> &lt;/manifest&gt;<br> &lt;spine&gt;<br> &lt;itemref idref="toc"/&gt;<br> &lt;/spine&gt;<br> &lt;guide&gt;<br> &lt;/guide&gt;<br>&lt;/package&gt;<br>
 
后退
顶部