fixed-length-record

Is xslt good approach to convert text to xml structure?

只愿长相守 提交于 2019-11-29 15:42:54
问题 I am trying to find a better solution to convert a plain text (but with predefined lengths for each field) to xml. For example the input text can be "Testuser new york 10018", the first 11 characters indicates user name, next 12 character indicates city and next 5 characters indicates zip code. So I need to form a xml from the above string with predefined field lengths. I am thinking 2 approaches Define a business entity and fill the entity properties by using substring functions on the input