Javascript MarkLogic cts.elementQuery使用xs.QName不返回结果

Javascript MarkLogic cts.elementQuery使用xs.QName不返回结果,javascript,marklogic,marklogic-8,Javascript,Marklogic,Marklogic 8,我有一个简单的JavaScript查询: cts.search( cts.elementQuery(xs.QName("headline"), "NYSE") ) 以下是数据库中的一个文件: <?xml version="1.0" encoding="UTF-8"?> <ContentEnvelope majVers="1" minVers="0.7" pubStyle="Message" xmlns="http://data.schemas.tfn.thomson

我有一个简单的JavaScript查询:

cts.search(
    cts.elementQuery(xs.QName("headline"), "NYSE")
)
以下是数据库中的一个文件:

<?xml  version="1.0" encoding="UTF-8"?>
<ContentEnvelope majVers="1" minVers="0.7" pubStyle="Message" xmlns="http://data.schemas.tfn.thomson.com/Envelope/2008-05-01/" xmlns:news="http://news.schemas.tfn.thomson.com/2008-05-01/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <Info>
            <Id>20151009-194502000-nZHN0BKF21-1-2</Id>
            <TimeStamp>2015-10-09T19:45:03.228Z</TimeStamp>
        </Info>
    </Header>
    <Body contentSet="News" majVers="1" minVers="3.0">
        <ContentItem action="Insert">
            <Entitlements/>
            <Data xsi:type="news:NewsDataItem">
                <newsItem standard="NewsML-G2" standardversion="2.7" conformance="power" guid="20151009-194502000-nZHN0BKF21-1-2" version="1" xml:lang="en" xsi:schemaLocation="http://iptc.org/std/nar/2006-10-01/ NAR_1.8-spec-All-Power_2.xsd http://www.w3.org/1999/xhtml xhtml1-strict.xsd" xmlns="http://iptc.org/std/nar/2006-10-01/" xmlns:rtr="http://www.reuters.com/ns/2003/08/content" xmlns:x="http://www.w3.org/1999/xhtml">
                    <catalogRef/>
                    <itemMeta/>
                    <contentMeta>
                        <urgency>3</urgency>
                        <altId type="idType:USN" rtr:isOriginal="1">nZHN0BKF21</altId>
                        <language tag="en">
                        </language>
                        <subject qcode="N2:US">
                        </subject>
                        <headline>NYSE ORDER IMBALANCE <EMC.N> 205600 SHARES ON BUY SIDE</headline>
                    </contentMeta>
                    <contentSet/>
                </newsItem>
            </Data>
        </ContentItem>
    </Body>
</ContentEnvelope>

20151009-194502000-nZHN0BKF21-1-2
2015-10-09T19:45:03.228Z
3.
nZHN0BKF21
纽约证券交易所指令买入方不平衡205600股

我得到一个空响应。

查询中缺少名称空间声明。尝试使用此查询-

cts.search(
    cts.elementQuery(fn.QName("http://iptc.org/std/nar/2006-10-01/", "headline"), "NYSE")
)

不起作用。搜索(“NYSE”)可以工作,所以它肯定在数据库中。我用正确的名称空间更新了答案。现在就试试吧。