此内容没有您所选择的语言版本。
12.16. Using Custom Configuration Namespaces
The basic process involves two steps:
- Writing an configuration XSD for your component that extends the base http://www.milyn.org/xsd/smooks-1.1.xsd configuration namespace. This XSD must be supplied on the classpath with your component. It must be located in the
/META-INF/
folder and have the same path as the namespace URI. For example, if your extended namespace URI is http://www.acme.com/schemas/smooks/acme-core-1.0.xsd, then the physical XSD file must be supplied on the class-path in/META-INF/schemas/smooks/acme-core-1.0.xsd
. - Writing a Smooks configuration namespace mapping configuration file that maps the custom name-space configuration into a
SmooksResourceConfiguration
instance. This file must be named (by convention) based on the name of the name-space it is mapping and must be physically located on the class-path in the same folder as the XSD. Extending the above example, the Smooks mapping file would be/META-INF/schemas/smooks/acme-core-1.0.xsd-smooks.xml
. Note the-smooks.xml
postfix.
Note
The easiest way to get familiar with this mechanism is by looking at existing extended namespace configurations within the Smooks code itself. All Smooks components (including the Java Binding functionality) use this mechanism for defining their configurations. Smooks Core itself defines a number of extended configuration namespaces.