Recent

Author Topic: I need some help with with fcl-xml/xpath  (Read 5358 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
I need some help with with fcl-xml/xpath
« on: April 16, 2010, 08:36:10 pm »

Whenever I try to use EvaluateXPathExpression, I wind up with a SIGSEGV. I have done my homework and there is a similar report from 2007, http://community.freepascal.org:10000/bboards/message?message_id=242871&forum_id=24082.

Are there some examples of its use out there? Googling has not shown any.
I don't mind some other libraries if they are more uptodate. The dates in the xpath source go back to 2003, but I can't be sure if there have been some updates over the years.

Code: [Select]
procedure TutilitiesInterfaceForm.btnTestXPathClick(Sender: TObject);
var
  XML: TXMLDocument;
  pathString: string;
  xpathValue: TXPathVariable;
  strStream: TStringStream;
begin
  strStream := TStringStream.Create(mmoXML.Text);
  ReadXMLFile(XML, strStream);
  pathString := edtXPath.Text;
  //xpathValue := TXPathVariable.Create;
  xpathValue := EvaluateXPathExpression(pathString, XML);
  edtXPathResult.Text := xpathValue.AsText;
end;   

Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018