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

macro rxml_proc

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

12 releases (7 breaking)

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

#266 in Parser tooling

22 downloads per month
Used in rxml

MIT license

59KB
1.5K SLoC

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::{NcNameStr, xml_cdata, xml_ncname};

const XML_PREFIX: &'static NcNameStr = xml_ncname!("xml");
const XML_QNAME: &'static NameStr = xml_name!("xml:lang");

See also

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

Dependencies

~230–670KB
~16K SLoC