NewsML-G2 Validator + (( HTML 5 polyglot + Microdata ) || XHTML1.0 ) + NITF

Paste a NewsML-G2 document into the form below, or try one of the examples:

NewsItem {{validationResult.guid}}
Validation: {{validationResult.passed ? 'Passed' : 'Failed'}}. {{validationResult.message}}
Service: {{validationResult.service}}
Detections: standard: {{validationResult.detections.standard}}, version: {{validationResult.detections.version}}, content-type: {{validationResult.detections.contentType}}, conformance: {{validationResult.detections.conformance}}, used valdation schema: {{validationResult.detections.validationSchema}}
(alternative schema used!)
Error: {{error.message}}
Markup: {{error.markup}}
Reference: line {{error.line}}, column {{error.column}}

Microdata Analysis search engines understand the structured data from your document

{{node.type.pred}}: {{node.type.value}}
{{property.pred}}: {{property.value | characters: 250}}
Validation: bypassed. {{validationResult.message}}
NewsML-G2 validation is using validation schemas by IPTC
HTML validation based on XHTML5 XML schema derived form Olivier Ishacian's draft
Microdata validation provided by Google Structured Data Testing Tool or
NITF validation is using validation schemas by IPTC
"The NewsML-G2 standard provides state-of-the-art XML format metadata to combine rich functionality, ease of use, compactness and compatibility with the Semantic Web" [IPTC]

Read about why using HTML5 polyglot + as the content format in NewsML-G2 is a good choice, and how it validates

How it works: The validation is performed in four independent steps:

  1. NewsML-G2 validation based on the XSD's provided by IPTC. Works with all NewsML-G2 standard versions >= 2.9
  2. Polyglot HTML5 and XHTML1.0 validation of the inlineXML embedded HTML document within the NewsML-G2 contentSet. Using XML Schemas
  3. XHTML embedded microdata is sent for validation to the Google Testing Tool. If the service is not available, the content will be sent to Structured Data Linter service instead.
  4. Validation of NITF embedded into the NewsML-G2 contentSet/inlineXML element is performed using IPTC's validation schemas. Works with NITF version >= 3.3

Validation API: Validation without using the graphical interface can be done by sending a POST request, containing the NewsML-G2 document in the POST body to the same URL as this page has.
The API responds with HTTP status code 200 for valid documents, and 400 for invalid ones. The response body contains parsable JSON or XML serialized info/error messages. To choose the format, add the appropriate accept header to your request:
Accept: application/json
Accept: text/xml
Be aware, the performance of validation (apart from NewsML-G2 which is validated internally) is dependent on external services.
Partial validation can be performed by adding the "standard" to the service URL parameter with a list comma separated options "NewsML", "HTML", "microdata", "NITF". Example:
POST http://newsmlvalidator-url/?standard=NewsML,HTML

Alternative validation services: You can choose between a couple of services to validate HTML5 and Microdata.

Want to Contribute? Feel free to checkout the project from GitHub, improve it and send me a pull request.

Disclaimer: The purpose of this project is showing how validating (X)HTML5 + Microdata documents embedded in NewsML-G2 can be done.
Be aware, the implementation is still very minimalistic. There is currently very little error handling.

Show on GitHub