#endif
LDOM_XmlReader::RecordType ReadRecord (LDOM_XmlReader& aReader,
Standard_IStream& theIStream,
- LDOM_OSStream& aData)
+ LDOM_OSStream& aData,
+ Standard_Boolean& theDocStart)
{
#ifdef LDOM_PARSER_TRACE
static aCounter = 0;
++ aCounter;
#endif
- const LDOM_XmlReader::RecordType aType = aReader.ReadRecord (theIStream, aData);
+ const LDOM_XmlReader::RecordType aType = aReader.ReadRecord (theIStream, aData, theDocStart);
#ifdef LDOM_PARSER_TRACE
static FILE * ff = NULL;
TCollection_AsciiString aTraceFileName;
Standard_Boolean isDoctype = Standard_False;
Standard_Boolean isInsertFictRootElement = Standard_False;
+ Standard_Boolean aDocStart = Standard_True;
+
for(;;) {
LDOM_XmlReader::RecordType aType = (theWithoutRoot && !isInsertFictRootElement ?
LDOM_XmlReader::XML_START_ELEMENT :
- ReadRecord (*myReader, theIStream, myCurrentData));
+ ReadRecord (*myReader, theIStream, myCurrentData, aDocStart));
switch (aType) {
case LDOM_XmlReader::XML_HEADER:
if (isDoctype || isElement) {
myError = "User abort at startElement()";
break;
}
- isError = ParseElement (theIStream);
+ isError = ParseElement (theIStream, aDocStart);
if (isError) break;
continue;
}
//purpose : parse one element, given the type of its XML presentation
//=======================================================================
-Standard_Boolean LDOMParser::ParseElement (Standard_IStream& theIStream)
+Standard_Boolean LDOMParser::ParseElement (Standard_IStream& theIStream, Standard_Boolean& theDocStart)
{
Standard_Boolean isError = Standard_False;
const LDOM_BasicElement * aParent = &myReader->GetElement();
LDOM_Node::NodeType aLocType;
LDOMBasicString aTextValue;
char *aTextStr;
- LDOM_XmlReader::RecordType aType = ReadRecord (* myReader, theIStream, myCurrentData);
+ LDOM_XmlReader::RecordType aType = ReadRecord (* myReader, theIStream, myCurrentData, theDocStart);
switch (aType) {
case LDOM_XmlReader::XML_UNKNOWN:
isError = Standard_True;
myError = "User abort at startElement()";
break;
}
- isError = ParseElement (theIStream);
+ isError = ParseElement (theIStream, theDocStart);
break;
case LDOM_XmlReader::XML_END_ELEMENT:
{