我正在尝试在 Go 中为大型 xml 文件( dblp.xml )编写一个非常简单的解析器,其摘录如下:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE dblp SYSTEM "dblp.dtd">
<dblp>
<article key="journals/cacm/Gentry10" mdate="2010-04-26">
<author>Craig Gentry</author>
<title>Computing arbitrary functions of encrypted data.</title>
<pages>97-105</pages>
<year>2010</year>
<volume>53</volume>
<journal>Commun. ACM</journal>
<number>3</number>
<ee>http://doi.acm.org/10.1145/1666420.1666444</ee>
<url>db/journals/cacm/cacm53.html#Gentry10</url>
</article>
<article key="journals/cacm/Gentry10" mdate="2010-04-26">
<author>Craig Gentry Number2</author>
<title>Computing arbitrary functions of encrypted data.</title>
<pages>97-105</pages>
<year>2010</year>
<volume>53</volume>
<journal>Commun. ACM</journal>
<number>3</number>
<ee>http://doi.acm.org/10.1145/1666420.1666444</ee>
<url>db/journals/cacm/cacm53.html#Gentry10</url>
</article>
</dblp>
我的代码如下,看起来好像在 发生了一些事情xml.Unmarshal(byteValue, &articles),因为我无法在输出中获取任何 xml 的值。你能帮我解决我的代码有什么问题吗?
相关分类