• <bdo id='joHld'></bdo><ul id='joHld'></ul>
    <tfoot id='joHld'></tfoot>

      <legend id='joHld'><style id='joHld'><dir id='joHld'><q id='joHld'></q></dir></style></legend>
    1. <i id='joHld'><tr id='joHld'><dt id='joHld'><q id='joHld'><span id='joHld'><b id='joHld'><form id='joHld'><ins id='joHld'></ins><ul id='joHld'></ul><sub id='joHld'></sub></form><legend id='joHld'></legend><bdo id='joHld'><pre id='joHld'><center id='joHld'></center></pre></bdo></b><th id='joHld'></th></span></q></dt></tr></i><div id='joHld'><tfoot id='joHld'></tfoot><dl id='joHld'><fieldset id='joHld'></fieldset></dl></div>

      <small id='joHld'></small><noframes id='joHld'>

      在 C# 中使用 Schematron/XSD 进行 XML 验证

      时间:2023-06-02

      <small id='7BycP'></small><noframes id='7BycP'>

      1. <tfoot id='7BycP'></tfoot>
          <tbody id='7BycP'></tbody>
        <legend id='7BycP'><style id='7BycP'><dir id='7BycP'><q id='7BycP'></q></dir></style></legend>
          <i id='7BycP'><tr id='7BycP'><dt id='7BycP'><q id='7BycP'><span id='7BycP'><b id='7BycP'><form id='7BycP'><ins id='7BycP'></ins><ul id='7BycP'></ul><sub id='7BycP'></sub></form><legend id='7BycP'></legend><bdo id='7BycP'><pre id='7BycP'><center id='7BycP'></center></pre></bdo></b><th id='7BycP'></th></span></q></dt></tr></i><div id='7BycP'><tfoot id='7BycP'></tfoot><dl id='7BycP'><fieldset id='7BycP'></fieldset></dl></div>
            • <bdo id='7BycP'></bdo><ul id='7BycP'></ul>

              • 本文介绍了在 C# 中使用 Schematron/XSD 进行 XML 验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我一直在寻找一种方法来对 XML 文档进行一些更高级的业务规则验证.到目前为止,Schematron 似乎能够做到,我需要什么.

                I've been looking around for at a way to make some more advanced business rule validation of XML documents. So far Schematron seems to be able to do, what I need.

                我一直在环顾四周,发现的几个库都非常老旧,似乎不再受支持.Schematron 在 2002 年只是热"吗?是否有任何库可以在 C# 中进行验证 - 或者我该怎么做?

                I've been looking around, and the few libraries I've found was very old and seemingly not supported any longer. Was Schematron only "hot" in 2002? Are there any libraries that can do the validation in C# - or how do I do it?

                或者还有其他可以进行高级验证并拥有 C# 库并进行标准化的吗?

                Or are there others that can do the advanced validation and have C# libraries and are standardized?

                推荐答案

                对于它的价值,这是我的经验......

                For what it's worth, this has been my experience...

                我曾经希望架构可以在业务规则验证方面做得更多.但是,根据我的经验,有一个模式来定义数据协定(格式、类型等)...... 来强制执行业务规则.试图让它变得更多会遇到各种各样的问题,这可能就是为什么 Schematron 的受欢迎程度似乎已经下降(可能是我无法备份的错误假设).

                I've had moments where I wish schemas could do more along the lines of business rule validation. However, in my experience a schema is there to define a data contract (format, types, etc)... NOT to enforce business rules. Trying to make it more than that runs into all sorts of problems and may be why Schematron seems to have died down in its popularity (possibly bad assumption that I cannot backup).

                要解决这个问题,通常可以采用两遍方法:

                To get around this, one can generally do a two pass approach:

                • 使用架构验证验证 xml 结构/数据类型等.
                • 对 xml 应用业务规则检查(在普通 c# 代码中).

                我了解您是否希望采用一体化的方法进行验证,但从长远来看,尝试为此使用架构会导致更多的麻烦.最后,您将通过隔离代码来更好地控制业务规则检查.

                I understand if you're wanting to do an all-in-one approach to validation but attempting to use schema for this causes more headaches in the long run. In the end you'll end up having finer control over your business rule checking by isolating to code.

                这篇关于在 C# 中使用 Schematron/XSD 进行 XML 验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在 WCF 服务中使用 RequestContext 映射路径 下一篇:未声明 XML 签名元素

                相关文章

                最新文章

                <i id='bIpuI'><tr id='bIpuI'><dt id='bIpuI'><q id='bIpuI'><span id='bIpuI'><b id='bIpuI'><form id='bIpuI'><ins id='bIpuI'></ins><ul id='bIpuI'></ul><sub id='bIpuI'></sub></form><legend id='bIpuI'></legend><bdo id='bIpuI'><pre id='bIpuI'><center id='bIpuI'></center></pre></bdo></b><th id='bIpuI'></th></span></q></dt></tr></i><div id='bIpuI'><tfoot id='bIpuI'></tfoot><dl id='bIpuI'><fieldset id='bIpuI'></fieldset></dl></div>

                  <bdo id='bIpuI'></bdo><ul id='bIpuI'></ul>

                  <small id='bIpuI'></small><noframes id='bIpuI'>

                    <tfoot id='bIpuI'></tfoot>
                  1. <legend id='bIpuI'><style id='bIpuI'><dir id='bIpuI'><q id='bIpuI'></q></dir></style></legend>