instant-articles-builder icon indicating copy to clipboard operation
instant-articles-builder copied to clipboard

Add support for XPath selectors

Open diegoquinteiro opened this issue 7 years ago • 0 comments

Some of the default rules defined in the SDK use XPath selectors. Should we also add support for them?

Example:

{
	"class": "InstantArticleRule",
	"selector": "head",
	"properties": {
		"article.canonical": {
			"type": "string",
			"selector": "link",
			"attribute": "href"
		},
		"article.charset": {
			"type": "xpath",
			"selector": "//meta[@charset]",
			"attribute": "charset"
		},
		"article.markup.version": {
			"type": "xpath",
			"selector": "//meta[@property='op:markup_version']",
			"attribute": "content"
		},
		"article.auto.ad": {
			"type": "xpath",
			"selector": "//meta[@property='fb:use_automatic_ad_placement']",
			"attribute": "content"
		},
		"article.style": {
			"type": "xpath",
			"selector": "//meta[@property='fb:article_style']",
			"attribute": "content"
		}
	}
}

diegoquinteiro avatar Nov 16 '17 03:11 diegoquinteiro