Re: Xpath extract element name
Great. XSL worked like a charm! Thx lots. -- View this message in context: http://lucene.472066.n3.nabble.com/Xpath-extract-element-name-tp1534390p1567809.html Sent from the Solr - User mailing list archive at Nabble.com.
Xpath extract element name
Hi guys, I'm trying to map a field to name of an element in DIH. Is this possible? I'm not sure the limitation of solr on xpath. This is my sample xml manifest metadata/metadata resources audio/audio /resources /manifest I've tried field column=resource_type xpath=/manifest/resources/*[last]/name() /. Doesn't seem to do anything. field column=resource_type xpath=node-name(/manifest/resources/*[last]) /. This throws exception as xpath must start with / Can anyone help, please? Many thanks in advance. -- View this message in context: http://lucene.472066.n3.nabble.com/Xpath-extract-element-name-tp1534390p1534390.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Xpath extract element name
The XPath implementation only supports a few features of xpath. But, you can give it an XSL script that transforms the incoming XML before it hits the XPathEntityProcessor. You can use this to boil down the incoming to a simple format with the things you want. yklxmas wrote: Hi guys, I'm trying to map a field to name of an element in DIH. Is this possible? I'm not sure the limitation of solr on xpath. This is my sample xml manifest metadata/metadata resources audio/audio /resources /manifest I've tried field column=resource_type xpath=/manifest/resources/*[last]/name() /. Doesn't seem to do anything. field column=resource_type xpath=node-name(/manifest/resources/*[last]) /. This throws exception as xpath must start with / Can anyone help, please? Many thanks in advance.