wild-doc

Example

```rust use wild_doc::*;

let dir="./wd-test/"; if std::path::Path::new(dir).exists(){ std::fs::removedirall(dir).unwrap(); } std::fs::createdirall(dir).unwrap();

let mut wd=WildDoc::new( dir ,IncludeLocal::new("./include/") ).unwrap();

//update data. /wd.exec(r#" Noah US Liam US Olivia UK "#,b"").unwrap();/

let updatexml=r#" "#; wd.exec(updatexml,r#"{ "name":"Noah" ,"from":"US" }"#.asbytes()).unwrap(); wd.exec(updatexml,r#"{ "name":"Liam" ,"from":"US" }"#.asbytes()).unwrap(); wd.exec(updatexml,r#"{ "name":"Olivia" ,"from":"UK" }"#.as_bytes()).unwrap();

//select data. let r=wd.exec(r#"

find persons.
"#,b"").unwrap(); println!("{}",r);

//seaech data let r=wd.exec(r#"

find persons from the US.
"#,b"").unwrap(); println!("{}",r);

//use javascript let r=wd.exec(r#" const ymd=function(){ const now=new Date(); return now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate(); }; const uk="UK";

find persons from the .
"#,b"").unwrap(); println!("{}",r);

//search in update section. wd.exec(r#" hoge: Renamed "#,b"").unwrap(); let r=wd.exec(r#"

find persons.
"#,b"").unwrap(); println!("{}",r); ```

Include file

layout.xml

xml <html> <head> <title>HTML include test</title> </head> <body> <wd:include wd:src="wd.v('body_path')" /> </body> </html>

body.xml

xml BODY

rust

rust let r=wd.exec(r#"<wd><wd:stack var="body_path:'body.xml'"> <wd:include src="layout.xml" /> <wd:stack></wd>"#); println!("{}",r);

output

html <html> <head> <title>HTML include test</title> </head> <body> BODY </body> </html>