tixi icon indicating copy to clipboard operation
tixi copied to clipboard

Compare values in XPath Expression with „<” or „>” does not work

Open rainman110 opened this issue 3 years ago • 1 comments

TEST_F(TxUtilsTest, test_tixiXpath_by_attribute_relations) {
  TixiDocumentHandle h = -1;
  ASSERT_EQ(SUCCESS, tixiCreateDocument("root", &h));
  ASSERT_EQ(SUCCESS, tixiCreateElement(h, "/root", "child"));
  ASSERT_EQ(SUCCESS, tixiCreateElement(h, "/root", "child"));
  ASSERT_EQ(SUCCESS, tixiCreateElement(h, "/root", "child"));
  ASSERT_EQ(SUCCESS, tixiCreateElement(h, "/root", "child"));
  ASSERT_EQ(SUCCESS, tixiAddTextAttribute(h, "/root/child[1]", "attr", "a"));
  ASSERT_EQ(SUCCESS, tixiAddTextAttribute(h, "/root/child[2]", "attr", "b"));
  ASSERT_EQ(SUCCESS, tixiAddTextAttribute(h, "/root/child[3]", "attr", "c"));
  ASSERT_EQ(SUCCESS, tixiAddTextAttribute(h, "/root/child[4]", "attr", "d"));

  char *xPath;
  // This doesn't work with Tixi 3.1.1
  ASSERT_EQ(SUCCESS,
            tixiXPathExpressionGetXPath(h, "//child[@attr>\"b\"]", 1, &xPath));
}

rainman110 avatar Apr 30 '21 15:04 rainman110

Did you try &gt; instead of >?

Also, are you sure that greater than is defined for arbitrary strings in XPath?

ArneBachmannDLR avatar Apr 30 '21 15:04 ArneBachmannDLR