|
@@ -291,6 +291,7 @@ type
|
|
FIntSubset: TWideCharBuf;
|
|
FIntSubset: TWideCharBuf;
|
|
FAttrTag: Cardinal;
|
|
FAttrTag: Cardinal;
|
|
FDTDProcessed: Boolean;
|
|
FDTDProcessed: Boolean;
|
|
|
|
+ FFragmentMode: Boolean;
|
|
FToken: TXMLToken;
|
|
FToken: TXMLToken;
|
|
FNext: TXMLToken;
|
|
FNext: TXMLToken;
|
|
FCurrEntity: TEntityDecl;
|
|
FCurrEntity: TEntityDecl;
|
|
@@ -1318,6 +1319,7 @@ begin
|
|
FNesting := 0;
|
|
FNesting := 0;
|
|
FCurrNode := @FNodeStack[0];
|
|
FCurrNode := @FNodeStack[0];
|
|
FCursorStack[0] := doc;
|
|
FCursorStack[0] := doc;
|
|
|
|
+ FFragmentMode := False;
|
|
NSPrepare;
|
|
NSPrepare;
|
|
Initialize(ASource);
|
|
Initialize(ASource);
|
|
if FSource.FXMLVersion <> xmlVersionUnknown then
|
|
if FSource.FXMLVersion <> xmlVersionUnknown then
|
|
@@ -1345,6 +1347,7 @@ begin
|
|
FNesting := 0;
|
|
FNesting := 0;
|
|
FCurrNode := @FNodeStack[0];
|
|
FCurrNode := @FNodeStack[0];
|
|
FCursorStack[0] := AOwner as TDOMNode_WithChildren;
|
|
FCursorStack[0] := AOwner as TDOMNode_WithChildren;
|
|
|
|
+ FFragmentMode := True;
|
|
FXML11 := doc.InheritsFrom(TXMLDocument) and (TXMLDocument(doc).XMLVersion = '1.1');
|
|
FXML11 := doc.InheritsFrom(TXMLDocument) and (TXMLDocument(doc).XMLVersion = '1.1');
|
|
NSPrepare;
|
|
NSPrepare;
|
|
Initialize(ASource);
|
|
Initialize(ASource);
|
|
@@ -3131,9 +3134,6 @@ end;
|
|
|
|
|
|
procedure TXMLReader.DoEndElement;
|
|
procedure TXMLReader.DoEndElement;
|
|
begin
|
|
begin
|
|
- if (FNesting = 1) and (FCursorStack[0] = doc) then
|
|
|
|
- FState := rsEpilog;
|
|
|
|
-
|
|
|
|
if FValidate and FValidators[FNesting].Incomplete then
|
|
if FValidate and FValidators[FNesting].Incomplete then
|
|
ValidationError('Element ''%s'' is missing required sub-elements', [FNodeStack[FNesting].FQName^.Key], -1);
|
|
ValidationError('Element ''%s'' is missing required sub-elements', [FNodeStack[FNesting].FQName^.Key], -1);
|
|
end;
|
|
end;
|
|
@@ -3695,6 +3695,8 @@ end;
|
|
|
|
|
|
procedure TXMLReader.PopVC;
|
|
procedure TXMLReader.PopVC;
|
|
begin
|
|
begin
|
|
|
|
+ if (FNesting = 1) and (not FFragmentMode) then
|
|
|
|
+ FState := rsEpilog;
|
|
if FNesting > 0 then Dec(FNesting);
|
|
if FNesting > 0 then Dec(FNesting);
|
|
FCurrNode := @FNodeStack[FNesting];
|
|
FCurrNode := @FNodeStack[FNesting];
|
|
UpdateConstraints;
|
|
UpdateConstraints;
|