Horde3D
http://horde3d.org/forums/

XML schema
http://horde3d.org/forums/viewtopic.php?f=2&t=425
Page 1 of 1

Author:  cantele [ 16.07.2008, 23:43 ]
Post subject:  XML schema

Does anyone have an XML schema for Horde3D's XML input formats... I think interfacing the engine with XML is really hard already, and without a schema it's almost impossible.

The closest thing to this I found is the source of Collada Converter, which is of course not really generally usable.

Author:  DarkAngel [ 17.07.2008, 03:27 ]
Post subject:  Re: XML schema

It's not exactly a schema, but the documentation explains all of the tags/attributes that you can use in the XML files.

Author:  cantele [ 17.07.2008, 11:48 ]
Post subject:  Re: XML schema

I would like to generate classes that I can use to generate the needed XML. There are many tools for this, but they all use a schema as input.

Author:  Volker [ 17.07.2008, 12:40 ]
Post subject:  Re: XML schema

Haven't checked if the current format is well formed, but it shouldn't be to hard to generate an XML-Schema for validating Horde3D's XML files.

Author:  cantele [ 17.07.2008, 16:16 ]
Post subject:  Re: XML schema

I think validating them before trying to use them with the engine is also a good idea in general, even if the engine cannot validate them itself. So a utility to do this would be in a general interest. Also to check output from tools that are meant to generate content for the engine.

Author:  Volker [ 18.07.2008, 16:35 ]
Post subject:  Re: XML schema

If you have created a schema, you can just use the Xerces/ XML Parser to validate the files you are loading. This would mean you are creating your own loader for the XML data and add the resources using the Horde3D API.

By the way, the engine checks for missing attributes already. In case of a missing attribute you get a warning log message.

Author:  cantele [ 20.07.2008, 13:39 ]
Post subject:  Re: XML schema

Actually I decided to retrograde to plain XML generation for now because I found the available XML tools for C++ somewhat cumbersome... and schema creation in any automated way seems to be a rare feature in free software.

I found a free class online that allows XML generation with little additional code (though a lot of performance) overhead compared to a real constructor and doesn't need me to convert numbers to strings or escape anything.

Which means I can generate a resource using code like (where t is for tag, a is for attribute, e is for endtag):

Code:
std::ostringstream xml;
XmlStream(xml) << t("Model") <<
    a("name") << "quadmodel" << a("geometry") << "myquadgeom" <<
        t("Mesh") <<
            a("name") << "quadname" << a("material") << "my.material.xml" <<
            a("batchStart") << 0 << a("batchCount") << 6 <<
            a("vertRStart") << 0 << a("vertREnd") << 3 <<
    e("Model"); // Mesh tag is closed automatically...
Horde3D::loadResource(quadmodel, xml.str().c_str(), xml.str().length()+1 );


http://www.codeproject.com/KB/stl/simple_xmlwriter.aspx

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/