二、XML约束
XML约束有dtd约束和Schema约束两种
dtd约束:
可以在xml内部写dtd约束
也可以在xml中引用外部dtd文件
book.dtd
<!ELEMENT 书架 (书+)>
<!ELEMENT 书架 (书名,作者,售价)>
<!ELEMENT 书名 (#PCDATA)>
<!ELEMENT 作者 (#PCDATA)>
<!ELEMENT 售价 (#PCDATA)>
book.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE 书架 SYSTEM "book.dtd">
<书架>
<书>
<书名>java编程</书名>
<作者>zxx</作者>
<售价>28.8</售价>
</书>
</书架>
可以在Eclipse中校验xml是否符合dtd约束。
例子:struts-config_1_3.dtd(大概能看懂就行了,用来约束struts-config.xml的写法)
<!-- An "AttributeName" is the identifier of a page, request, session, or
application scope attribute.
-->
<!ENTITY % AttributeName "CDATA">
<!-- A "BeanName" is the identifier of a JavaBean, such as a form bean,
and also serves as the name of the corresponding scripting variable
and the name of the JSP attribute under which the bean is accessed.
Therefore, it must conform to the rules for a Java identifier.
-->
<!ENTITY % BeanName "CDATA">
<!-- A "Boolean" is the string representation of a boolean (true or false)
variable.
-->
<!ENTITY % Boolean "(true|false|yes|no)">
<!-- A "ClassName" is the fully qualified name of a Java class that is
instantiated to provide the functionality of the enclosing element.
-->
<!ENTITY % ClassName "CDATA">
<!-- An "Integer" is a character string consisting solely of numeric digits,
optionally preceeded by a minus sign, that can be converted to a
32-bit integer.
-->
<!ENTITY % Integer "CDATA">
<!-- A "Location" is a relative path, delimited by "/" characters, that
defines the location of a resource relative to the location of the
Struts configuration file itself.
-->
<!ENTITY % Location "#PCDATA">
<!-- A "PropName" is the name of a JavaBeans property, and must begin with
a lower case letter and contain only characters that are legal in a
Java identifier.
-->
<!ENTITY % PropName "CDATA">
<!-- A "RequestPath" is an module-relative URI path, beginning with a
slash, that identifies a mapped resource (such as a JSP page or a servlet)
within this web application.
-->
<!ENTITY % RequestPath "CDATA">
<!-- The name of a JSP bean scope within which such a form bean may be
accessed.
-->
<!ENTITY % RequestScope "(request|session)">
<!-- ========== Top Level Elements ======================================== -->
<!-- The "struts-config" element is the root of the configuration file
hierarchy, and contains nested elements for all of the other
configuration settings.
-->
<!ELEMENT struts-config (display-name?, description?, form-beans?, global-exceptions?, global-forwards?, action-mappings?, controller?, message-resources*, plug-in*)>
<!ATTLIST struts-config id ID #IMPLIED>
<!-- The "form-beans" element describes the set of form bean descriptors for this
module. The following attributes are defined:
type Fully qualified Java class to use when instantiating
ActionFormBean objects. If specified, the object must be a
subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You
can set the default implementation class name with the
"formBean" initialization parameter to the Struts
controller servlet.
-->
<!ELEMENT form-beans (form-bean*)>
<!ATTLIST form-beans id ID #IMPLIED>
<!ATTLIST form-beans type %ClassName; #IMPLIED>
<!-- The "form-bean" element describes an ActionForm subclass
[org.apache.struts.action.ActionForm] that can be referenced by an "action"
element.
The "form-bean" element describes a particular form bean, which is a
JavaBean that implements the org.apache.struts.action.ActionForm
class. The following attributes are defined:
className The configuration bean for this form bean object. If
specified, the object must be a subclass of the default
configuration bean.
["org.apache.struts.config.FormBeanConfig"]
extends The name of the form bean that this bean will
inherit configuration information from.
name The unique identifier for this form bean. Referenced by the
<action> element to specify which form bean to use with its
request.
type Fully qualified Java class name of the ActionForm subclass
to use with this form bean.
enhanced Reserved for future use.
-->
<!ELEMENT form-bean (icon?, display-name?, description?, set-property*, form-property*)>
<!ATTLIST form-bean id ID #IMPLIED>
<!ATTLIST form-bean className %ClassName; #IMPLIED>
<!ATTLIST form-bean enhanced %Boolean; #IMPLIED>
<!ATTLIST form-bean extends %BeanName; #IMPLIED>
<!ATTLIST form-bean name %BeanName; #REQUIRED>
<!ATTLIST form-bean type %ClassName; #IMPLIED>
<!-- The "form-property" element describes a JavaBean property that can be used to
configure an instance of a DynaActionForm or a subclass thereof. This element
is only utilized when the "type" attribute of the enclosing "form-bean" element
is [org.apache.struts.action.DynaActionForm] or a subclass of DynaActionForm. If
a custom DynaActionForm subclass is used, then the "dynamic" attribute of the
enclosing <form-bean> element must be set to "true". Since Struts 1.1.
className The configuration bean for this form property object. If
specified, the object must be a subclass of the default
configuration bean.
["org.apache.struts.config.FormPropertyConfig"]
initial String representation of the initial value for this property.
If not specified, primitives will be initialized to zero and
objects initialized to the zero-argument instantiation of that
object class. For example, Strings will be initialized to ""
name The name of the JavaBean property described by this element.
reset The flag that indicates when this property should be reset
to its "initial" value when the form's "reset()" method is
called. If this is set to "true", the property is always
reset when "reset()" is called. This can also be set to
one or more HTTP methods, such as GET or POST. In such a
case, the property will be reset only when the HTTP method
used for the request being processed is included in this
attribute's value(s). Multiple HTTP methods can be
specified by separating them with whitespace or commas.
size The number of array elements to create if the value of the
"type" attribute specifies an array, but there is no value
specified for the "initial" attribute.
type Fully qualified Java class name of the field underlying this
property, optionally followed by "[]" to indicate that the
field is indexed.
-->
<!ELEMENT form-property (set-property*)>
<!ATTLIST form-property className %ClassName; #IMPLIED>
<!ATTLIST form-property initial CDATA #IMPLIED>
<!ATTLIST form-property name %PropName; #REQUIRED>
<!ATTLIST form-property reset %Boolean; #IMPLIED>
<!ATTLIST form-property size %Integer; #IMPLIED>
<!ATTLIST form-property type %ClassName; #REQUIRED>
<!-- The "global-exceptions" element describes a set of exceptions that might be
thrown by an Action object. The handling of individual exception types is
configured through nested exception elements. An <action> element may
override a global exception handler by registering a local exception handler
for the same exception type. Since Struts 1.1.
-->
<!ELEMENT global-exceptions (exception*)>
<!ATTLIST global-exceptions id ID #IMPLIED>
<!-- The "exception" element registers an ExceptionHandler for an exception type.
The following attributes are defined:
bundle Servlet context attribute for the message resources bundle
associated with this handler. The default attribute is the
value specified by the string constant declared at
Globals.MESSAGES_KEY.
[org.apache.struts.Globals.MESSAGES_KEY]
className The configuration bean for this ExceptionHandler object.
If specified, className must be a subclass of the default
configuration bean
["org.apache.struts.config.ExceptionConfig"]
extends The name of the exception handler that this
will inherit configuration information from.
handler Fully qualified Java class name for this exception handler.
["org.apache.struts.action.ExceptionHandler"]
key The key to use with this handler's message resource bundle
that will retrieve the error message template for this
exception.
path The module-relative URI to the resource that will complete
the request/response if this exception occurs.
scope The context ("request" or "session") that is used to access
the ActionMessage object
[org.apache.struts.action.ActionMessage] for this
exception.
type Fully qualified Java class name of the exception type to
register with this handler.
-->
<!ELEMENT exception (icon?, display-name?, description?, set-property*)>
<!ATTLIST exception id ID #IMPLIED>
<!ATTLIST exception bundle %AttributeName; #IMPLIED>
<!ATTLIST exception className %ClassName; #IMPLIED>
<!ATTLIST exception extends %ClassName; #IMPLIED>
<!ATTLIST exception handler %ClassName; #IMPLIED>
<!ATTLIST exception key CDATA #IMPLIED>
<!ATTLIST exception path %RequestPath; #IMPLIED>
<!ATTLIST exception scope CDATA #IMPLIED>
<!ATTLIST exception type %ClassName; #REQUIRED>
<!-- The "global-forwards" element describes a set of ActionForward objects
[org.apache.struts.action.ActionForward] that are available to all Action
objects as a return value. The individual ActionForwards are configured
through nested <forward> elements. An <action> element may override a global
forward by defining a local <forward> of the same name.
type Fully qualified Java class to use when instantiating
ActionForward objects. If specified, the object must be a
subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You
can set the default implementation class name with the
"forward" initialization parameter to the Struts
controller servlet.
-->
<!ELEMENT global-forwards (forward*)>
<!ATTLIST global-forwards id ID #IMPLIED>
<!ATTLIST global-forwards type %ClassName; #IMPLIED>
<!-- The "forward" element describes an ActionForward that is to be made
available to an Action as a return value. An ActionForward is referenced by
a logical name and encapsulates a URI. A "forward" element may be used to
describe both global and local ActionForwards. Global forwards are available
to all the Action objects in the module. Local forwards can be
nested within an <action> element and only available to an Action object
when it is invoked through that ActionMapping.
catalog The name of a commons-chain catalog in which to look up
a command to be executed as part of servicing this request.
Only meaningful if "command" is also specified.
className Fully qualified Java class name of ActionForward
subclass to use for this object.
["org.apache.struts.action.ActionForward"]
command The name of a commons-chain command which should be looked up
and executed as part of servicing this request.
extends The name of the forward configuration that this
will inherit configuration information from.
module The module prefix to use with this path. This value should
begin with a slash ("/").
name The unique identifier for this forward. Referenced by the
Action object at runtime to select - by its logical name -
the resource that should complete the request/response.
path The module-relative path to the resources that is
encapsulated by the logical name of this ActionForward.
This value should begin with a slash ("/") character.
redirect Set to "true" if a redirect instruction should be issued to
the user-agent so that a new request is issued for this
forward's resource. If true, RequestDispatcher.Redirect is
called. If "false", RequestDispatcher.forward is called instead.
[false]
-->
<!ELEMENT forward (icon?, display-name?, description?, set-property*)>
<!ATTLIST forward id ID #IMPLIED>
<!ATTLIST forward catalog CDATA #IMPLIED>
<!ATTLIST forward className %ClassName; #IMPLIED>
<!ATTLIST forward command CDATA #IMPLIED>
<!ATTLIST forward extends CDATA #IMPLIED>
<!ATTLIST forward module %RequestPath; #IMPLIED>
<!ATTLIST forward name CDATA #REQUIRED>
<!ATTLIST forward path %RequestPath; #IMPLIED>
<!ATTLIST forward redirect %Boolean; #IMPLIED>
<!-- The "action-mappings" element describes a set of ActionMapping objects
[org.apache.struts.action.ActionMapping] that are available to process
requests matching the url-pattern our ActionServlet registered with the
container. The individual ActionMappings are configured through nested
<action> elements. The following attributes are defined:
type Fully qualified Java class to use when instantiating
ActionMapping objects. If specified, the object must be a
subclass of the default class type.
WARNING: For Struts 1.0, this value is ignored. You
can set the default implementation class name with the
"mapping" initialization parameter to the Struts
controller servlet.
-->
<!ELEMENT action-mappings (action*)>
<!ATTLIST action-mappings id ID #IMPLIED>
<!ATTLIST action-mappings type %ClassName; #IMPLIED>
<!-- The "action" element describes an ActionMapping object that is to be used
to process a request for a specific module-relative URI. The following
attributes are defined:
attribute Name of the request-scope or session-scope attribute that
is used to access our ActionForm bean, if it is other than
the bean's specified "name". Optional if "name" is specified,
else not valid.
cancellable Set to "true" if the Action can be cancelled. By default,
when an Action is cancelled, validation is bypassed
and the Action should not execute the business operation.
If a request tries to cancel an Action when cancellable
is not set, a "InvalidCancelException" is thrown.
[false]
catalog The name of a commons-chain catalog in which to look up
a command to be executed as part of servicing this request.
Only meaningful if "command" is also specified.
className The fully qualified Java class name of the ActionMapping
subclass to use for this action mapping object. Defaults to
the type specified by the enclosing <action-mappings>
element or to "org.apache.struts.action.ActionMapping" if
not specified.
["org.apache.struts.action.ActionMapping"]
command The name of a commons-chain command which should be looked up
and executed as part of servicing this request.
extends The path of the action mapping configuration that this
will inherit configuration information from.
forward Module-relative path of the servlet or other resource that
will process this request, instead of the Action class
specified by "type". The path WILL NOT be processed
through the "forwardPattern" attribute that is configured
on the "controller" element for this module.
Exactly one of "forward", "include", or "type" must be
specified.
include Module-relative path of the servlet or other resource that
will process this request, instead of the Action class
specified by "type". The path WILL NOT be processed
through the "forwardPattern" attribute that is configured
on the "controller" element for this module.
Exactly one of "forward", "include", or "type" must be
specified.
input Module-relative path of the action or other resource to
which control should be returned if a validation error is
encountered. Valid only when "name" is specified. Required
if "name" is specified and the input bean returns
validation errors. Optional if "name" is specified and the
input bean does not return validation errors.
name Name of the form bean, if any, that is associated with this
action mapping.
parameter General-purpose configuration parameter that can be used to
pass extra information to the Action object selected by
this action mapping.
path The module-relative path of the submitted request, starting
with a "/" character, and without the filename extension if
extension mapping is used.
NOTE: Do *not* include a period in your path name,
because it will look like a filename extension and
cause your Action to not be located.
prefix Prefix used to match request parameter names to ActionForm
property names, if any. Optional if "name" is specified,
else not allowed.
roles Comma-delimited list of security role names that are allowed
access to this ActionMapping object. Since Struts 1.1.
scope The context ("request" or "session") that is used to
access our ActionForm bean, if any. Optional if "name" is
specified, else not valid. [session]
suffix Suffix used to match request parameter names to ActionForm
bean property names, if any. Optional if "name" is
specified, else not valid.
type Fully qualified Java class name of the Action subclass
[org.apache.struts.action.Action] that will process requests
for this action mapping. Not valid if either the "forward"
or "include" attribute is specified. Exactly one of
"forward", "include", or "type" must be specified.
unknown Set to "true" if this object should be configured as the
default action mapping for this module. If a request does not
match another object, it will be passed to the ActionMapping
object with unknown set to "true". Only one ActionMapping
can be marked as "unknown" within a module.
[false]
validate Set to "true" if the validate method of the ActionForm bean
should be called prior to calling the Action object for this
action mapping, or set to "false" if you do not want the
validate method called.
[true]
-->
<!ELEMENT action (icon?, display-name?, description?, set-property*, exception*, forward*)>
<!ATTLIST action id ID #IMPLIED>
<!ATTLIST action attribute %BeanName; #IMPLIED>
<!ATTLIST action cancellable %Boolean; #IMPLIED>
<!ATTLIST action catalog CDATA #IMPLIED>
<!ATTLIST action className %ClassName; #IMPLIED>
<!ATTLIST action command CDATA #IMPLIED>
<!ATTLIST action extends %RequestPath; #IMPLIED>
<!ATTLIST action forward %RequestPath; #IMPLIED>
<!ATTLIST action include %RequestPath; #IMPLIED>
<!ATTLIST action input %RequestPath; #IMPLIED>
<!ATTLIST action name %BeanName; #IMPLIED>
<!ATTLIST action parameter CDATA #IMPLIED>
<!ATTLIST action path %RequestPath; #REQUIRED>
<!ATTLIST action prefix CDATA #IMPLIED>
<!ATTLIST action roles CDATA #IMPLIED>
<!ATTLIST action scope %RequestScope; #IMPLIED>
<!ATTLIST action suffix CDATA #IMPLIED>
<!ATTLIST action type %ClassName; #IMPLIED>
<!ATTLIST action unknown %Boolean; #IMPLIED>
<!ATTLIST action validate %Boolean; #IMPLIED>
<!-- The "controller" element describes the ControllerConfig bean
[org.apache.struts.config.ControllerConfig] that encapsulates
a module's runtime configuration. The following
attributes are defined:
bufferSize The size of the input buffer used when processing
file uploads.
[4096]
catalog Name of the catalog to use when processing requests
for this module.
[struts]
className Fully qualified Java class name of the
ControllerConfig subclass for this controller object.
If specified, the object must be a subclass of the
default class.
["org.apache.struts.config.ControllerConfig"]
command Name of the command to execute to process a request.
[servlet-standard]
contentType Default content type (and optional character encoding) to
be set on each response. May be overridden by the Action,
JSP, or other resource to which the request is forwarded.
["text/html"]
forwardPattern Replacement pattern defining how the "path" attribute of a
<forward> element is mapped to a context-relative URL when
it starts with a slash (and when the contextRelative
property is false). This value may consist of any
combination of the following:
- "$M" - Replaced by the module prefix of this module
- "$P" - Replaced by the "path" attribute of the selected
"forward" element
- "$$" - Causes a literal dollar sign to be rendered
- "$x" - (Where "x" is any character not defined above)
Silently swallowed, reserved for future use
If not specified, the default forwardPattern is "$M$P",
which is consistent with the previous behavior of
forwards. Since Struts 1.1. ["$M$P"]
inputForward Set to "true" if you want the "input" attribute of
<action> elements to be the name of a local or global
ActionForward, which will then be used to calculate the
ultimate URL. Set to "false" (the default) to treat the
"input" parameter of <action> elements as a
module-relative path to the resource
to be used as the input form. Since Struts 1.1.
[false]
locale Set to "true" if you want a Locale object stored in the
user's session if not already present.
[true]
maxFileSize The maximum size (in bytes) of a file to be accepted as a
file upload. Can be expressed as a number followed by a
"K", "M", or "G", which are interpreted to mean kilobytes,
megabytes, or gigabytes, respectively.
["250M"]
memFileSize The maximum size (in bytes) of a file whose contents will
be retained in memory after uploading. Files larger than
this threshold will be written to some alternative storage
medium, typically a hard disk. Can be expressed as a number
followed by a "K", "M", or "G", which are interpreted to
mean kilobytes, megabytes, or gigabytes, respectively.
["256K"]
multipartClass The fully qualified Java class name of the multipart
request handler class to be used with this module.
["org.apache.struts.upload.CommonsMultipartRequestHandler"]
nocache Set to "true" if you want the controller to add HTTP
headers for defeating caching to every response from
this module. [false]
pagePattern Replacement pattern defining how the "page" attribute of
custom tags using it is mapped to a context-relative URL
of the corresponding resource. This value may consist of
any combination of the following:
- "$M" - Replaced by the module prefix of this module
- "$P" - Replaced by the value of the "page" attribute
- "$$" - Causes a literal dollar sign to be rendered
- "$x" - (Where "x" is any character not defined above)
Silently swallowed, reserved for future use
If not specified, the default forwardPattern is
"$M$P", which is consistent with previous hard coded
behavior of URL evaluation for "page" attributes.
["$M$P"]
processorClass The fully qualified Java class name of the
RequestProcessor subclass to be used with this module.
["org.apache.struts.chain.ComposableRequestProcessor"]
tempDir Temporary working directory to use when processing
file uploads.
[{Directory provided by servlet container}]
-->
<!ELEMENT controller (set-property*)>
<!ATTLIST controller id ID #IMPLIED>
<!ATTLIST controller bufferSize %Integer; #IMPLIED>
<!ATTLIST controller catalog CDATA #IMPLIED>
<!ATTLIST controller className %ClassName; #IMPLIED>
<!ATTLIST controller command CDATA #IMPLIED>
<!ATTLIST controller contentType CDATA #IMPLIED>
<!ATTLIST controller forwardPattern CDATA #IMPLIED>
<!ATTLIST controller inputForward %Boolean; #IMPLIED>
<!ATTLIST controller locale %Boolean; #IMPLIED>
<!ATTLIST controller maxFileSize CDATA #IMPLIED>
<!ATTLIST controller memFileSize CDATA #IMPLIED>
<!ATTLIST controller multipartClass %ClassName; #IMPLIED>
<!ATTLIST controller nocache %Boolean; #IMPLIED>
<!ATTLIST controller pagePattern CDATA #IMPLIED>
<!ATTLIST controller processorClass %ClassName; #IMPLIED>
<!ATTLIST controller tempDir CDATA #IMPLIED>
<!-- The "message-resources" element describes a MessageResources object with
message templates for this module. The following attributes are defined:
className The configuration bean for this message resources object.
If specified, the object must be a subclass of the default
configuration bean.
["org.apache.struts.config.MessageResourcesConfig"]
factory Fully qualified Java class name of the
MessageResourcesFactory subclass to use for this message
resources object.
["org.apache.struts.util.PropertyMessageResourcesFactory"]
key Servlet context attribute under which this message
resources bundle will be stored. The default attribute is
the value specified by the string constant at
[Globals.MESSAGES_KEY]. The module prefix (if
any) is appended to the key (${key}${prefix}).
[org.apache.struts.Globals.MESSAGES_KEY]
NOTE: The module prefix includes the leading
slash, so the default message resource bundle for a module
named "foo" is stored under
"org.apache.struts.action.MESSAGE/foo".
null Set to "true" if you want our message resources to return a
null string for unknown message keys, or "false" to return a
message with the bad key value.
parameter Configuration parameter to be passed to the createResources
method of our factory object.
-->
<!ELEMENT message-resources (set-property*)>
<!ATTLIST message-resources id ID #IMPLIED>
<!ATTLIST message-resources className %ClassName; #IMPLIED>
<!ATTLIST message-resources factory %ClassName; #IMPLIED>
<!ATTLIST message-resources key %AttributeName; #IMPLIED>
<!ATTLIST message-resources null %Boolean; #IMPLIED>
<!ATTLIST message-resources parameter CDATA #REQUIRED>
<!-- The "plug-in" element specifies the fully qualified class name of a
general-purpose application plug-in module that receives notification of
application startup and shutdown events. An instance of the specified class
is created for each element, and can be configured with nested <set-property>
elements. The following attributes are supported:
className Fully qualified Java class name of the plug-in class; must
implement [org.apache.struts.action.PlugIn].
-->
<!ELEMENT plug-in (set-property*)>
<!ATTLIST plug-in id ID #IMPLIED>
<!ATTLIST plug-in className %ClassName; #REQUIRED>
<!-- ========== Subordinate Elements ====================================== -->
<!-- The "description" element contains descriptive (paragraph length) text
about the surrounding element, suitable for use in GUI tools.
-->
<!ELEMENT description (#PCDATA)>
<!ATTLIST description id ID #IMPLIED>
<!-- The "display-name" element contains a short (one line) description of
the surrounding element, suitable for use in GUI tools.
-->
<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name id ID #IMPLIED>
<!-- The "icon" element contains a small-icon and large-icon element which
specify the location, relative to the Struts configuration file, for small
and large images used to represent the surrounding element in GUI tools.
-->
<!ELEMENT icon (small-icon?, large-icon?)>
<!ATTLIST icon id ID #IMPLIED>
<!-- The "large-icon" element specifies the location, relative to the Struts
configuration file, of a resource containing a large (32x32 pixel)
icon image.
-->
<!ELEMENT large-icon (%Location;)>
<!ATTLIST large-icon id ID #IMPLIED>
<!-- The "set-property" element specifies the method name and initial value of
an additional JavaBean configuration property. When the object representing
the surrounding element is instantiated, the accessor for the indicated
property is called and passed the indicated value. The "set-property"
element is especially useful when a custom subclass is used with
<forward>, <action>, or <plug-in> elements. The subclass
can be passed whatever other properties may be required to configure the
object without changing how the struts-config is parsed.
Since Struts 1.3, an alternate syntax is supported. By using
the "key" attribute instead of the "property" attribute, you can set
arbitrary string properties on the Config object which is populated
based on the containing element. NOTE: the "key" attribute is NOT
supported for <set-property> inside a <plug-in> element.
property Name of the JavaBeans property whose setter method
will be called. Exactly one of
"property" or "key" must be specified.
key Where supported, the key which will be used to store
the specified value in the given config object. Exactly one of
"property" or "key" must be specified.
value String representation of the value to which this
property will be set, after suitable type conversion
-->
<!ELEMENT set-property EMPTY>
<!ATTLIST set-property id ID #IMPLIED>
<!ATTLIST set-property property %PropName; #IMPLIED>
<!ATTLIST set-property key CDATA #IMPLIED>
<!ATTLIST set-property value CDATA #REQUIRED>
<!-- The "small-icon" element specifies the location, relative to the Struts
configuration file, of a resource containing a small (16x16 pixel)
icon image.
-->
<!ELEMENT small-icon (%Location;)>
<!ATTLIST small-icon id ID #IMPLIED>
二、XML约束的更多相关文章
- javaweb学习总结八(xml约束DTD)
一:XML约束概念 xml约束:可以编写一个文档来约束xml文件的书写规范. xml语言格式比较严谨,不可能让程序员随意编写,所以必须要有约束. 二:常用的xml约束技术 1:DTD,document ...
- JavaBean 内省API BeanUtils工具 泛型 xml xml约束
1 什么是JavaBean?有何特征? 1)符合特定规则的类 2)JavaBean分二类: a)侠义的JavaBean .私有的字段(Field) .对私 ...
- xml约束的概念
1 xml 约束的概念 XML 指可扩展标记语言(EXtensible Markup Language) XML 是一种标记语言,很类似 HTML XML 的设计宗旨是传输数据,而非显示数据 XML ...
- xml约束(转)
在XML技术里,可以编写一个文档来约束一个XML文档的书写规范,这称之为XML约束. 常用的约束技术XML DTD :XML Schema. XML Schema 也是一种用于定义和描述 XML 文档 ...
- Mybatis xml约束文件的使用
一:准备.DTD约束文件 核心配置文件约束文件:mybatis-config.dtd <?xml version="1.0" encoding="UTF- ...
- XML 约束
XML约束 一.约束 约束:规定 xml 文档的书写规则 要求: 1.能够在 xml 中引入约束文档 2.能够简单的读懂约束文档 分类: 1.DTD:一种简单的约束技术(后缀.dtd) 2.Schem ...
- xml基础之二(XML结构【2】)DTD文档模版
xml基础之二(XML结构[2])DTD文档模版 xml 模板 文档结构 我们知道XML主要用于数据的存储和传输,所以无论是自定义还是外部引用DTD模板文档,都是为了突出数据的存储规范.DTD(文档 ...
- XML约束之DTD
XML文件的约束:什么叫约束呢?顾名思义,就是对xml文件的内容进行按照既定规则的限制.我们知道,因为xml文件的标签是可以自定义的,而往往我们用xml文件都是为了表达一定的数据集合(即小型的数据库) ...
- JAVA基础学习之XMLCDATA区、XML处理指令、XML约束概述、JavaBean、XML解析(8)
1.CDATA区在编写XML文件时,有些内容可能不想让解析引擎解析执行,而是当作原始内容处理.遇到此种情况,可以把这些内容放在CDATA区里,对于CDATA区域内的内容,XML解析程序不会处理,而是直 ...
随机推荐
- CentOS 6.x启动时网卡eth0未激活
简述 安装CentOS 6.x操作系统后,开机时发现没有网络,最后发现系统启动时未激活网卡 - 因为只有在激活状态的网卡才能去连接网络,进行网络通讯. 简述 激活网卡eth0 激活网卡eth0 执行& ...
- JAVA 多态和异常处理作业——动手动脑以及课后实验性问题
1. 阅读以下代码(CatchWho.java),写出程序运行结果: 1) 源代码 public class CatchWho { public static void main(String[] ...
- ARM的启动和中断向量表
启动的方式 对于S3C2440而言,启动的方式有两种,一是Nor Flash方式启动,二是Nand Flash方式启动. 使用Nor Flash方式启动 Nor Flash的地址范围如下 0x0000 ...
- sql server中局部变量与全局变量的 申明与赋值(转)
来源:http://www.111cn.net/database/mssqlserver/36734.htm 例子:http://www.cnblogs.com/sunxi/p/4497493.htm ...
- java arrayCopy
int[] dest = new int[0]; int[] value = {1,2}; if(value != null && value.length>0) { int[] ...
- JDE910笔记1--基础介绍及配置
1.一般JDE部署后环境: DV:开发环境 PY:测试环境 PD:正式环境 根据端口号区分不同环境,可配置.同时,JDE默认使用分发服务器,不同环境连接为不同的数据库. 2.命名规范: 自定义项目.函 ...
- MyEclipse8.6 破解以及注册码
建立JAVA工程文件.将以下Java代码拷贝至类中并执行即可. 注册码: register name: bobo9360013 Serial:oLR8ZC-855550-6065705698041 ...
- SqlServer 慢查询分析优化
分三步: 记录慢查询的语句到日志文件 1.首先在SSMS,工具菜单下打开Profiler. 2.输入你用户名密码登陆. 3.常规,勾选保存到文件,选择一个文件路径,设置文件大小,这样可以分文件存储日志 ...
- java 面向对象编程--第十四章 多线程编程
1. 多任务处理有两种类型:基于进程和基于线程. 2. 进程是指一种“自包容”的运行程序,由操作系统直接管理,直接运行,有自己的地址空间,每个进程一开启都会消耗内存. 3. 线程是进程内部单一的 ...
- YouTube技术架构
谈不上翻译,就是摘录 1 billion video views per day 1.Apache 2.Python 3.Linux (SuSe) 4.MySQL 5.psyco, a dynamic ...