是否有支持默认属性值的 XML Schema 验证库? [英] Is there a XML Schema validation library that supports the default attribute value?

查看:12
本文介绍了是否有支持默认属性值的 XML Schema 验证库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正确阅读了 XML Schema 规范的默认属性值,验证过程实际上应该更改 DOM 以填充默认值.

If I read the XML Schema specification for default attribute values correctly, the validation process is actually supposed to change the DOM to fill the default values.

default 指定属性无条件地出现在 ·post-schema-validation 信息集中·

default specifies that the attribute is to appear unconditionally in the ·post-schema-validation infoset·

这是对规范的正确解读吗?更重要的是,是否有任何库(Java、C#、Python 等)支持这一点?

Is this a correct reading of the spec? More importantly, do any libraries (Java, C#, Python, etc) support this?

据我所知,validate(document) 方法不会改变文档.

In all I have seen, the validate(document) method does not alter the document.

推荐答案

是的,这是对规范的正确解读.但是许多 XSD 模式验证器只提供是/否的答案,它们实际上并不构建 PSVI.

Yes, this is a correct reading of the spec. But many XSD schema validators only deliver a yes/no answer, they don't actually construct the PSVI.

Xerces 验证器当然可以让您访问完整的 PSVI,尽管我不熟悉您需要用来查看它的 API.

The Xerces validator certainly gives you access to the full PSVI, though I'm not familiar with the APIs you need to use to see it.

Saxon 模式验证器允许您访问 PSVI 中模式感知 XSLT 和 XQuery 使用的那部分,这包括扩展默认属性.

The Saxon schema validator gives you access to that part of the PSVI that's used by schema-aware XSLT and XQuery, and this includes the expansion default attributes.

这篇关于是否有支持默认属性值的 XML Schema 验证库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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