55
json xml javascript node.js html grunt css java responsive Bullshit Bingo Teil 1

Podlove Podcast Validator

Embed Size (px)

Citation preview

json xml javascript

node.js html grunt

css java responsive

Bullshit Bingo Teil 1

expath xquery xforms

schematron xupdate xproc

xpath restxq xml schema

Bullshit Bingo Teil 2

Neues aus dem Labor Der Podlove Validator

01. Mai 2o15 lars windauer

@

Really Simple Syndication

iTunes

Atom

Feedburner

Feed Paging and Archiving

Podlove Simple Chapters

Dublin Core

0.9x Rich Site Summary

0.9 & 1.0 RDF Site Summary

2.0 Really Simple Syndication

RSS

Content

Mods

Bitlove Creative Commons

Slash

Trackback

ATOM

iTunes

Feedburner

Feed Paging and Archiving

Dublin Core

Content

Mods

Bitlove

Creative CommonsSlash

Trackback

back to reality

<XML/>

XQuery

XPath

XSLT

XML Schema

(X)HTML

CSS

RDF

XFORMS

XML Encryption

OWL DOM

SVG

XSL-FO

HTML

PNG

WAI-ARIA

… …

• abs math:acos op:add-dayTimeDurations op:add-dayTimeDuration-to-date time op:add-yearMonthDurations op:add-yearMonthDuration-to-date op:add-yearMonthDuration-to-dateTime adjust-dateTime-to-timezone adjust-date-to-timezone adjust-time-to-timezone analyze-string array:append apply math:asin math:atan math:atan2 available-environment-variables avg

• op:base64Binary-equal op:base64Binary-greater-than op:base64Binary-less-than base-uri boolean op:boolean-equal op:boolean-greater-than op:boolean-less-than

• ceiling codepoint-equal codepoints-to-string collation-key collection compare concat op:concatenate contains map:contains contains-token math:cos count current-date current-dateTime current-time

• data op:date-equal op:date-greater-than op:date-less-than dateTime op:dateTime-equal op:dateTime-greater-than op:dateTime-less-than day-from-date day-from-dateTime days-from-duration op:dayTimeDuration-greater-than op:dayTimeDuration-less-than dayTimeDuration op:divide-dayTimeDuration-by-dayTimeDuration op:divide-yearMonthDuration op:divide-yearMonthDuration-by-yearMonthDuration doc doc-available document-uri op:duration-equal

• element-with-id empty encode-for-uri ends-with map:entry environment-variable error escape-html-uri exactly-one op:except exists math:exp math:exp10 • false filter array:filter array:flatten floor fold-left array:fold-left fold-right array:fold-right for-each

each-pair format-date format-dateTime format-integer format-number format-time function-arity function-lookup function-name • op:gDay-equal • has-children head array:head op:hexBinary-equal op:hexBinary-greater-than op:hexBinary-less-than hours-from-dateTime hours-from-duration hours-from-

time • id idref implicit-timezone index-of innermost in-scope-prefixes insert-before array:insert-before op:intersect iri-to-uri op:is-same-node • array:join json-doc • map:keys • lang last load-xquery-module local-name local-name-from-QName math:log math:log10 lower-case • matches max map:merge min minutes-from-dateTime minutes-from-duration minutes-from-time month-from-date month-from-dateTime months-from-duration

op:multiply-dayTimeDuration op:multiply-yearMonthDuration • name namespace-uri namespace-uri-for-prefix namespace-uri-from-QName nilled op:node-after op:node-before node-name normalize-space normalize-

unicode not op:NOTATION-equal number op:numeric-add op:numeric-divide op:numeric-equal op:numeric-greater-than op:numeric-integer-divide op:numeric-less-than op:numeric-mod op:numeric-multiply op:numeric-subtract op:numeric-unary-minus op:numeric-unary-plus

• one-or-more outermost • parse-ietf-date • QName op:QName-equal • random-number-generator remove map:remove array:remove replace resolve-QName resolve-uri reverse array:reverse root round round-half-to-even • seconds-from-dateTime seconds-from-duration seconds-from-time serialize math:sin map:size array:size sort array:sort math:sqrt starts-with static-base-uri

string string-join string-length string-to-codepoints array:subarray subsequence substring substring-after op:subtract-dateTimes op:subtract-dayTimeDuration-from-date op:subtract-dayTimeDuration-from-dateTime op:subtract-dayTimeDuration-from-time op:subtract-dayTimeDurations op:subtract-times op:subtract-yearMonthDuration-from-date op:subtract-yearMonthDuration-from-dateTime op:subtract-yearMonthDurations sum

• tail array:tail math:tan op:time-equal op:time-greater-than op:time-less-than timezone-from-date timezone-from-dateTime timezone-from-time op:to tokenize trace transform translate true

• op:union unordered unparsed-text unparsed-text-available unparsed-text-lines upper-case uri-collection • year-from-date year-from-dateTime op:yearMonthDuration-greater-than op:yearMonthDuration-less-than years-from-duration

XPath 3.1 Functions

Modules & Librariesatomic, atomic-acl, atomic-search, ant-tasks, jmx, dates, extensions, html2wiki, docbook, annotations, restxq, stanford-ner, versioning, compression, console, contentextraction, dbutil, docs, review, epub, file, httpclient, i18n, inspection; lucene, math, ngram, range, request, response scheduler, securitymanager, sequences, session, sort, system, template, testing, text, transform, trigger, util, validation, xacml, schema validation, schematron, xmldb, xforms, xqdoc xslfo, json, functx, xslt, map, xpath-math xqjson, expath {crypto, filetransfer, pdf, jfreechart}, messaging, replication, monitoring, xproc, xinclude, xquery update

XML feeds

XQuery Magie

HTML5 UX =

back to reality 2

XML Schema

<xs:schema xmlns:xs=„http://www.w3.org/2001/XMLSchema" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes=„http://www.itunes.com/dtds/podcast-1.0.dtd“ targetNamespace=„http://podlove.org/2015/podcast">

<xs:element name="rss"> <xs:complexType> <xs:sequence> <xs:element name="channel" minOccurs="1" maxOccurs="1"> <xs:complexType>

<xs:sequence> <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1"/>

<xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element ref="atom:link" minOccurs="0" maxOccurs="unbounded"/>

<xs:element name="author" type="authorType" minOccurs="0" maxOccurs="1"/> <xs:element name="item" type="itemType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="version" type="xs:string"/> </xs:complexType> </xs:element> <xs:complexType name="itemType"> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="author" type="authorType"/> </xs:sequence> </xs:complexType>

<xs:complexType name=„authorType" > <xs:sequence> <xs:element ref=„itunes:author" /> </xs:sequence> </xs:complexType> </xs:schema>

Und wie validiere ich mit XML Schema ein itunes:duration tag?

<itunes:duration>„Die Werte für diesen Tag können wie folgt formatiert werden: • SS:MM:ss, • S:MM:ss, • MM:ss oder • M:ss (S = Stunden, M = Minuten, s = Sekunden).

Wird nur eine Zahl angegeben (ohne Doppelpunkt), wird davon ausgegangen, dass es sich bei dem Wert um eine Sekundenangabe handelt.

Ist ein Doppelpunkt vorhanden, wird die Zahl links davon als Minuten-, die Zahl rechts davon als Sekundenangabe aufgefasst.

Bei mehr als zwei Doppelpunkten werden die Zahlen ganz rechts ignoriert.“Quelle: Internet, https://www.apple.com/de/itunes/podcasts/specs.html#duration

SchematronISO/IEC-Standard

Schematron

XQuery

Wie prüft Schemafron, dass ein itunes:image

mindesten 1400 x 1400 und höchstes 2048 x 2048 Pixel

hat?

„Das <itunes:image> Tag gibt die Grafik für den Podcast an, und zwar über die im <a href> Attribut angegebene URL‑Adresse.

Die Covergrafik muss eine

• JPEG- oder PNG-Datei • im RGB-Farbformat mit einer Größe von • mindestens 1400 x 1400 Pixeln und • höchstens 2048 x 2048 Pixeln

sein. Diese Vorgaben weichen von denen der standardmäßigen Angaben für das RSS-Tag „image“ ab.“

Quelle: Internet, https://www.apple.com/de/itunes/podcasts/specs.html#image

<itunes:image href=“http://cov.er/bild.jpg“/>

RSS++ Parser

Tag2Function Map

XQuery Parser

FollowRedirects müssen respektiert und richtig

dargestellt werden.

http3XX

REDIRECT

import org.exist.xquery.AbstractInternalModule; import org.exist.xquery.FunctionDef;

public class PodloveModule extends AbstractInternalModule {

public final static String NAMESPACE_URI = "http://podlove.org/ns/PodloveModule"; public final static String PREFIX = "podlove"; public final static String DESCRIPTION = “Podlove XQuery Module"; public final static String RELEASED_IN_VERSION = "eXist-2.2";

private final static FunctionDef[] functions = { new FunctionDef(HttpFunction.signature, HttpFunction.class), new FunctionDef(ImageAnalyzerFunction.signature,

ImageAnalyzerFunction.class) };

… }

package org.podlove;import org.apache.commons.httpclient.methods.HeadMethod;import org.exist.xquery.modules.httpclient.BaseHTTPClientFunction; public class HttpFunction extends BaseHTTPClientFunction {

public final static FunctionSignature signature = new FunctionSignature( new QName( “http-head", PodloveModule.NAMESPACE_URI, PodloveModule.PREFIX ), "Performs a HTTP HEAD with setRedirect=‘false’ request.", new SequenceType[] { URI_PARAM, PERSIST_PARAM, REQUEST_HEADER_PARAM}, XML_BODY_RETURN );

@Override public Sequence eval( Sequence[] args, Sequence contextSequence ) { … //get the url String url = args[0].itemAt(0).getStringValue(); //setup HEAD request HeadMethod head = new HeadMethod(url); head.setFollowRedirects(false); … }}

Tim ?

Stand der Dinge

Mehrstufige Validierung

the future is now

Code Review

Refactorings

Regeln und Fehlermeldungen

TestingDokumentation

UI Design

Coding

Javascript Ninjas

World-X eXplorers

Content-Queens & Kings

Define&Rule AgentsCSS Wizzards

Test-Doctors

[email protected] - @windauer - http://existdb.org

Slide Name Urheber Link

Universität Spiegelneuronen https://www.flickr.com/photos/spiegelneuronen/6330471492/

Complexity 1 nerovivo https://www.flickr.com/photos/dominik99/384027019/

Tree Evan Leeson https://www.flickr.com/photos/ecstaticist/2969032490

Atom Kevin Dooley https://www.flickr.com/photos/pagedooley/11360039856/

Complexity 2 Mark Skipper https://www.flickr.com/photos/bitterjug/7670055210

Data janneke staaks https://www.flickr.com/photos/jannekestaaks/14204638437/

DatenBank ManImMac https://www.flickr.com/photos/manimmac/2081196133

WWW Duncan Hull https://www.flickr.com/photos/dullhunk/14784487732

Create gfpeck https://www.flickr.com/photos/wespeck/4473683746

X Eugenio https://www.flickr.com/photos/hidden_vice/96343105

Q urbanmkr https://www.flickr.com/photos/urbanmkr/631282124

U Leo Reynolds https://www.flickr.com/photos/lwr/4647177288

E duncan c https://www.flickr.com/photos/duncan/2887485721

R Tom Magliery https://www.flickr.com/photos/mag3737/2447603355

Y Leo Reynolds https://www.flickr.com/photos/lwr/1457561488

Quellen 1

Slide Name Urheber Link

Philae DLR https://www.flickr.com/photos/dlr_de/15494442575

Easy Theen Moy https://www.flickr.com/photos/theenmoy/13913767190

Wallaby Jason https://www.flickr.com/photos/majorlawnlids/12717790215

Railways Armando G Alonso https://www.flickr.com/photos/argonavigo/5320119828

Validate Sticker Yaffa Phillips https://www.flickr.com/photos/yaffamedia/5987556898/

Tim Pritlove Joi Ito https://www.flickr.com/photos/joi/2828815577

Bob Dylan – Fail Jeroen Mirck https://www.flickr.com/photos/comicbase/3095495718

Blueprint Will Scullin https://www.flickr.com/photos/wscullin/3770015203

#Fail Spry https://www.flickr.com/photos/spry/5644461102

Time Spiral Alexandre Duret-Lutz https://www.flickr.com/photos/gadl/284995199/

Follow Redirect Threthny https://www.flickr.com/photos/threthny/5831668117/

Fail @Work slworking2 https://www.flickr.com/photos/slworking/3790886168

Java Jive Ahren https://www.flickr.com/photos/ahren_d/3001207047

Easy Nafis Ahmad https://www.flickr.com/photos/kapurush/6451376021

Stand der Dinge NASA HQ Photo https://www.flickr.com/photos/nasahqphoto/16148028997

Quellen 2

Slide Name Urheber Link

Zahnräder KellarW https://www.flickr.com/photos/kellarwilson/15876712023

Messanger Tom Wigley https://www.flickr.com/photos/amphalon/2271286466

Stencil Front didier DDDhttps://www.flickr.com/photos/dddmostra-stencil-experiences/14915975381

Ajax J. Albert Bowden II https://www.flickr.com/photos/jalbertbowdenii/6234626208/

Future Metro Library https://www.flickr.com/photos/metrolibraryarchive/7510203792/

Work In Progress Sandragxh https://www.flickr.com/photos/frozbeats/5109782938

Superheroes Ewen Roberts https://www.flickr.com/photos/donabelandewen/4839428648

Fireworks Jeff Krause https://www.flickr.com/photos/jeffkrause/6815440201

Ende adesigna https://www.flickr.com/photos/adesigna/3236732659/

Quellen 3

Source Codehttps://github.com/podlove/podlove-validator/

Project Organisationhttps://trello.com/b/zJA4y8Cp/podlove-feed-validator

Communicationhttps://www.hipchat.com/gEBQ3SNfp