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