XML-Parser: jemand lust zu testen?



  • funktioniert das jetzt bei jemandem mit einer neueren spirit version?



  • Ich hab die neue Version von Spirit "installiert" und danach ließ sich alles ohne Probleme kompilieren/ausführen. Ich benutze Mingw. Obs die aktuelle Version ist weiß ich nicht, da der Compiler schon in der IDE CodeBlocks integriert war.



  • hi,
    hab noch mal die neue version geladen und compiliert:

    hier ist noch ein problem:

    #if defined(BOOST_SPIRIT_DEBUG) && \
        (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_TREES)
    
            BOOST_SPIRIT_DEBUG_OUT << ">>> group_match(begin) <<<\n"
                "new node(" << id << ") \"";
            for (IteratorT2 it = first; it != last; ++it)
                impl::token_printer(BOOST_SPIRIT_DEBUG_OUT, *it);
            BOOST_SPIRIT_DEBUG_OUT << "\"\n";
            BOOST_SPIRIT_DEBUG_OUT << "new child tree (before grouping):\n" << m << "\n";
    
            tree_policy_t::group_match(m, id, first, last);
    
            BOOST_SPIRIT_DEBUG_OUT << "new child tree (after grouping):\n" << m << "\n";
            BOOST_SPIRIT_DEBUG_OUT << ">>> group_match(end) <<<\n";
    #else
            tree_policy_t::group_match(m, id, first, last); // <----- hier
    #endif
    

    cu

    error

    c:\Boost\include\boost-1_32\boost\spirit\tree\common.hpp(730) : error C2664: 'void boost::spirit::ast_tree_policy<MatchPolicyT,NodeFactoryT>::group_match<IteratorT2,IteratorT2>(boost::spirit::ast_tree_policy<MatchPolicyT,NodeFactoryT>::match_t &,const boost::spirit::parser_id &,const Iterator1T &,const Iterator2T &)' : cannot convert parameter 1 from 'boost::spirit::parser_result<ParserT,ScannerT>::type' to 'boost::spirit::ast_tree_policy<MatchPolicyT,NodeFactoryT>::match_t &'
            with
            [
                MatchPolicyT=boost::spirit::ast_match_policy<Iterator,boost::spirit::node_val_data_factory<boost::spirit::nil_t>>,
                NodeFactoryT=boost::spirit::node_val_data_factory<boost::spirit::nil_t>,
                IteratorT2=boost::spirit::scanner<Iterator,scanner_policies_t>::iterator_t,
                Iterator1T=boost::spirit::scanner<Iterator,scanner_policies_t>::iterator_t,
                Iterator2T=boost::spirit::scanner<Iterator,scanner_policies_t>::iterator_t
            ]
            and
            [
                ParserT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t
            ]
            and
            [
                MatchPolicyT=boost::spirit::ast_match_policy<Iterator,boost::spirit::node_val_data_factory<boost::spirit::nil_t>>,
                NodeFactoryT=boost::spirit::node_val_data_factory<boost::spirit::nil_t>
            ]
            A reference that is not to 'const' cannot be bound to a non-lvalue
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\rule.ipp(191) : see reference to function template instantiation 'void boost::spirit::common_tree_match_policy<MatchPolicyT,IteratorT,NodeFactoryT,TreePolicyT>::group_match<boost::spirit::parser_result<ParserT,ScannerT>::type,boost::spirit::scanner<IteratorT,PoliciesT>::iterator_t>(MatchT &,const boost::spirit::parser_id &,const IteratorT2 &,const IteratorT2 &) const' being compiled
            with
            [
                MatchPolicyT=boost::spirit::ast_match_policy<Iterator,boost::spirit::node_val_data_factory<boost::spirit::nil_t>>,
                IteratorT=Iterator,
                NodeFactoryT=boost::spirit::node_val_data_factory<boost::spirit::nil_t>,
                TreePolicyT=boost::spirit::ast_tree_policy<boost::spirit::ast_match_policy<Iterator,boost::spirit::node_val_data_factory<boost::spirit::nil_t>>,boost::spirit::node_val_data_factory<boost::spirit::nil_t>>,
                ParserT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t,
                PoliciesT=scanner_policies_t,
                MatchT=boost::spirit::parser_result<boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,boost::spirit::rule<scanner_t>::scanner_t>::type,
                IteratorT2=boost::spirit::scanner<Iterator,scanner_policies_t>::iterator_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\rule.ipp(172) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::impl::rule_base<DerivedT,EmbedT,T0,T1,T2>::parse_main<ScannerT>(const ScannerT &) const' being compiled
            with
            [
                ParserT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t,
                DerivedT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                EmbedT=const boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t> &,
                T0=scanner_t,
                T1=boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t,
                T2=boost::spirit::nil_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\rule.ipp(233) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::impl::rule_base<DerivedT,EmbedT,T0,T1,T2>::parse<ScannerT>(const ScannerT &) const' being compiled
            with
            [
                ParserT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t,
                DerivedT=boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t>,
                EmbedT=const boost::spirit::rule<scanner_t,boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t> &,
                T0=scanner_t,
                T1=boost::spirit::closure<XML::Closure1<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>>::context_t,
                T2=boost::spirit::nil_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\rule.ipp(232) : while compiling class-template member function 'boost::spirit::match_result<MatchPolicyT,T>::type boost::spirit::impl::concrete_parser<ParserT,ScannerT,AttrT>::do_parse_virtual(const ScannerT &) const'
            with
            [
                MatchPolicyT=scanner_t,
                T=boost::spirit::nil_t,
                ParserT=XML::TagParser::definition<scanner_t>::Rule,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t,
                AttrT=boost::spirit::rule<scanner_t>::attr_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\rule.hpp(135) : see reference to class template instantiation 'boost::spirit::impl::concrete_parser<ParserT,ScannerT,AttrT>' being compiled
            with
            [
                ParserT=XML::TagParser::definition<scanner_t>::Rule,
                ScannerT=boost::spirit::rule<scanner_t>::scanner_t,
                AttrT=boost::spirit::rule<scanner_t>::attr_t
            ]
            c:\Dokumente und Einstellungen\Gerald\Desktop\XMLParser\TagParser.hpp(34) : see reference to function template instantiation 'boost::spirit::rule<T0> &boost::spirit::rule<T0>::operator =<XML::TagParser::definition<Scanner>::Rule>(const ParserT &)' being compiled
            with
            [
                T0=scanner_t,
                Scanner=scanner_t,
                ParserT=XML::TagParser::definition<scanner_t>::Rule
            ]
            c:\Dokumente und Einstellungen\Gerald\Desktop\XMLParser\TagParser.hpp(28) : while compiling class-template member function 'XML::TagParser::definition<Scanner>::definition(const XML::TagParser &)'
            with
            [
                Scanner=scanner_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\grammar.ipp(262) : see reference to class template instantiation 'XML::TagParser::definition<Scanner>' being compiled
            with
            [
                Scanner=scanner_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\impl\grammar.ipp(281) : see reference to function template instantiation 'void boost::spirit::impl::call_helper<0>::do_<result_t,definition_t,ScannerT>(RT &,DefinitionT &,const ScannerT &)' being compiled
            with
            [
                ScannerT=scanner_t,
                RT=result_t,
                DefinitionT=definition_t
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\grammar.hpp(53) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::impl::grammar_parser_parse<0,XML::TagParser,boost::spirit::parser_context<>,ScannerT>(const boost::spirit::grammar<DerivedT> *,const ScannerT &)' being compiled
            with
            [
                ParserT=boost::spirit::grammar<XML::TagParser>::self_t,
                ScannerT=scanner_t,
                DerivedT=XML::TagParser
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\non_terminal\grammar.hpp(63) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::grammar<DerivedT>::parse_main<ScannerT>(const ScannerT &) const' being compiled
            with
            [
                ParserT=boost::spirit::grammar<XML::TagParser>::self_t,
                ScannerT=scanner_t,
                DerivedT=XML::TagParser
            ]
            c:\Boost\include\boost-1_32\boost\spirit\core\composite\kleene_star.hpp(58) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::grammar<DerivedT>::parse<ScannerT>(const ScannerT &) const' being compiled
            with
            [
                ParserT=boost::spirit::grammar<XML::TagParser>::self_t,
                ScannerT=scanner_t,
                DerivedT=XML::TagParser
            ]
            c:\Boost\include\boost-1_32\boost\spirit\tree\ast.hpp(273) : see reference to function template instantiation 'boost::spirit::parser_result<ParserT,ScannerT>::type boost::spirit::kleene_star<S>::parse<scanner_t>(const ScannerT &) const' being compiled
            with
            [
                ParserT=boost::spirit::kleene_star<XML::TagParser>::self_t,
                ScannerT=scanner_t,
                S=XML::TagParser
            ]
            c:\Boost\include\boost-1_32\boost\spirit\tree\ast.hpp(289) : see reference to function template instantiation 'boost::spirit::tree_parse_info<IteratorT> boost::spirit::ast_parse<boost::spirit::node_val_data_factory<ValueT>,IteratorT,boost::spirit::kleene_star<S>,SkipT>(const IteratorT &,const IteratorT &,const boost::spirit::parser<DerivedT> &,const SkipT &,const AstFactoryT &)' being compiled
            with
            [
                IteratorT=Iterator,
                ValueT=boost::spirit::nil_t,
                S=XML::TagParser,
                SkipT=boost::spirit::space_parser,
                DerivedT=boost::spirit::kleene_star<XML::TagParser>,
                AstFactoryT=boost::spirit::node_val_data_factory<boost::spirit::nil_t>
            ]
            c:\Dokumente und Einstellungen\Gerald\Desktop\XMLParser\XMLParser.hpp(39) : see reference to function template instantiation 'boost::spirit::tree_parse_info<IteratorT> boost::spirit::ast_parse<Iterator,boost::spirit::kleene_star<S>,boost::spirit::space_parser>(const IteratorT &,const IteratorT &,const boost::spirit::parser<DerivedT> &,const SkipT &)' being compiled
            with
            [
                IteratorT=Iterator,
                Iterator=Iterator,
                S=XML::TagParser,
                DerivedT=boost::spirit::kleene_star<XML::TagParser>,
                SkipT=boost::spirit::space_parser
            ]
            c:\Dokumente und Einstellungen\Gerald\Desktop\XMLParser\XMLParser.hpp(92) : see reference to function template instantiation 'XML::TagTree<Char> XML::parse<Iterator>(Iterator,Iterator)' being compiled
            with
            [
                Char=char,
                Iterator=Iterator
            ]
            c:\Dokumente und Einstellungen\Gerald\Desktop\XMLParser\test.cpp(9) : see reference to function template instantiation 'XML::TagTree<Char> XML::parseFromFile<char>(const Char *)' being compiled
            with
            [
                Char=char
            ]
    
    Build log was saved at ...
    XMLParser - 1 error(s), 1 warning(s)
    


  • cplusplus.: Sicher, dass du die aktuelle spirit-Version hast? Die beim aktuellen boost ist nicht die aktuellste.



  • haben denn die tester was beim interface zu meckern?^^



  • Walli schrieb:

    cplusplus.: Sicher, dass du die aktuelle spirit-Version hast? Die beim aktuellen boost ist nicht die aktuellste.

    Also ich hab VC 7.1 und bei spirit 1.8.1 das ja bei bei boost 1.32 dabei ist, kommt genau dieser Fehler.
    Im moment baue ich grade spirit 1.8.2 und werde mich melden wie es da aussieht

    MFG



  • ok funktioniert jetzt mit spirit 1.8.2 und VC7.1 ( VS2003.NET ) einwandfrei

    MfG



  • otze schrieb:

    haben denn die tester was beim interface zu meckern?^^

    Also mir gefällt das, wie man die Lib benutzt. Ich frag mich nur wie es mit Attributen aussieht kann man die auch auslesen? Kommt das noch?
    Ein wenig doku wäre auch nicht schlecht. Aber alles in allem ist es sehr nice.

    MfG



  • eViLiSSiMo schrieb:

    otze schrieb:

    haben denn die tester was beim interface zu meckern?^^

    Also mir gefällt das, wie man die Lib benutzt. Ich frag mich nur wie es mit Attributen aussieht kann man die auch auslesen? Kommt das noch?
    Ein wenig doku wäre auch nicht schlecht. Aber alles in allem ist es sehr nice.

    MfG

    wird noch alles eingebaut. muss aber zuerst nochn paar andre probleme lösen(zb, dass Nodes andre iteratoren für ihre childs zurückgeben als Collections)



  • @otze:
    mit boost spirit 1.8.2 funktionierts nun endlich;-)
    schaut gut aus;-) mach so weiter...bin gespannt was da noch alles kommt...

    cu



  • @otze: willst du auch noch nen eigenen XSLT-Prozessor schreiben? oder wär das zu aufwendig? ich kenn mich noch nicht so gut aus in diesem gebiet... wie hängt so ein XML parser denn mit einem XSLT Prozessor zusammen?? XSLT ist eine Sprache für die transformation, und XSL = Extensible Style Language...

    cu



  • so, neue version ist fertig, doch nun macht der hoster probleme 😕 klasse aber auch. muss ich mir nun neuen webspace auftreiben 😉

    @cplusplus. vielleicht, erstmal das hier fertig machen





  • otze schrieb:

    so, neue version ist fertig, doch nun macht der hoster probleme 😕 klasse aber auch. muss ich mir nun neuen webspace auftreiben 😉

    Ich kann dir anbieten das bei mir auf den Webserver zu packen.
    Wenn ja meld dich mal im IRC 😉

    MfG



  • Hier ist die aktuelle Version des XML - Parsers von otze:

    http://evilissimo-softdev.de/files/otze/XML-Parser.rar



  • @otze also irgendwas stimmt da net mit spirit in zusammenhang mit dem VC++7.1

    Er hat probleme damit die Initialisierungsliste von den Konstruktoren richtig auszuwerten

    dakommt dann so etwas:

    ------ Erstellen gestartet: Projekt: otzexml, Konfiguration: Debug Win32 ------
    
    Kompilieren...
    test.cpp
    e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(227) : error C2065: 'NodeType': nichtdeklarierter Bezeichner
            e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(225): Bei der Kompilierung der Memberfunktion 'boost::spirit::node_val_data<IteratorT,ValueT>::node_val_data(void)' der Klassenvorlage
            with
            [
                IteratorT=boost::spirit::node_val_data_factory<XML::NodeType>::factory<Iterator>::iterator_t,
                ValueT=XML::NodeType
            ]
            e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(51): Siehe Verweis auf Instanziierung der kompilierten Klassenvorlage 'boost::spirit::node_val_data<IteratorT,ValueT>'
            with
            [
                IteratorT=boost::spirit::node_val_data_factory<XML::NodeType>::factory<Iterator>::iterator_t,
                ValueT=XML::NodeType
            ]
            e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(534): Siehe Verweis auf Instanziierung der kompilierten Klassenvorlage 'boost::spirit::tree_node<T>'
            with
            [
                T=boost::spirit::tree_match<Iterator,Factory,boost::spirit::nil_t>::parse_node_t
            ]
            e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(1294): Siehe Verweis auf Instanziierung der kompilierten Klassenvorlage 'boost::spirit::tree_match<IteratorT,NodeFactoryT,T>'
            with
            [
                IteratorT=Iterator,
                NodeFactoryT=Factory,
                T=boost::spirit::nil_t
            ]
            c:\Documents and Settings\evilissimo\My Documents\Visual Studio Projects\Job\otzexml\XMLParser.hpp(40): Siehe Verweis auf Instanziierung der kompilierten Klassenvorlage 'boost::spirit::tree_parse_info<IteratorT,NodeFactoryT>'
            with
            [
                IteratorT=Iterator,
                NodeFactoryT=Factory
            ]
            c:\Documents and Settings\evilissimo\My Documents\Visual Studio Projects\Job\otzexml\XMLParser.hpp(94): Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage 'XML::TagTree<Char> XML::parse<Iterator>(Iterator,Iterator)'
            with
            [
                Char=char,
                Iterator=Iterator
            ]
            c:\Documents and Settings\evilissimo\My Documents\Visual Studio Projects\Job\otzexml\test.cpp(11): Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage 'XML::TagTree<Char> XML::parseFromFile<char>(const Char *)'
            with
            [
                Char=char
            ]
    e:\boost\vc71\include\boost-1_32\boost\spirit\tree\common.hpp(227) : error C2064: Ausdruck ergibt keine Funktion, die 0 Argumente übernimmt
    
    Das Build-Protokoll wurde unter "file://c:\Documents and Settings\evilissimo\My Documents\Visual Studio Projects\Job\otzexml\Debug\BuildLog.htm" gespeichert.
    otzexml - 2 Fehler, 0 Warnung(en)
    
    ---------------------- Fertig ----------------------
    
        Erstellen: 0 erfolgreich, 1 fehlgeschlagen, 0 übersprungen
    

    Bei diesem code hier:

    225:    node_val_data()
    226:        : text_(), is_root_(false), parser_id_(), value_()
    227:        {}
    

    Genau genommen gefällt ihm das is_root_() scheinbar nicht, aber was die leere initialisierung soll verstehe ich auch net so ganz, nur damit man die Initialisierungsliste benutzt? Wäre etwas komisch imho, oder geht es hier um RAII?

    Das problem konnte ich auf jeden fall so lösen das ich boost\spirit\tree\common.hpp bei allen Konstruktoren so umgeändert habe das is_root_ nicht mehr in der intialisierungsliste ist, sondern im C'tor Rumpf einen Wert zugewiesen bekommt.

    Für andere Workarounds/Problemlösungen bin ich erst mal offen



  • *push*



  • ist doch erst 6 stunden her und dann schon pushen. 👎



  • bin mir jetzt nicht so ganz sicher, sind jetzt die grundsprachmittel alle drin, damit man XML dateien auswerten kann, oder fehlt noch was?

    (das kleine manko, dass man bisher entweder value oder childnodes haben kann wird in der nächsten version noch korrigiert, ohne dass dieses interface dran leiden muss :D)

    sonst irgendwelche anregungen?



  • Wie wäre es mit einer Möglichkeit das man alle Tags mit ihren Attributen abfragen kann?

    Aber ansonsten finde ich es ganz nett 🙂


Anmelden zum Antworten