如何判断 XML 元素是否在 XSD 文件中标记为必需 [英] How to tell if XML element is marked as required in the XSD file

查看:47
本文介绍了如何判断 XML 元素是否在 XSD 文件中标记为必需的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 XSD 架构中将一些元素标记为非必需元素.我如何确定哪些元素被标记为需要,是否有任何我应该搜索的特定标志.目前我所有的元素都标有 minOccurs="0",这是需要改变的吗?

I need to mark some elements as non required in the XSD schema. How do I go about figuring out which elements are marked as required, is there any particular flag I should be searching for. Currently all of my elements are marked with minOccurs="0", is this what needs to be changed?

推荐答案

是.

minOccurs="0" 是您需要添加到元素的可选内容.
没有 minOccurs 属性意味着强制(因为默认情况下 minOccurs="1")

minOccurs="0" is what you need to add to an element as optional.
Having no minOccurs attribute implies mandatory (since by default minOccurs="1")

这篇关于如何判断 XML 元素是否在 XSD 文件中标记为必需的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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