[Lazarus] TDOMParseOptions, TDOMParser, TXMLDocument, ... how to set TDOMParser Options?

Michael Joyner ᏩᏯ mjoyner at vbservices.net
Fri Nov 27 15:53:14 CET 2009


Sergei Gorelkin wrote:
> Michael Joyner ᏩᏯ пишет:
>> TDOMParseOptions, TDOMParser, TXMLDocument, ... how to set TDOMParser 
>> Options?
>   has one available. Just create a TDOMParser and set its options like 
> this:
>
> domParser := TDOMParser.Create;
> domParser.Options.ExpandEntities := True;
>
> See e.g. the "Validating a document" example in 
> http://wiki.freepascal.org/XML_Tutorial 
Sample code that does now work:

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog.Execute then begin
     domParser := TDOMParser.Create;
     domParser.Options.ExpandEntities:=True;
     domParser.Options.PreserveWhitespace:=False;
     domParser.Options.ResolveExternals:=True;
     domParser.Options.Namespaces:=True;
     domParser.Options.CDSectionsAsText:=False;
     domParser.ParseURI(FileNameToURI(OpenDialog.Filename),xdoc);
  end;
end;                           
>
Is there any way to have the domParser process <import> tags ?





More information about the Lazarus mailing list