Given the following HTML document:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="foo" content="bar" />
<meta name="another item" content="12345" />
</head>
<body>
</body>
</html>
I created a range-path-index targeting the <meta name="foo" content="bar" /> @content value:
{
"scalar-type": "string",
"collation": "http://marklogic.com/collation/en/S1",
"range-value-positions": false,
"invalid-values": "reject",
"path-expression": "/*:html/*:head/*:meta[@name='foo']/@content"
}
However, I am getting the following error whenever the xpath /*:html/*:head/*:meta[@name='foo'] is evaluated:
[1.0-ml] XDMP-LEXVAL: xs:NMTOKEN("another item") -- Invalid lexical value "another item"
For example:
fn:doc('/test/test.xhtml')/*:html/*:head/*:meta[@name='foo']
It will also prevent new documents with the same structure from being ingested (due to "invalid-values": "reject").
I don't understand where the error comes from. It seems if I remove white spaces from all meta tag names, it would work. But that is not a practical solution. Thanks!