Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 7th, 2004, 11:47 AM
teksure teksure is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 teksure User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 20 sec
Reputation Power: 0
Question MSXML with encoding ISO8859_1

Hi everybody, I am using MSXML parser and use encoding ISO8859_1 but occurs
this error --> Loading XML File - System does not support the specified
encoding.'encoding ISO8859_1 Line 1 Column 53

procedure TForm1.XSLTransform(input, output, ss: string);
var
FDOMDoc: DOMDocument;
FXSLTemplate: XSLTemplate;
FXSLDoc: FreeThreadedDOMDocument;
FXSLProc: IXSLProcessor;
// uc: UnitConverter;
i: integer;
outfile: TFileStream;
x : String;
begin
CoInitializeEx(nil, COINIT_APARTMENTTHREADED);
FDOMDoc := CoFreeThreadedDOMDocument40.Create;
FXSLTemplate := CoXSLTemplate40.Create;
FXSLDoc := CoFreeThreadedDOMDocument40.Create;

try
FXSLDoc.async := false;
FXSLDoc.validateOnParse := true;
FXSLDoc.resolveExternals := true;
FXSLDoc.preserveWhiteSpace := false;
FXSLDoc.load(ss);

FDOMDoc.async := false;
FDOMDoc.validateOnParse := true;
FDOMDoc.resolveExternals := true;
FDOMDoc.preserveWhiteSpace := false;
FDOMDoc.load(input);

try
if (FDOMDoc.parseError <> nil) and (FDOMDoc.parseError.errorCode
<> 0) then
raise Exception.Create('Loading XML File - ' +
FDOMDoc.parseError.reason +
' Line ' +
IntToStr(FDOMDoc.parseError.line) +
' Column ' +
IntToStr(FDOMDoc.parseError.linepos));
if (FXSLDoc.parseError <> nil) and (FXSLDoc.parseError.errorCode
<> 0) then
raise Exception.Create('Loading XSL Stylesheet - ' +
FXSLDoc.parseError.reason + ' Line ' +
IntToStr(FXSLDoc.parseError.line) +
' Column ' +
IntToStr(FXSLDoc.parseError.linepos) +
' (' + './' + ss + ')');

try
FXSLTemplate.stylesheet := FXSLDoc;
FXSLProc := FXSLTemplate.createProcessor;

// Create a pointer to the IUnitConverter interface
// uc := CoUnitConverter.Create;

// I think I'm having problems here
// FXSLProc.addObject(uc, 'urn:convlib');
FXSLProc.input := FDOMDoc;

outfile := TFileStream.Create(output, fmCreate or
fmShareExclusive);
FXSLProc.output := TStreamAdapter.Create(outfile) as IStream;

if not FXSLProc.transform then
begin
// get transformation error messages here
raise Exception.Create('Error during Transform.');
end;
// x := FXSLProc.output;
// Memo1.Lines.Text := x;


finally
// uc := nil;
// For some reason this call doesn't work
{ if Assigned(FXSLProc) then
FXSLProc.addObject(nil, 'urn:convlib'); }
FXSLProc := nil;
if Assigned(outfile) then
outfile.Free;
end;
except
on E: Exception do
begin
x := e.Message;
ShowMessage(e.Message);
end;
end;
finally
FDOMDoc := nil;
FXSLTemplate := nil;
FXSLDoc := nil;
end;
end;

What have I done wrong or what have I done for solution this error?

Kind regards.

Gustavo Cardona Ramírez
Product Manager - Cofounder
Mentat Technologies

Those who would give up essential liberty, to purchase a little temporary
safety, deserve neither liberty nor safety.

--Benjamin Franklin

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > MSXML with encoding ISO8859_1


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT