【发布时间】:2013-08-20 09:41:36
【问题描述】:
我将 twitter 的 JSON 搜索输出加载到 Marklogic 中,并使用基本转换器将其转换为 Marklogic 的 JSON XML 格式。
当我尝试使用以下 XQuery 查询 id 时
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
for $r in doc()/json
let $b:=$r/id
return (
$b)
它一直抱怨没有结果。
当我使用 doc() 时,xml 显示正常,但 doc()/json 不显示任何内容。
以下是 Marklogic 从 Twitter 的 JSON 输出生成的 XML 的 sn-p
<?xml version="1.0" encoding="UTF-8"?>
<json type="object" xmlns="http://marklogic.com/xdmp/json/basic">
<contributors type="null"/>
<truncated type="boolean">false</truncated>
<text type="string">@angelicism I love this site: http://t.co/XIjckcu0Lk</text>
<in__reply__to__status__id type="number">369589929183297536</in__reply__to__status__id>
<id type="number">369595664277065728</id>
<favorite__count type="number">0</favorite__count>
...
【问题讨论】: