The XPathEntityProcessor does not do full XPath. It is a very limited set intended to be very fast. You can add code in any scripting language, but that is not really performant. Is it possible to use the RegexTransformer to find your records with regular expressions?

Ken Stanley wrote:
On Fri, Oct 22, 2010 at 11:52 PM,<pghorp...@ucla.edu>  wrote:


<dataConfig>
<dataSource name="myfilereader" type="FileDataSource"/>
<document>
<entity name="f" rootEntity="false" dataSource="null"
processor="FileListEntityProcessor" fileName=".*xml" recursive="true"
baseDir="C:\data\sample_records\mods\starr">
<entity name="x" dataSource="myfilereader" processor="XPathEntityProcessor"
url="${f.fileAbsolutePath}" stream="false" forEach="/mods"
transformer="DateFormatTransformer,RegexTransformer,TemplateTransformer">
<field column="id" template="${f.file}"/>
<field column="collectionKey" template="starr"/>
<field column="collectionName" template="starr"/>
<field column="fileAbsolutePath" template="${f.fileAbsolutePath}"/>
<field column="fileName" template="${f.file}"/>
<field column="fileSize" template="${f.fileSize}"/>
<field column="fileLastModified" template="${f.fileLastModified}"/>
<field column="classification_keyword" xpath="/mods/classification"/>
<field column="accessCondition_keyword" xpath="/mods/accessCondition"/>
<field column="nameNamePart_s" xpath="/mods/name/namepa...@type = 'date']"
/>
</entity>
</entity>
</document>
</dataConfig>

The documentation says you don't need a dataSource for your
XPathEntityProcessor entity; in my configuration, I have mine set to the
name of the top-level FileListEntityProcessor. Everything else looks fine.
Can you provide one record from your data? Also, are you getting any errors
in your log?

- Ken

Reply via email to