Xml file UTF-8 BOM

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Xml file UTF-8 BOM

Post by ArneOrtlinghaus »

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)
ffileencoding.txt
(32.03 KiB) Downloaded 43 times
clsfile.txt
(51.49 KiB) Downloaded 46 times
Arne
ic2
Posts: 1804
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Xml file UTF-8 BOM

Post by ic2 »

Hello Wolfgang,
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
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.

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
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Xml file UTF-8 BOM

Post by wriedmann »

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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
stecosta66
Posts: 44
Joined: Mon Sep 26, 2016 12:59 pm

Xml file UTF-8 BOM

Post by stecosta66 »

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
Sherlock
Posts: 60
Joined: Mon Sep 28, 2015 1:37 pm
Location: Australia mate... fare dikkum

Xml file UTF-8 BOM

Post by Sherlock »

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)
Phil McGuinness
ic2
Posts: 1804
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Xml file UTF-8 BOM

Post by ic2 »

Hello Phil,
Sherlock wrote:Not tested and some wanted a simple VO syntax.. I remember this worked in some memo conversions.
TRUE specifies the ANSI format; FALSE specifies the OEM format.

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
Post Reply