XPathExtractor

XPathExtractor bean attributes

An XPathExtractor is created using a Spring bean with the following attributes:

Attribute Value Description
id User-defined A unique ID for the bean.
parent rdf.extractor.xpath.abstract The parent bean.

XPathExtractor bean properties

The XPathExtractor bean takes the following properties:

Property Type Mandatory Description
xmlSchemaFilter XmlSchemaFilter Required A filter for which the bean applies.
xpathQueries Map <QName,String> Required Map defining the XPath expressions to used for each predicate. Use a fully-qualified name with Clark notation as the key of the entry.

XPathExtractor bean example

<bean id="samples.extractor.troubleshooting.xpath" parent="rdf.extractor.xpath.abstract">
  <property name="xmlSchemaFilter" ref="samples.dtd.troubleshooting" />
  <property name="xpathQueries">
    <map>
      <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}causes" value="/tsTroubleshooting/tsBody/tsCauses" />
      <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}environment" value="/tsTroubleshooting/tsBody/tsEnvironment" />
      <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}shortdesc" value="/tsTroubleshooting/abstract/shortdesc" />
      <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}symptoms" value="/tsTroubleshooting/tsBody/tsSymptoms" />
      <entry key="{http://www.componize.com/model/samples/troubleshooting/1.0/}tasks" value="/tsTroubleshooting/task/title" />
    </map>
  </property>
</bean>

Debugging

To debug your XPathExtractor, add the following entry to your log4j.properties file:

log4j.logger.com.componize.rdf.pipeline.stax.XPathExtractorFactory=trace