1.0.2 • Published 9 years ago
xfluent v1.0.2
XFLUENT
Fluent api for reading javascript documents/xml objects
Usage
var fluent = new XFluent(doc)
fluent
.get('Linear')
.get('MediaFile')
.filterByAttribute('type', 'bitrate', (type, bitrate) => {
bitrate = Number(bitrate)
// options is a variable that I already have
return (options.supportedMediaTypes.indexOf(type) !== -1 &&
(bitrate >= options.mediaBitrateMim && bitrate <= options.mediaBitrateMax))
})
.each((el) => {
videoUrl = el.childNodes[0].nodeValue
})
.up()
.get('ClickThrough')
.each((el) => {
videoClickThrough = el.childNodes[0].nodeValue
})
.end()