DataSet Schema(xml:space =" preserve") [英] DataSet Schema (xml:space="preserve")

查看:103
本文介绍了DataSet Schema(xml:space =" preserve")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于架构的DataSet。



选择元素应包含非空字符串值ex:"   ;         "

I have a DataSet that is based on a schema.

Select elements are expected to contain non empty string values ex: "           "

当我拿出值为非空字符串的DataSet xml元素时,属性xml:space =" preserve"添加...这是我读过的正确的功能。



我的问题是如何修改我的模式,以便当xml:space ="保存"是否存在我仍然可以验证模式?

When I pull out the DataSet xml elements where the value is a non empty string the attribute xml:space="preserve" is added... which is correct functionality from what I've read.

My question is how do I modify my schema so that when xml:space="preserve" is present I still can validate against the schema?

在此示例中,myText元素可以包含至少包含一些非空白字符的常规字符串...它也可以包含非空字符串"               "。

In this sample the myText element can contain regular strings with at least some non whitespace characters... it can also contain a non empty string like "               ".

< xs:element
name = " myDataTable "
minOccurs = " 0 " >

    <
xs:complexType >        < xs:sequence >

              < xs:element
名称 = " myID "
类型 = " xs:int " />

              <
xs:element
名称 = " myText "
类型 = " xs:string " />

         < /
xs:sequence >

    < /
xs:complexType >

< /
xs:element >

<xs:element name="myDataTable" minOccurs ="0">
     <
xs:complexType>
          <
xs:sequence>
               <xs:element name="myID" type="xs:int"/>
               <
xs:element name="myText" type="xs:string"/>
          </
xs:sequence>
     </
xs:complexType>
</
xs:element>

推荐答案

xml:space =" preserve"表示应用程序保留所有空白区域的意图,I不会影响你的验证。

xml:space="preserve" indicates the intent that applications preserve all the white space, I don't it will affect your validation.


这篇关于DataSet Schema(xml:space =&quot; preserve&quot;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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