简体   繁体   English

生成和验证多种语言的XML文档

[英]Generating and Validating an XML Document in Multiple Languages

I have written an application that takes a proprietary file format and converts it to XML. 我编写了一个采用专有文件格式并将其转换为XML的应用程序。 I would like to localize that XML file based on culture information by translating element and attribute names. 我想通过翻译元素和属性名称来基于文化信息对XML文件进行本地化。

I can see how to create the XML document using resource files but I am wondering if there isn't an easier way. 我可以看到如何使用资源文件创建XML文档,但是我想知道是否没有更简单的方法。

Also will I need to construct multiple schemas or can I handle the cultural differences with multiple namespaces? 我是否还需要构造多个模式,或者可以处理具有多个名称空间的文化差异?

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. 然后,只需使用资源文件即可对XDocument进行LINQ to XML构造。 It wasn't as difficult as I thought. 这并不像我想的那么难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM