|
next
|
Subject: Inserting elements when surrounding elements are optional Author: Sandip Chitale Date: 15 Jul 2005 02:55 PM
|
[NOTE: I am a XSL/XSLT newbie.]
I am trying to insert some elements into a web.xml file (the Tomcat configuration file) using XSLT. I want to insert the elements in the right place as per the dtd/schema. The problem is that the surrounding elements are optional.
For example:
Given the following DTD element definition:
<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
I want to insert some filter elements in the right place. However the preceding context-param or succeeding filter-mapping elements may or may not be present.
How do I write XSLT for this situation?
|
|
|