Text mining and content categorization

xpath in SAS Content Categorizer

New Contributor
Posts: 4

xpath in SAS Content Categorizer


In categorizer rules, we can query by XML elements (_Title:"sample") and attributes within specified elements (_Occurrence\Id="sample":1), but not by xpath.  Since our XML schema reuses certain common element names and attributes in multiple locations, specifying the full xpath is essential for many of our queries.  Does anyone know whether xpath search is available in newer versions?  We are using a very old version of Content Categorizer (actually tk240). 



SAS Employee
Posts: 5

Re: xpath in SAS Content Categorizer

Posted in reply to HeatherL_Edwards

Hi Heather,

Yes, Enterprise Content Categorization now supports XPath functionality.  So if you have, say, an xml document that looks like:



<body>         Here is where we talk about Bill Nye.   </body>

<body>         Here is another part of the body where we talk about Bill Cosby.   </body>



Then there are multiple body elements.  Let's say you want to match the name 'Bill' - but only in the second body element.  Then we can use a rule of the form:

(OR, _/article/body[2]:"_c{Bill}")

which will not match Bill Nye but will match Bill Cosby.

Hope this helps.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation