//! XML Parser item = { SOI ~ line* ~ EOI } line = _{ self_close_tag | tag | other } other = { ANY } /// XML Tag tag = { open_tag ~ tag* ~ (cdata | text) ~ close_tag? } self_close_tag = { "" ~ ANY)* ~ "?>" | "<" ~ (!"/>" ~ ANY)* ~ "/>" } open_tag = @{ "<" ~ (!(">" | "![CDATA") ~ ANY)* ~ ">" } close_tag = @{ "" ~ ANY)* ~ ">" } /// Inner Text text = @{ (!(open_cdata | close_cdata | open_tag | close_tag) ~ ANY)* } /// CDATA open_cdata = @{ "" } cdata = { open_cdata ~ text ~ close_cdata }