0

I have written an application that takes a proprietary file format and converts it to XML. I would like to localize that XML file based on culture information by translating element and attribute names.

I can see how to create the XML document using resource files but I am wondering if there isn't an easier way.

Also will I need to construct multiple schemas or can I handle the cultural differences with multiple namespaces?

John Donnelly
  • 875
  • 1
  • 10
  • 29
  • I've never heard of anyone trying to localize element and attribute names, if you localize, then only the content. Why do you want to do this? Localizing the structure will lead to lots of problems imho. – vesan Jul 30 '14 at 05:26
  • Just thinking that, for example, a German user of the application would like to see an XML file in German. – John Donnelly Jul 30 '14 at 13:32
  • I see what you mean, but the user should generally not have to worry about the XML structure (unless they need to troubleshoot... or the software is an XML editor :). I would advise against doing this. – vesan Jul 30 '14 at 23:03

1 Answers1

0

I went ahead and created five schemas, one for each of the five languages that my app supports. Then it was just a matter of using resource files for the LINQ to XML contruction of the XDocument. It wasn't as difficult as I thought.

John Donnelly
  • 875
  • 1
  • 10
  • 29