We use the attached function FGetFileEncoding to look for the format of the file.
It returns two parameters:
- The encoding (ANSI, UTF-8, Unicode)
- The characters to omit (the BOF-markers)
For reading lines with automatically treating correctly CRLF or CR or LF we use the attached object clsfilebuffered input. (Probably some functions are missing. If someone is interested, please write me)
Arne
Xml file UTF-8 BOM
Xml file UTF-8 BOM
Hello Wolfgang,
SELF:cXml:=StringReadZeroNoAnsi(cFile) // Read XML
SELF:cInvoiceDateXML:=SeekXMLElement("cbc:IssueDate",cXml,1) // etc
I do not see how that could be done easier in .Net.
Dick
I basically do the same for multiple methods which are easier to implement in .Net than in VO. But I didn't find anything easier concerning XML in .Net. Reading UBL files, the proposed European standard for invoices, is just 2 functions in VO and then code like this, total 14 lines to read in all relevant data.wriedmann wrote: it is much, much simpler do that in .NET than in plain VO..... I'm using them in through a COM module in VO
SELF:cXml:=StringReadZeroNoAnsi(cFile) // Read XML
SELF:cInvoiceDateXML:=SeekXMLElement("cbc:IssueDate",cXml,1) // etc
I do not see how that could be done easier in .Net.
Dick
Xml file UTF-8 BOM
Hi Dick,
the implementation of the XML functions seemed me easier in .NET than in VO.
And since I already need a .NET module for the webservice interaction, I have simply added my COM module.
Wolfgang
the implementation of the XML functions seemed me easier in .NET than in VO.
And since I already need a .NET module for the webservice interaction, I have simply added my COM module.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 46
- Joined: Mon Sep 26, 2016 12:59 pm
- Location: Italy
Xml file UTF-8 BOM
Hi all,
I'm testing now ChilKat ActiveX COM component and so far so good.
I need to manipulate extracted strings from the xml file node by node (I don't need all of them) as this have to be processed later for being inserted in a temp DB.
I also need to extract the xml data from digitally signed files (.p7m) and, some time, to extract the PDF attached to the xml file for archiving purpose.
Stefano
I'm testing now ChilKat ActiveX COM component and so far so good.
I need to manipulate extracted strings from the xml file node by node (I don't need all of them) as this have to be processed later for being inserted in a temp DB.
I also need to extract the xml data from digitally signed files (.p7m) and, some time, to extract the PDF attached to the xml file for archiving purpose.
Stefano
Xml file UTF-8 BOM
Not tested and some wanted a simple VO syntax.. I remember this worked in some memo coversions.
Cannot remember it TRUE then FALSE or FALSE then true. Worth a shot
SetAnsi(TRUE)
cData := memoread( cData)
SetAnsi(FALSE)
Cannot remember it TRUE then FALSE or FALSE then true. Worth a shot
SetAnsi(TRUE)
cData := memoread( cData)
SetAnsi(FALSE)
Phil McGuinness
Xml file UTF-8 BOM
Hello Phil,
So it's still a conversion. If something is converted incorrectly with ANSI then OEM may solve that but it also may not. The function I published few messages above does not have this issue.
Dick
TRUE specifies the ANSI format; FALSE specifies the OEM format.Sherlock wrote:Not tested and some wanted a simple VO syntax.. I remember this worked in some memo conversions.
So it's still a conversion. If something is converted incorrectly with ANSI then OEM may solve that but it also may not. The function I published few messages above does not have this issue.
Dick