Example of xwork DTD <! --
Xwork configuration DTD.
Use the following doctype
<! Doctype xwork public
"-// Opensymphony group // xwork 1.1.1 // en"
Http://www.opensymphony.com/xwork/xwork-1.1.1.dtd>
-->
<! Element xwork (package | include) *>
<! Element package (result-types ?, Interceptors ?, Default-interceptor-ref ?, Default-action-ref ?, Global-results ?, Global-exception-mappings ?, Action *)>
<! ATTLIST package
Name CDATA # required
Extends CDATA # implied
Namespace CDATA # implied
Abstract CDATA # implied
Externalreferenceresolver nmtoken # implied
>
<! Element result-types (result-type +)>
<! Element result-type (Param *)>
<! ATTLIST result-type
Name CDATA # required
Class CDATA # required
Default (true | false) "false"
>
<! Element interceptors (interceptor | Interceptor-stack) +>
<! Element Interceptor (Param *)>
<! ATTLIST interceptor
Name CDATA # required
Class CDATA # required
>
<! Element Interceptor-stack (Interceptor-ref +)>
<! ATTLIST Interceptor-Stack
Name CDATA # required
>
<! Element Interceptor-ref (Param *)>
<! ATTLIST Interceptor-ref
Name CDATA # required
>
<! Element default-interceptor-ref (Param *)>
<! ATTLIST default-interceptor-ref
Name CDATA # required
>
<! Element default-action-ref (Param *)>
<! ATTLIST default-action-ref
Name CDATA # required
>
<! Element external-ref (# pcdata)>
<! ATTLIST external-ref
Name nmtoken # required
Required (true | false) "true"
>
<! Element global-results (result +)>
<! Element global-exception-mappings (exception-mapping +)>
<! Element Action (Param | result | Interceptor-ref | exception-mapping | external-ref) *>
<! ATTLIST action
Name CDATA # required
Class CDATA # implied
Method CDATA # implied
Converter CDATA # implied
>
<! Element param (# pcdata)>
<! ATTLIST Param
Name CDATA # required
>
<! Element result (# pcdata | PARAM) *>
<! ATTLIST result
Name CDATA # implied
Type CDATA # implied
>
<! Element exception-mapping (# pcdata | PARAM) *>
<! ATTLIST exception-Mapping
Name CDATA # implied
Exception CDATA # required
Result CDATA # required
>
<! Element include (# pcdata)>
<! ATTLIST include
File CDATA # required
>
Xwork. xml example <xwork>
<Include file = "webwork-default.xml"/>
<Package name = "person" extends = "webwork-Default" namespace = "/person">
<Action name = "listpeople" class = "com. opensymphony. webwork. Showcase. Person. listpeople">
<Interceptor-ref name = "validationworkflowstack"/>
<Result type = "freemarker"> listpeople. FTL </result>
</Action>
<! -- Our jasperreports example -->
<Action name = "jasperlist" class = "com. opensymphony. webwork. Showcase. Jasper. jasperaction">
<Result name = "success" type = "Jasper">
<Param name = "location">/Jasper/sample_report.jasper </param>
<Param name = "datasource"> People </param>
<Param name = "documentname"> peoplereport </param>
</Result>
</Action>
<Action name = "newperson" class = "com. opensymphony. webwork. Showcase. Person. createperson">
<Result type = "Redirect"> listpeople. Action </result>
<Result name = "input" type = "freemarker"> newperson. FTL </result>
</Action>
<Action name = "editperson" class = "com. opensymphony. webwork. Showcase. Person. editperson">
<Result> editpeople. jsp </result>
</Action>
<Action name = "doeditperson" class = "com. opensymphony. webwork. Showcase. Person. editperson" method = "save">
<Result name = "error"> editpeople. jsp </result>
<Result type = "Redirect"> listpeople. Action </result>
</Action>
</Package>
</Xwork>