I have a XML where all values are stringified accordingly to a given culture (decimal separator for floats, month/day order for dates).
I have to convert this XML to another culture. How to do that with minimal effort?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XML is a transition format, so it is best to keep it in culture-invariant format. I wouldn’t recommend formatting XML.
That said, if you still have to do that, because of somebody’s strange requirement, you will have to parse each string to appropriate class and format it again using different culture. I can’t actually give you an example, as I don’t know what language/technology you are referring to. I can only assume that you meant C#/.Net…
EDIT
You can also transform culture-invariant XML using XSL.