如何创建可以在xml中保留空间的xsd? [英] How to create xsd which can preserve space in xml?

查看:33
本文介绍了如何创建可以在xml中保留空间的xsd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建可以在 xml 中保留空间的 XML Schema ...

how can I create XML Schema which can preserve space in the xml ...

推荐答案

你的意思是你想创建一个可以保留 xml 空间的 xml 模式,如果这是问题,那么这里是下面的答案

you mean you wannt to create xml schema that can preserve the space in xml , If that is the question then here is the ans below

您想要保留空间的元素只需为该元素创建您自己的数据类型.例如:-

The element which you want to preserve the space just create your own data type for that element. For Ex:-

 <xs:simpleType name="TitleString">
   <xs:restriction base="xs:string">
     <xs:whiteSpace value="preserve"/>
       <xs:minLength value="5"/>
       <xs:maxLength value="230"/>
   </xs:restriction>
 </xs:simpleType>

并在您的元素中使用此类型.如果您发现任何问题,请告诉我.

and use this type in your element . tell me if you find any prob.

这篇关于如何创建可以在xml中保留空间的xsd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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