Skip to main content

Validate HTTP Structured Fields in XML2RFC documents

Project description

sf-rfc-validate

This is a simple script to validate Structured Fields in xml2rfcv3 documents.

It examines all sourcecode and artwork elements; when one has a type of http-sf-item, http-sf-list or http-sf-dict, it validates the contents.

When validating, it assumes that the content is a HTTP field section; that is, one or more lines, each in the format field_name: field_value. Line folding is supported, so that long lines can be formatted appropriately. Multiple lines with the same name will be combined into one value. Then, each value is parsed as the Structured Field type indicated by the type attribute.

For example,

<sourcecode type="http-sf-list">
Foo: bar; baz
Foo: one,
     two
</sourcecode>

... will be validated as a Structured Field List with the value bar; baz, one, two.

Note that in your XML, there must not be any whitespace at the start of lines, unless they're continuation of previous lines (folding, as seen above).

Installation

The script requires Python 3, and can be installed with pip:

pip3 install sf-rfc-validate

Use

sf-rfc-validate.py rfcNNNN.xml

If there are errors, they will be listed, and the program will return 1.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sf-rfc-validate-0.0.8.tar.gz (3.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page