+ // Get the resource path and look for the DTD
+ OSFactory *pOSFactory = OSFactory::instance( getIntf() );
+ const list<string> &resPath = pOSFactory->getResourcePath();
+ const string &sep = pOSFactory->getDirSeparator();
+ list<string>::const_iterator it;
+ struct stat statBuf;
+
+ // Try to load the catalog first (needed at least on win32 where
+ // we don't have a default catalog)
+ for( it = resPath.begin(); it != resPath.end(); it++ )
+ {
+ string catalog_path = (*it) + sep + "skin.catalog";
+ if( !stat( catalog_path.c_str(), &statBuf ) )
+ {
+ msg_Dbg( getIntf(), "Using catalog %s", catalog_path.c_str() );
+ xml_CatalogLoad( m_pXML, catalog_path.c_str() );
+ break;
+ }
+ }
+ if( it == resPath.end() )
+ {
+ // Ok, try the default one
+ xml_CatalogLoad( m_pXML, 0 );
+ }
+
+ for( it = resPath.begin(); it != resPath.end(); it++ )
+ {
+ string path = (*it) + sep + "skin.dtd";
+ if( !stat( path.c_str(), &statBuf ) )
+ {
+ // DTD found
+ msg_Dbg( getIntf(), "Using DTD %s", path.c_str() );
+
+ // Add an entry in the default catalog
+ xml_CatalogAdd( m_pXML, "public",
+ "-//VideoLAN//DTD VLC Skins V"
+ SKINS_DTD_VERSION "//EN", path.c_str() );
+ break;
+ }
+ }
+ if( it == resPath.end() )