Tree::Tree(IResourcePtr res) { static IXMLParserPtr parser = make_xml_parser("schemas/tree.xsd"); parser_state = new ParserState; parser_state->res = res; parser->parse(res->xml_file_name(), *this); model = load_model(res, parser_state->model_file, parser_state->scale); delete parser_state; }
inline void parse_xml_fragment(uchar_ptr_t fragment, std::size_t n, O output) { const implementation::context_frame_t& context(implementation::top_frame()); make_xml_parser( fragment, fragment + n, line_position_t("parse_xml_fragment"), always_true<token_range_t>(), boost::bind(&implementation::context_frame_t::element_handler, boost::cref(context), _1, _2, _3, _4), output) .parse_content(); // REVISIT (fbrereto) : More or less legible than having it after the above declaration? }
void glossary_parse() { implementation::context_frame_t& context(implementation::top_frame()); if (context.parsed_m || !boost::size(context.slurp_m)) return; make_xml_parser( context.slurp_m.first, context.slurp_m.second, context.parse_info_m, implementation::xstring_preorder_predicate, &implementation::xml_xstr_store, implementation::null_output_t()) .parse_element_sequence(); // REVISIT (fbrereto) : More or less legible than having it after the above declaration? context.parsed_m = true; }