我已经经历了大约 20 个尝试将 xml 解析为 excel 的示例,但似乎没有一个适用于我的源代码。这里最大的问题是我不知道如何在 excel VBA 中解析 xml。
以下是我的问题:
1) 有没有我可以用来理解你们推荐的 Excel 中使用的 MSXML 参考库的在线资源?2) 我要解析的 xml 是否存在格式错误?(参见下面的示例 xml)
错误消息通常似乎有两个主题。该示例使用了未在 MSXML v6 中定义的变量,或者它打开了 xml 但从未找到文档元素。
*更新:对不起,我应该说我正在尝试获取消息 href、主题标题、发布日期和变量 Kudos
<response status="success">
<node_message_context type="node_message_context">
<message type="message" href="/messages/id/25704">
<id type="int">25704</id>
<read_only type="boolean">false</read_only>
<message_rating type="float">0.0</message_rating>
<last_edit_author type="user" href="/users/id/1094">
<login type="string">AllenSmith</login>
</last_edit_author>
<kudos>
<count type="int">1</count>
</kudos>
<last_edit_time type="date_time">2013-06-26T13:23:44+00:00</last_edit_time>
<post_time type="date_time">2013-06-26T13:23:44+00:00</post_time>
<board type="board" href="/boards/id/DesktopAPI"/>
<subject type="string">
Re: SKYPE4COM MessageStatus received event doesn't fire all the times (skype window has or not focu
</subject>
<deleted type="boolean">false</deleted>
<author type="user" href="/users/id/1094">
<login type="string">AllenSmith</login>
</author>
<thread type="thread" href="/threads/id/25696"/>
<root type="message" href="/messages/id/25696"/>
<board_id type="int">1331</board_id>
<parent type="message" href="/messages/id/25696"/>
<teaser type="string"/>
<views>
<count type="int">43</count>
</views>
</message>
<message type="message" href="/messages/id/25690">
<id type="int">25690</id>
<read_only type="boolean">false</read_only>
<message_rating type="float">0.0</message_rating>
<last_edit_author type="user" href="/users/id/1094">
<login type="string">AllenSmith</login>
</last_edit_author>
<kudos>
<count type="int">0</count>
</kudos>
<last_edit_time type="date_time">2013-06-25T13:38:17+00:00</last_edit_time>
<post_time type="date_time">2013-06-25T13:38:17+00:00</post_time>
<board type="board" href="/boards/id/SkypeKitAPI"/>
<subject type="string">Re: Connection to the runtime was refused</subject>
<deleted type="boolean">false</deleted>
<author type="user" href="/users/id/1094">
<login type="string">AllenSmith</login>
</author>
<thread type="thread" href="/threads/id/23414"/>
<root type="message" href="/messages/id/23414"/>
<board_id type="int">6977</board_id>
<parent type="message" href="/messages/id/23414"/>
<teaser type="string"/>
<views>
<count type="int">64</count>
</views>
</message>