theFileName + " cannot be opened for reading";
theApplication->MessageDriver()->Write (aMsg.ToExtString());
- Standard_Failure::Raise("File cannot be opened for reading");
+ throw Standard_Failure("File cannot be opened for reading");
}
}
// 1. Read DOM_Document from file
LDOMParser aParser;
- if (aParser.parse(theIStream))
+ // if myFileName is not empty, "document" tag is required to be read
+ // from the received document
+ Standard_Boolean aWithoutRoot = myFileName.IsEmpty();
+
+ if (aParser.parse(theIStream, Standard_False, aWithoutRoot))
{
TCollection_AsciiString aData;
cout << aParser.GetError(aData) << ": " << aData << endl;
// oan: OCC22305 - check a document verison and if it's greater than
// current version of storage driver set an error status and return
- if( aCurDocVersion > XmlLDrivers::StorageVersion().IntegerValue() )
+ if( aCurDocVersion > XmlLDrivers::StorageVersion() )
{
TCollection_ExtendedString aMsg =
TCollection_ExtendedString ("error: wrong file version: ") +
chr = dir.Value ( i );
switch ( chr ) {
-
- case _TEXT( '|' ):
- dirRet += _TEXT( "/" );
+
+ case '|':
+ dirRet += "/";
break;
-
- case _TEXT( '^' ):
-
- dirRet += _TEXT( ".." );
+
+ case '^':
+
+ dirRet += "..";
break;
default:
else
myReaderStatus = PCDM_RS_OK;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- TCollection_ExtendedString anErrorString (Standard_Failure::Caught()->GetMessageString());
+ TCollection_ExtendedString anErrorString (anException.GetMessageString());
aMsgDriver -> Write (anErrorString.ToExtString());
}