#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

#218 in #xml

Download history 5/week @ 2024-06-21 4/week @ 2024-06-28 9/week @ 2024-07-05 15/week @ 2024-07-26 3/week @ 2024-08-02 60/week @ 2024-08-09 8/week @ 2024-08-16 17/week @ 2024-08-23 71/week @ 2024-08-30 7/week @ 2024-09-06 21/week @ 2024-09-13 18/week @ 2024-09-20 19/week @ 2024-09-27 4/week @ 2024-10-04

63 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

~240–680KB
~16K SLoC