Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
xml-validation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vaclab
xml-validation
Commits
fe95ee98
Commit
fe95ee98
authored
6 years ago
by
Thomas Bock
Browse files
Options
Downloads
Patches
Plain Diff
rdm
parent
98200c76
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+32
-10
32 additions, 10 deletions
README.md
with
32 additions
and
10 deletions
README.md
+
32
−
10
View file @
fe95ee98
# xml-validation
# xml-validation
HTTP-Server written in Python for validation of xml (e.g. DCC xml) against a
REST service for the validation of
```xml```
against a XML Schema (
```xsd```
).
XML Schema.
## Installation
## Installation
```
```
shell
>
git clone git@a75436.berlin.ptb.de:vaclab/xml-validation.git
>
git clone git@a75436.berlin.ptb.de:vaclab/xml-validation.git
>
cd
xml-validation
>
cd
xml-validation
>
python3
-m
venv
.
>
python3
-m
venv
.
...
@@ -14,28 +13,51 @@ XML Schema.
...
@@ -14,28 +13,51 @@ XML Schema.
>
./server
>
./server
```
```
The location of the
```xsd```
-file can be configured in
```config.json```
.
The default location is
```../xsd/dcc.xsd```
:
```
shell
├── xml-validation
│ ├── config.json
│ ├── README.md
│ ├── server
│ ├── server.py
│ ├── share
│ ├── utils.py
│ ├── xml-validation.service
│ └── xsd
└── xsd-dcc
├── dcc.xsd
├── documentation
├── examples
├── README.md
├── schemata
└── wiki
```
## API
## API
### /validate endpoint [POST]
### /validate endpoint [POST]
```
```
shell
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@valid_xml_matches_xsd http://localhost:5005/validate
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@valid_xml_matches_xsd http://localhost:5005/validate
>
<ok/>
>
<ok/>
```
```
```
```
shell
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@no_valid_xml http://localhost:5005/validate
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@no_valid_xml http://localhost:5005/validate
>
<error>unvalid xml data</error>
>
<error>unvalid xml data</error>
```
```
```
```
shell
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@valid_xml_but_dont_matches_xsd http://localhost:5005/validate
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@valid_xml_but_dont_matches_xsd http://localhost:5005/validate
>
<error>verbose error message</error>
>
<error>verbose error message</error>
```
```
Example:
Example:
```
```
shell
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@11044_17_DCC_v1.8.1_Au_with_error.xml http://localhost:5005/validate
>
curl
-X
POST
-H
"Content-Type: text/xml"
-d
@11044_17_DCC_v1.8.1_Au_with_error.xml http://localhost:5005/validate
>
<error>failed decoding
'A'
with XsdAtomicBuiltin
(
name
=
'xs:double'
)
:
>
<error>failed decoding
'A'
with XsdAtomicBuiltin
(
name
=
'xs:double'
)
:
...
@@ -78,7 +100,7 @@ Path: /{https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilu
...
@@ -78,7 +100,7 @@ Path: /{https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilu
Returns the version of the validation server:
Returns the version of the validation server:
```
```
shell
>
curl http://localhost:5005/version
>
curl http://localhost:5005/version
>
<version>0.2.0</version>
>
<version>0.2.0</version>
```
```
...
@@ -88,7 +110,7 @@ Returns the version of the validation server:
...
@@ -88,7 +110,7 @@ Returns the version of the validation server:
Returns the version of the xsd-definition. The version is given at
Returns the version of the xsd-definition. The version is given at
`xmlRoot.annotation.documentation`
`xmlRoot.annotation.documentation`
```
```
shell
>
curl http://localhost:5005/version_xsd
>
curl http://localhost:5005/version_xsd
<version>1.9.2</version>
<version>1.9.2</version>
``
``
...
@@ -100,7 +122,7 @@ Updates the server; used by webhook (no security checks so far).
...
@@ -100,7 +122,7 @@ Updates the server; used by webhook (no security checks so far).
### install daemon and start
### install daemon and start
```
```
shell
> cd /usr/local/share/xml-validation # working directory
> cd /usr/local/share/xml-validation # working directory
> sudo nobody
> sudo nobody
> git clone git@a75436.berlin.ptb.de:vaclab/xml-validation.git
> git clone git@a75436.berlin.ptb.de:vaclab/xml-validation.git
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment