Jakob,

Both of these should work, but I'm not sure how efficient the first one will be.

//div[contains(@class/text(), "facet")],
cts:search(//div, cts:element-attribute-value-query(xs:QName("div"), 
xs:QName("class"), "facet"))

The error is that @class is an attribute node, but contains needs a string.

Yours,
Damon

--
Damon Feldman
Sr. Principal Consultant, MarkLogic

From: [email protected] 
[mailto:[email protected]] On Behalf Of Jakob Fix
Sent: Wednesday, February 27, 2013 4:07 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] problem interpreting an XPath expression?

Hi,

I am probably daft here, but I'm getting an error for the following expression 
which I'm trying to apply to your typical Bootstrap-based HTML page:

//div[contains(@class, "facet")]

The error I'm getting is the following:

[1.0-ml] XDMP-ARGTYPE: (err:XPTY0004) fn:contains(attribute{fn:QName("", 
"class")}{"mainPane clearfix"}, "facet") -- arg1 is not of type xs:string?

This expression works elsewhere, but MarkLogic returns this error. I'm stumped 
... Oh, I've upgraded to 6.0-2.3.  Thanks as ever!

cheers,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to