<legend id='384dN'><style id='384dN'><dir id='384dN'><q id='384dN'></q></dir></style></legend>

    1. <small id='384dN'></small><noframes id='384dN'>

      • <bdo id='384dN'></bdo><ul id='384dN'></ul>

      <tfoot id='384dN'></tfoot>
      1. <i id='384dN'><tr id='384dN'><dt id='384dN'><q id='384dN'><span id='384dN'><b id='384dN'><form id='384dN'><ins id='384dN'></ins><ul id='384dN'></ul><sub id='384dN'></sub></form><legend id='384dN'></legend><bdo id='384dN'><pre id='384dN'><center id='384dN'></center></pre></bdo></b><th id='384dN'></th></span></q></dt></tr></i><div id='384dN'><tfoot id='384dN'></tfoot><dl id='384dN'><fieldset id='384dN'></fieldset></dl></div>
      2. 允许 XSD 日期元素为空字符串

        时间:2023-06-04
        <i id='CfXXR'><tr id='CfXXR'><dt id='CfXXR'><q id='CfXXR'><span id='CfXXR'><b id='CfXXR'><form id='CfXXR'><ins id='CfXXR'></ins><ul id='CfXXR'></ul><sub id='CfXXR'></sub></form><legend id='CfXXR'></legend><bdo id='CfXXR'><pre id='CfXXR'><center id='CfXXR'></center></pre></bdo></b><th id='CfXXR'></th></span></q></dt></tr></i><div id='CfXXR'><tfoot id='CfXXR'></tfoot><dl id='CfXXR'><fieldset id='CfXXR'></fieldset></dl></div>
        • <bdo id='CfXXR'></bdo><ul id='CfXXR'></ul>
        • <small id='CfXXR'></small><noframes id='CfXXR'>

              <tbody id='CfXXR'></tbody>
            <legend id='CfXXR'><style id='CfXXR'><dir id='CfXXR'><q id='CfXXR'></q></dir></style></legend>
            • <tfoot id='CfXXR'></tfoot>

                  本文介绍了允许 XSD 日期元素为空字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想允许一个元素是 xs:date 或空字符串.

                  I would like to allow an element to be a xs:date or an empty string.

                  这是我尝试过的 XML 架构:

                  Here's an XML Schema that I've tried:

                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                             xmlns:lp="urn:oio:ebst:diadem:lokalplan:1" 
                             targetNamespace="urn:oio:ebst:diadem:lokalplan:1" 
                             elementFormDefault="qualified" xml:lang="DA" 
                             xmlns:m="urn:oio:ebst:diadem:metadata:1">
                    <xs:import schemaLocation="../key.xsd" namespace="urn:oio:ebst:diadem:metadata:1" />
                    <xs:element name="DatoVedtaget" type="lp:DatoVedtagetType" />
                    <xs:complexType name="DatoVedtagetType">
                      <xs:simpleContent>      
                        <xs:extension base="xs:date">
                          <xs:attribute ref="m:key" />
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                    <xs:complexType name="DatoVedtagetTypeString">
                      <xs:simpleContent>
                        <xs:extension base="xs:string">
                          <xs:attribute ref="m:key" />
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  </xs:schema>
                  

                  如果元素包含一个值,我希望元素为 DatoVedtagetType,如果它为空,我希望它为 DatoVedtagetTypeString.我如何在这个架构中实现这样的条件功能?

                  I want the element to be DatoVedtagetType in a case it includes a value, and I want it to be DatoVedtagetTypeString if it is empty. How I implement such a conditional functionality this schema?

                  推荐答案

                  根据问题的评论,目标是让 DatoVedtagetxs:date 或为空.这是表达这种约束的一种方式:

                  Per comments on the question, the goal is to have DatoVedtaget be a xs:date or empty. Here is a way to express such a constraint:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                             xmlns:lp="urn:oio:ebst:diadem:lokalplan:1"
                             xmlns:m="urn:oio:ebst:diadem:metadata:1"
                             targetNamespace="urn:oio:ebst:diadem:lokalplan:1"
                             elementFormDefault="qualified"
                             xml:lang="DA">
                    <xs:import schemaLocation="../key.xsd" namespace="urn:oio:ebst:diadem:metadata:1" />
                    <xs:element name="DatoVedtaget" type="lp:DatoVedtagetType" />
                  
                    <xs:simpleType name="empty">
                      <xs:restriction base="xs:string">
                        <xs:enumeration value=""/>
                      </xs:restriction>
                    </xs:simpleType>
                  
                    <xs:simpleType name="dateOrEmpty">
                      <xs:union memberTypes="xs:date lp:empty"/>
                    </xs:simpleType>  
                  
                    <xs:complexType name="DatoVedtagetType">
                      <xs:simpleContent>
                        <xs:extension base="lp:dateOrEmpty">
                          <xs:attribute ref="m:key" />
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  
                  </xs:schema>
                  

                  这篇关于允许 XSD 日期元素为空字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使 dotnet webservice 设置 minOccurs=“1";在字 下一篇:如何选择使用默认命名空间的节点?

                  相关文章

                  最新文章

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

                  <legend id='TfJ7D'><style id='TfJ7D'><dir id='TfJ7D'><q id='TfJ7D'></q></dir></style></legend>

                    <tfoot id='TfJ7D'></tfoot>

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