XSD学习

XSD学习
XSD的学习,下面链接上有详细的XSD学习资料, http://www.w3pop.com/learn/view/p/1/o/0/doc/schema_facets/

www.w3pop.com这网站上有与XML/HTML相关的详细资料。


在Myeclipse编写XSD文件非常的主法,只需要把与XSD相关的元素记住就行,像编辑XML一样,并且有提示,还可以根据XSD文件建立XML文件。这是一个随便写的XSD文件
<? xml version="1.0" encoding="UTF-8" ?>
< schema  xmlns ="http://www.w3.org/2001/XMLSchema"  targetNamespace ="http://www.example.org/note"  xmlns:tns ="http://www.example.org/note" >
    
< element  name ="note" >
        
< complexType >
            
< attribute  name ="id"  type ="integer"  use ="required"   />
            
< sequence >
                
< element   name ="to"   >
                    
< simpleType >
                        
< restriction  base ="integer" >
                            
< minInclusive  value ="0" ></ minInclusive >
                            
< maxInclusive  value ="100" ></ maxInclusive >
                        
</ restriction >
                    
</ simpleType >
                
</ element >
                
< element   name ="from"  type ="string" />
                
< element   name ="heading"  type ="string" />
                
< element   name ="body"  type ="string" />
                
            
</ sequence >
        
</ complexType >
        
    
</ element >
    
</ schema >

你可能感兴趣的:(XSD学习)