易截截图软件、单文件、免安装、纯绿色、仅160KB

Xml Schema

Standards
"DTD" was the first formalized standard, but is rarely used anymore.
"XDR" was an early attempt by Microsoft to provide a more comprehensive standard than DTD. This standard has pretty much been abandoned now in favor of XSD.
"XSD" is currently the de facto standard for describing XML documents. There are 2 versions in use 1.0 and 1.1, which are on the whole the same (you have to dig quite deep before you notice the difference). An XSD schema is itself an XML document, there is even an a XSD schema to describe the XSD standard.
There are also a number of other standards but their take up has been patchy at best.
<xs:element/>
Sample:
<xs:element name="Customer_order" type="xs:integer" minOccurs ="0" maxOccurs="unbounded" default="unknown"|fixed=" UK"/>
Complex type
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
XML sample
<Customer>
<Dob> 2000-01-12T12:13:14Z </Dob>
<Address> 34 thingy street, someplace, sometown, w1w8uu </Address>
</Customer>
There are 3 types of compositors <xs:sequence>, <xs:choice> and <xs:all>. These compositors allow us to determine how the child elements within them appear within the XML document.
Compositor
Description
Sequence
The child elements in the XML document MUST appear in the order they are declared in the XSD schema.
Choice
Only one of the child elements described in the XSD schema can appear in the XML document.
All
The child elements described in the XSD schema can appear in the XML document in any order.
Notes
The compositors <xs:sequence> and <xs:choice> can be nested inside other


相关文档:

JSP/XML,JavaBean和CSS/XSL协同工作

1.在JSP中生成动态XML
  可以使用JSP生成XML,使用CSS或者XSL转换和显示XML;
  只要在静态的XML文档模板中加入Java代码和JSP标记,XML就可以有静变动,产生动态的内容,生成XML文档的方法很简单,只需要在文件中使用指令contenttype,如<%@ page contenttype="text/xml"%>;
  在XML文档中同样可以使 ......

xml文档理解

<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">
xml学习:http://www.w3school.com.cn/x.asp ......

使用 XStream实现JavaBean 与 XML/JSON 之间相互转换

XML 和 JSON 是当今常用的两种数据描述与传输的格式,特别是涉及到 JS 时使用 JSON 颇为频繁。自然,在 Java  的世界里少不了完成 JavaBean 与这两种格式相互转换的组件,那就是 XStream 和 JSON-lib。这里我简单记下 XStream  的用法。
其实相类似的工具早已有之。如果用过 DWR 的同志,一定有印像,DWR 进行远 ......

xml简记

SGML过于复杂,关键之处还在于主流浏览器厂商不支持SGML,web应用很好
Little version:XML
html => xhtml =>xml可以理解成是一个过渡的过程
SGML的设计理念就是把文本的内容和样式分开,自然xml也是如此。
xml一般包括以下文件:
DTD-->schema(xsd) 定义文档结构等(内容)
CSS-->XSLT (样式)
xml ---- ......

解析XML时DTD的处理 解析时忽略,生成XML文件时加上


一、解析XML文件时,遇到DTD的定义要怎么办?
    下面这段代码是ibatis配置文件,用w3c Dom(其实任意一种解析方式都是这样)都会从http://www.ibatis.com/dtd/sql-map-config-2.dtd
 这
个地址找对应的DTD文件进行校验,如果因特网上这个地址不存在的话,就会报 java.net.ConnectException:
Con ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号