Jacob Q
Jacob Q

Reputation: 61

How to read XML document which is fixed width?

I got an XML file to load. The problem is that it is physically saved as a fixed width file. This means that the whole is written in lines with a fixed width, with exceptions, i.e. there may be fewer characters in the line. There are errors when using XmlDocument.Load (). How to correctly load such an XML file?

This is how the file looks: This is how the file looks

Upvotes: 2

Views: 197

Answers (2)

RaV
RaV

Reputation: 21

My guess is that you have to fix the file into the proper format. To be honest, I've seen these particular xmls and I've never seen such occurence. When you download the XML it is already in such format?

I guess, you're creating an XML out of the given XML schema (XSD), at least that's what I was doing with "JPK". What error are you receiving from XmlDocument.Load()?

Upvotes: 0

micha_nerd
micha_nerd

Reputation: 45

Use the file helpers-library from C# It's free and should solve your problem: https://www.filehelpers.net/

Edit: If you're doing that already it would be good to know the error message you are getting.

Upvotes: 1

Related Questions