class FeedsXPathParserXML in Feeds XPath Parser 6
Same name and namespace in other branches
- 7 FeedsXPathParserXML.inc \FeedsXPathParserXML
Parse XML using XPath.
Hierarchy
- class \FeedsConfigurable
- class \FeedsPlugin implements FeedsSourceInterface
- class \FeedsParser
- class \FeedsXPathParserBase
- class \FeedsXPathParserXML
- class \FeedsXPathParserBase
- class \FeedsParser
- class \FeedsPlugin implements FeedsSourceInterface
Expanded class hierarchy of FeedsXPathParserXML
3 string references to 'FeedsXPathParserXML'
- FeedsXPathParserXMLTestCase::test in tests/
feeds_xpathparser_parser_xml.test - Run tests.
- FeedsXPathParserXMLTestCase::testVariables in tests/
feeds_xpathparser_parser_xml.test - Test variable substitution.
- feeds_xpathparser_feeds_plugins in ./
feeds_xpathparser.module - Implementation of hook_feeds_plugins().
File
- ./
FeedsXPathParserXML.inc, line 11 - s Provides the FeedsXPathParserXML class.
View source
class FeedsXPathParserXML extends FeedsXPathParserBase {
/**
* Implementation of FeedsXPathParserBase::setup().
*/
protected function setup($source_config, FeedsImportBatch $batch) {
if (!empty($source_config['exp']['tidy'])) {
$config = array(
'input-xml' => TRUE,
'wrap' => 0,
'tidy-mark' => FALSE,
);
// Default tidy encoding is UTF8.
$encoding = $source_config['exp']['tidy_encoding'];
$raw = tidy_repair_string(trim($batch
->getRaw()), $config, $encoding);
}
else {
$raw = $batch
->getRaw();
}
$doc = new DOMDocument();
$use = $this
->errorStart();
$success = $doc
->loadXML($raw);
unset($raw);
$this
->errorStop($use, $source_config['exp']['errors']);
if (!$success) {
throw new Exception(t('There was an error parsing the XML document.'));
}
return $doc;
}
protected function getRaw(DOMNode $node) {
return $this->doc
->saveXML($node);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | CTools export enabled status of this object. | |
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
public | function | Similar to setConfig but adds to existing configuration. | 1 |
FeedsConfigurable:: |
public | function | Submission handler for configForm(). | 3 |
FeedsConfigurable:: |
public | function | Copy a configuration. | 1 |
FeedsConfigurable:: |
public | function | Determine whether this object is persistent and enabled. I. e. it is defined either in code or in the database and it is enabled. | 1 |
FeedsConfigurable:: |
public | function | Implementation of getConfig(). | 1 |
FeedsConfigurable:: |
public static | function | Instantiate a FeedsConfigurable object. | 1 |
FeedsConfigurable:: |
public | function | Set configuration. | 1 |
FeedsConfigurable:: |
public | function | Override magic method __get(). Make sure that $this->config goes through getConfig() | |
FeedsConfigurable:: |
public | function | Override magic method __isset(). This is needed due to overriding __get(). | |
FeedsParser:: |
public | function | Clear all caches for results for given source. | |
FeedsParser:: |
public | function | Get an element identified by $element_key of the given item. The element key corresponds to the values in the array returned by FeedsParser::getMappingSources(). | 1 |
FeedsPlugin:: |
public | function |
Returns TRUE if $this->sourceForm() returns a form. Overrides FeedsSourceInterface:: |
|
FeedsPlugin:: |
protected static | function | Loads on-behalf implementations from mappers/ directory. | |
FeedsPlugin:: |
public | function |
Save changes to the configuration of this object.
Delegate saving to parent (= Feed) which will collect
information from this object by way of getConfig() and store it. Overrides FeedsConfigurable:: |
|
FeedsPlugin:: |
public | function |
A source is being deleted. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
public | function |
A source is being saved. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
protected | function |
Constructor. Overrides FeedsConfigurable:: |
|
FeedsXPathParserBase:: |
protected | property | ||
FeedsXPathParserBase:: |
protected | property | ||
FeedsXPathParserBase:: |
protected | property | ||
FeedsXPathParserBase:: |
protected | property | ||
FeedsXPathParserBase:: |
public | function |
Define defaults. Overrides FeedsConfigurable:: |
|
FeedsXPathParserBase:: |
public | function |
Override parent::configForm(). Overrides FeedsConfigurable:: |
|
FeedsXPathParserBase:: |
public | function |
Override parent::sourceFormValidate(). Overrides FeedsConfigurable:: |
|
FeedsXPathParserBase:: |
protected | function | ||
FeedsXPathParserBase:: |
protected | function | ||
FeedsXPathParserBase:: |
protected | function | Filters mappings, returning the ones that belong to us. | |
FeedsXPathParserBase:: |
public | function |
Override parent::getMappingSources(). Overrides FeedsParser:: |
|
FeedsXPathParserBase:: |
protected | function | ||
FeedsXPathParserBase:: |
public | function |
Implements FeedsParser::parse(). Overrides FeedsParser:: |
|
FeedsXPathParserBase:: |
protected | function | Parses one item from the context array. | |
FeedsXPathParserBase:: |
public | function |
Define defaults. Overrides FeedsPlugin:: |
|
FeedsXPathParserBase:: |
public | function |
Source form. Overrides FeedsPlugin:: |
|
FeedsXPathParserBase:: |
public | function |
Override parent::sourceFormValidate(). Overrides FeedsPlugin:: |
|
FeedsXPathParserXML:: |
protected | function |
Overrides FeedsXPathParserBase:: |
|
FeedsXPathParserXML:: |
protected | function |
Implementation of FeedsXPathParserBase::setup(). Overrides FeedsXPathParserBase:: |