Skip to content
Snippets Groups Projects

Content

This repo contains an way more strict version of the D-SI Schema from https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si for testing of DCC Examples for wrong units and or depricated elements. The main changes are

  1. Removal of all depricated Elements
  2. Validation of the si:unit elements agains the regEx given below. Forcing the users to prefix every non SI unit with an |

Usage

use an Schemadeffinition like this:

<?xml version="1.0" encoding="UTF-8"?>
<dcc:digitalCalibrationCertificate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:dcc="https://ptb.de/dcc" xmlns:si="https://ptb.de/si"
  xsi:schemaLocation="https://ptb.de/dcc https://gitlab1.ptb.de/digitaldynamicmeasurement/dccanddsischemawithoutdepricatedelements/-/raw/main/dccNoDepricated.xsd?ref_type=heads"
  schemaVersion="3.3.0">
  <dcc:administrativeData>

to use this strict schema for testing purpose only.

(^((((\\kilogram)|(\\decibel)|(\\degreecelsius)|(\\mmhg)|(\\minute)|
(\\hour)|(\\day))(\\tothe\{-?\d+(\.\d+)?\})?)|(((\\deca)|(\\hecto)|
(\\mega)|(\\giga)|(\\tera)|(\\peta)|(\\exa)|(\\zetta)|(\\yotta)|
(\\deci)|(\\centi)|(\\milli)|(\\micro)|(\\nano)|(\\pico)|(\\femto)|
(\\atto)|(\\zepto)|(\\yocto)|(\\kibi)|(\\mebi)|(\\gibi)|(\\tebi)|
(\\pebi)|(\\exbi)|(\\zebi)|(\\yobi))?((\\gram))(\\tothe\{-?\d+(
\.\d+)?\})?)|(((\\deca)|(\\hecto)|(\\kilo)|(\\mega)|(\\giga)|
(\\tera)|(\\peta)|(\\exa)|(\\zetta)|(\\yotta)|(\\centi)|
(\\milli)|(\\micro)|(\\nano)|(\\pico)|(\\femto)|(\\atto)|
(\\zepto)|(\\yocto)|(\\kibi)|(\\mebi)|(\\gibi)|(\\tebi)|
(\\pebi)|(\\exbi)|(\\zebi)|(\\yobi))?((\\bel))(
\\tothe\{-?\d+(\.\d+)?\})?)|((\\one))|(((\\deca)|(
\\hecto)|(\\kilo)|(\\mega)|(\\giga)|(\\tera)|(\\peta)|
(\\exa)|(\\zetta)|(\\yotta)|(\\deci)|(\\centi)|(\\milli)|
(\\micro)|(\\nano)|(\\pico)|(\\femto)|(\\atto)|
(\\zepto)|(\\yocto)|(\\kibi)|(\\mebi)|(\\gibi)|
(\\tebi)|(\\pebi)|(\\exbi)|(\\zebi)|(\\yobi))?((\\metre)|
(\\second)|(\\ampere)|(\\kelvin)|(\\mole)|(\\candela)|
(\\degree)|(\\arcminute)|(\\arcsecond)|(\\radian)|
(\\steradian)|(\\hertz)|(\\newton)|(\\pascal)|
(\\joule)|(\\watt)|(\\coulomb)|(\\volt)|(\\farad)|
(\\ohm)|(\\siemens)|(\\weber)|(\\tesla)|(\\henry)|
(\\lumen)|(\\lux)|(\\becquerel)|(\\sievert)|(\\gray)|
(\\katal)|(\\hectare)|(\\litre)|(\\tonne)|
(\\electronvolt)|(\\dalton)|(\\astronomicalunit)|
(\\neper)|(\\percent)|(\\ppm)|(\\byte)|(\\bit)|
(\\angstrom)|(\\bar)|(\\atomicunittime)|
(\\atomicmassunit)|(\\barn)|(\\clight)|
(\\electronmass)|(\\elementarycharge)|
(\\naturalunittime)|(\\hartree)|(\\bohr)|
(\\nauticalmile)|(\\knot)|(\\planckbar))(\\tothe\{-?\d+(
\.\d+)?\})?))+(\\per((((\\kilogram)|(\\decibel)|
(\\degreecelsius)|(\\mmhg)|(\\minute)|(\\hour)|(\\day))(
\\tothe\{-?\d+(\.\d+)?\})?)|(((\\deca)|(\\hecto)|
(\\mega)|(\\giga)|(\\tera)|(\\peta)|(\\exa)|(\\zetta)|
(\\yotta)|(\\deci)|(\\centi)|(\\milli)|(\\micro)|
(\\nano)|(\\pico)|(\\femto)|(\\atto)|(\\zepto)|
(\\yocto)|(\\kibi)|(\\mebi)|(\\gibi)|(\\tebi)|
(\\pebi)|(\\exbi)|(\\zebi)|(\\yobi))?((\\gram))(
\\tothe\{-?\d+(\.\d+)?\})?)|(((\\deca)|(
\\hecto)|(\\kilo)|(\\mega)|(\\giga)|(\\tera)|
(\\peta)|(\\exa)|(\\zetta)|(\\yotta)|
(\\centi)|(\\milli)|(\\micro)|(\\nano)|
(\\pico)|(\\femto)|(\\atto)|(\\zepto)|
(\\yocto)|(\\kibi)|(\\mebi)|(\\gibi)|
(\\tebi)|(\\pebi)|(\\exbi)|(\\zebi)|
(\\yobi))?((\\bel))(
\\tothe\{-?\d+(\.\d+)?\})?)|((\\one))|
(((\\deca)|(\\hecto)|(\\kilo)|(\\mega)|
(\\giga)|(\\tera)|(\\peta)|(\\exa)|
(\\zetta)|(\\yotta)|(\\deci)|(\\centi)|
(\\milli)|(\\micro)|(\\nano)|(\\pico)|
(\\femto)|(\\atto)|(\\zepto)|(\\yocto)|
(\\kibi)|(\\mebi)|(\\gibi)|(\\tebi)|
(\\pebi)|(\\exbi)|(\\zebi)|(\\yobi))?((\\metre)|
(\\second)|(\\ampere)|(\\kelvin)|(\\mole)|
(\\candela)|(\\degree)|(\\arcminute)|
(\\arcsecond)|(\\radian)|(\\steradian)|
(\\hertz)|(\\newton)|(\\pascal)|
(\\joule)|(\\watt)|(\\coulomb)|
(\\volt)|(\\farad)|(\\ohm)|
(\\siemens)|(\\weber)|(\\tesla)|
(\\henry)|(\\lumen)|(\\lux)|
(\\becquerel)|(\\sievert)|(\\gray)|
(\\katal)|(\\hectare)|(\\litre)|
(\\tonne)|(\\electronvolt)|
(\\dalton)|(\\astronomicalunit)|
(\\neper)|(\\percent)|(\\ppm)|
(\\byte)|(\\bit)|(\\angstrom)|
(\\bar)|(\\atomicunittime)|
(\\atomicmassunit)|(\\barn)|
(\\clight)|(\\electronmass)|
(\\elementarycharge)|
(\\naturalunittime)|(\\hartree)|
(\\bohr)|(\\nauticalmile)|
(\\knot)|(\\planckbar))(\\tothe\{-?\d+(\.\d+)?\})?)+
)?$)|(^\|.*$)

vlaidate with xerces

```bash

java \

-Dhttp.proxyHost=webproxy.ptb.de
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts="*.ptb.de|localhost"
-cp "xerces-2_12_2/xercesImpl.jar:xerces-2_12_2/xml-apis.jar:xerces-2_12_2/xercesSamples.jar"
sax.Counter
-n -s -v -f
path/To/Xml.xml