#xml #string #name #compile-time #validation #macro #rxml

macro rxml_proc

Macros to, at compile time, validate strings against the CData, Name and NCName productions from the XML 1.0 grammar

11 releases (6 breaking)

0.10.0 Mar 16, 2024
0.9.1 Jan 25, 2023
0.8.2 Dec 17, 2022
0.8.1 May 15, 2022
0.4.0 Aug 18, 2021

#228 in Parser tooling

Download history 8/week @ 2024-02-22 17/week @ 2024-02-29 75/week @ 2024-03-07 120/week @ 2024-03-14 11/week @ 2024-03-21

229 downloads per month
Used in rxml

MIT license

16KB
271 lines

rxml_proc — Compile-time validation of CData, Name and NCName strings

This crate is supplementary to the rxml crate. It provides three macros (xml_cdata!, xml_name! and xml_ncname!) which convert a normal &str into the corresponding rxml string type for strong typing of XML string flavors.

crate badge docs badge

Please see the rxml crate for more information.

Example

use rxml::NCNameStr;
use rxml_proc::xml_ncname;

const XML_PREFIX: &'static NCNameStr = xml_ncname!("xml");

lib.rs:

Macros for XML strings

This crate provides macros to check XML string syntax at compile time.

Example

use rxml::{CDataStr, NCNameStr, xml_cdata, xml_ncname};

const XML_NAMESPACE: &'static CDataStr = xml_cdata!("http://www.w3.org/XML/1998/namespace");
const XML_PREFIX: &'static NCNameStr = xml_ncname!("xml");

See also

This crate bases on the rxml_validation crate and it primarily intended for use with the rxml crate.

Dependencies

~335–790KB
~19K SLoC