0

I have the following code:

    pugi::xml_document doc;
    pugi::xml_parse_result result = doc.load_file( "C:/Users/James/Documents/Visual Studio 2013/Projects/Games/Jimmy/Game/Assets/Levels/Scene.dae" );
    std::cout << "Load result: " << result.description( ) << ", mesh name: " << doc.child( "mesh" ).attribute( "name" ).value( ) << std::endl;

    pugi::xml_node tools = doc.child( "Profile" ).child( "Tools" );

    for( pugi::xml_node tool = tools.child( "Tool" ); tool; tool = tool.next_sibling( "Tool" ) )
    {
        std::cout << "Tool " << tool.attribute( "Filename" ).value( );
        std::cout << ": AllowRemote " << tool.attribute( "AllowRemote" ).as_bool( );
        std::cout << ", Timeout " << tool.attribute( "Timeout" ).as_int( );
        std::cout << ", Description '" << tool.child_value( "Description" ) << "'/n";
    }

For some reason I am getting:

+       result  {status=status_file_not_found (1) offset=0 encoding=encoding_auto (0) } pugi::xml_parse_result

Any ideas why it can't find my file?

Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233

1 Answers1

0

pugi only opens .xml... I also had to change my path to a relative one.

Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233
  • File extension does not matter for pugixml; not sure what went wrong here, I would guess there's an error in the full path and it does not actually exist as written. – zeuxcg Apr 02 '14 at 04:09
  • It's odd though, If I change between dae and xml, it does seem to care! I'd prefer it to be dae because then I do not have to keep changing my extension over... But yea, really, if I change, it works. if I don't, it doesn't? – Jimmyt1988 Apr 02 '14 at 09:02
  • It *really* does not matter for pugixml :) maybe your .dae file is actually named Scene.dae.xml and Windows hides the .xml extension from you in Explorer? – zeuxcg Apr 02 '14 at 16:30