In the xsd , when we have an attribute with type xs:ID or xs:Integer as use:required, can we pass empty string to it? This should not be possible ideally. What needs to be added to achieve this?
相关问题
- Illegal to have multiple roots (start tag in epilo
- Newtonsoft DeserializeXNode expands internal array
- how to use special characters like '<'
- XML - XSLT - document() function inside count() fu
- convert logback.xml to log4j.properties
相关文章
- Creating XML Elements without namespace declaratio
- Get Attribute Value From Simple XML Using JQuery /
- Directly signing an Office Word document using XML
- When sending XML to JMS should I use TextMessage o
- Fragment Content Overlaps Toolbar and Bottom Navig
- Getting “Error: Missing Constraints in ConstraintL
- xslt localization
- Upgrading transaction.commit_manually() to Django
Two possible ways to define a type that accepts either an integer or an empty string are:
(a) define a list type with itemType=integer and maxLength=1
(b) define a union type with member types xs:integer and my:emptyString where my:EmptyString is defined by restriction from xs:string with length=0.
If you need an attribute that is allowed to contain int or empty string you can define custom type and use it as a type for your attribute:
Or using regExp:
If you declare an attribute to be of type
xs:ID
orxs:integer
, then it will not be valid for the attribute to have a value of an empty string. This is true regardless of whether the attribute is required or optional.To be concrete, both
<a x1=""/>
and<a x2=""/>
would be invalid for this XSD: