Difference between revisions of "XPath queries"

From OpenKM Documentation
Jump to: navigation, search
(Created page with 'Can be found more information about XPATH in http://www.w3.org/TR/xpath20/ == Examples == '''locked documents''' //element(*, okm:document)[@jcr:lockOwner] locked documents …')
 
Line 6: Line 6:
 
  //element(*, okm:document)[@jcr:lockOwner]
 
  //element(*, okm:document)[@jcr:lockOwner]
  
locked documents by user pavila
+
'''locked documents by user pavila'''
  
 
  //element(*, okm:document)[@okm:author='pavila']
 
  //element(*, okm:document)[@okm:author='pavila']
  
search documents by content
+
'''search documents by content'''
  
 
  //element(*, okm:document)[jcr:contains(okm:content, 'linux')]
 
  //element(*, okm:document)[jcr:contains(okm:content, 'linux')]
  
folders created by user pavila
+
'''folders created by user pavila'''
  
 
  //element(*, okm:folder)[@okm:author='pavila']
 
  //element(*, okm:folder)[@okm:author='pavila']
  
example of complex query, documents with content linux and keyword ubuntu
+
'''example of complex query, documents with content linux and keyword ubuntu'''
  
 
  //element(*,okm:document)[jcr:contains(okm:content,'linux') and jcr:contains(@okm:keywords,'ubuntu')]
 
  //element(*,okm:document)[jcr:contains(okm:content,'linux') and jcr:contains(@okm:keywords,'ubuntu')]
 +
 +
 +
 +
 +
[[Category: Administration Guide]]

Revision as of 10:09, 3 March 2010

Can be found more information about XPATH in http://www.w3.org/TR/xpath20/

Examples

locked documents

//element(*, okm:document)[@jcr:lockOwner]

locked documents by user pavila

//element(*, okm:document)[@okm:author='pavila']

search documents by content

//element(*, okm:document)[jcr:contains(okm:content, 'linux')]

folders created by user pavila

//element(*, okm:folder)[@okm:author='pavila']

example of complex query, documents with content linux and keyword ubuntu

//element(*,okm:document)[jcr:contains(okm:content,'linux') and jcr:contains(@okm:keywords,'ubuntu')]