mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 18:49:16 +02:00
* xmlread.pp, the end of root element is now detected without involving DOM nodes.
git-svn-id: trunk@16942 -
This commit is contained in:
parent
88e22be01a
commit
6ccb769768
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user