[英]Advantage XPath Evaluation over XSLT
I'm currently programming an application, that uses WPF. 我当前正在编写一个使用WPF的应用程序。 Therefore I'm planning to load the GUI dynamically via XAML based upon a given XML.
因此,我计划基于给定的XML通过XAML动态加载GUI。
As I see it, I have two choices: 如我所见,我有两种选择:
So, the question is, which way is more suitable? 那么,问题是,哪种方法更合适? Or is there no difference and it's just a question of which way I prefer more?
还是没有区别,这只是我更喜欢哪种方式的问题?
XSLT sounds like a bad choice: XSLT听起来是一个错误的选择:
With XML, it's pretty straight forward. 使用XML,这非常简单。 However, XPath can be also quite a mess, if you start nesting, and nesting.
但是,如果您开始嵌套和嵌套,那么XPath也会很混乱。
Define a XML format, use xml-->object deserialization, and start building UI from the objects. 定义XML格式,使用xml->对象反序列化,然后开始从对象构建UI。 Don't bother with
Xpath
. 不要理会
Xpath
。 Use XmlSerializer
for "parsing". 使用
XmlSerializer
进行“解析”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.