RVXML problem
Posted: Mon Aug 29, 2005 12:20 pm
Hi there,
I'm trying to use a TRichViewXML component to save and load data to and from a TRichView with an associated TRVStyle. Basically, I'm creating a TXMLTag, and trying to save data to that tag. But when I try to save the data, I get an access violation. The TXMLTag is created as part of an object called a TSnippet, and it's created without a parent XMLTag, and without a root TXMLTree:
XMLTag := TXMLTag.Create('snippet-text', nil, nil);
Then I set the Unicode property to match the Unicode property of the TRichView:
XMLTag.Unicode := True;
I don't need anything except the TXMLTag, because each TSnippet object is going to write itself out as part of a larger structure eventually. However, when I try to save data from the TRichView to the TXMLTag, I get an AV here:
procedure TRichViewXML.SaveToXML(Node: TXMLTag);
var
AOnSaveControl: TRVXMLSaveControlEvent;
AOnUnknownItem: TRVXMLUnknownItemEvent;
begin
if not Assigned(FRichView) then Exit;
if Node.Root.UnicodeTags.IndexOf('utext') = -1 then //AV HAPPENS HERE
Can anyone tell me what the problem might be here?
All help appreciated,
Martin
I'm trying to use a TRichViewXML component to save and load data to and from a TRichView with an associated TRVStyle. Basically, I'm creating a TXMLTag, and trying to save data to that tag. But when I try to save the data, I get an access violation. The TXMLTag is created as part of an object called a TSnippet, and it's created without a parent XMLTag, and without a root TXMLTree:
XMLTag := TXMLTag.Create('snippet-text', nil, nil);
Then I set the Unicode property to match the Unicode property of the TRichView:
XMLTag.Unicode := True;
I don't need anything except the TXMLTag, because each TSnippet object is going to write itself out as part of a larger structure eventually. However, when I try to save data from the TRichView to the TXMLTag, I get an AV here:
procedure TRichViewXML.SaveToXML(Node: TXMLTag);
var
AOnSaveControl: TRVXMLSaveControlEvent;
AOnUnknownItem: TRVXMLUnknownItemEvent;
begin
if not Assigned(FRichView) then Exit;
if Node.Root.UnicodeTags.IndexOf('utext') = -1 then //AV HAPPENS HERE
Can anyone tell me what the problem might be here?
All help appreciated,
Martin