使用TranslateArray跟踪大型复杂的XML转换。 [英] Tracking for big and complicated XML translation with TranslateArray.

查看:101
本文介绍了使用TranslateArray跟踪大型复杂的XML转换。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为50种不同的报告提供了50种不同的XML或JSON格式的数据。想要一次使用bing翻译器TranslateArray方法进行多次翻译。但是不确定在从这个方法收到数据后如何追溯数据。现在这个方法返回的xml
似乎很简单,没有任何跟踪。现在我正在处理大而复杂的xml,可能有300-500个字符串,可以在单个xml中进行翻译。那么,有没有什么方法可以传递一些属性和字符串xml,i
将在翻译后返回它以便于跟踪。

I have big 50 different XMLs or JSON formatted data for 50 different reports. Want to use bing translators TranslateArray method for multiple translations at a time. But not sure how to trace back data after i received it from this method. right now xml returned by this method seems to be very simple without any tracking. right now i am dealing with big and complicated xml with possibly 300-500 string to translate in single xml. so, Is there any way i can pass some attribute along with string xml which i will get it return after translation for easy tracking.

推荐答案

Hi smh,

Hi smh,

我建议编写一个XSL转换,将XML转换为XHTML,然后使用contentType =" text / html"翻译时该内容类型确保在响应中正确嵌套。

I recommend to write an XSL transform that converts your XML to XHTML, and then use the contentType="text/html" when translating. That content type  ensures proper nesting in the response.

您需要让译员知道哪些元素构成句子中断,哪些元素是内部的。要映射的元素应该反映出句子内部与句子外部的HTML语义。例如< P>和< TITLE>打破
一个句子,< A>才不是。

You need to let the Translator know what elements constitute sentence breaks and which ones are internal. The element to map to should mirror the HTML semantics of being sentence-internal vs sentence-external. For instance <P> and <TITLE> break a sentence, and <A> does not.

如果你使用Translate(),你仍然可以提交一大块XHTML,而且TranslateArray()的好处是你不必从XML包装器中解析它。您提交的数据块需要是一个或多个完整的和封闭的元素。 

If you use Translate(), you can still submit a chunk of XHTML, and the benefit of TranslateArray() is that you don't have to parse it out of an XML wrapper. The chunk you submit needs to be one or more complete and closed elements. 

这有意义吗?

Chris Wendt

Chris Wendt
Microsoft Translator


这篇关于使用TranslateArray跟踪大型复杂的XML转换。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆