Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 19:14

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: XML schema
PostPosted: 16.07.2008, 23:43 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 17.07.2008, 03:27 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
It's not exactly a schema, but the documentation explains all of the tags/attributes that you can use in the XML files.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 17.07.2008, 11:48 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 17.07.2008, 12:40 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 17.07.2008, 16:16 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 18.07.2008, 16:35 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: XML schema
PostPosted: 20.07.2008, 13:39 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group