#proc-macro #xml #string

macro rxml_proc

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

13 releases (8 breaking)

0.12.1 Oct 3, 2025
0.11.0 Jun 15, 2024
0.10.0 Mar 16, 2024
0.9.1 Jan 25, 2023
0.4.0 Aug 18, 2021

#400 in Parser tooling

Download history 29/week @ 2025-10-14 75/week @ 2025-10-21 55/week @ 2025-10-28 20/week @ 2025-11-04 117/week @ 2025-11-11 31/week @ 2025-11-18 45/week @ 2025-11-25 55/week @ 2025-12-02 28/week @ 2025-12-09 40/week @ 2025-12-16 56/week @ 2025-12-23 23/week @ 2025-12-30 72/week @ 2026-01-06 62/week @ 2026-01-13 80/week @ 2026-01-20 73/week @ 2026-01-27

295 downloads per month
Used in 7 crates (via rxml)

MIT license

61KB
1.5K SLoC

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.


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");

Dependencies

~140–530KB
~13K SLoC