I'm working at a project using XML processing for building a conventional web application. The processing ensures that application properties are set depending on the target stage. Basically there's a properties template file and an instruction file, the template file is processed with the instructions.
Unfortenately I do have a problem processing the template for a web.xml file. First the instructions:
As you can see it reads the template for a web.xml file, determines an output file followed by an instruction to delete an element for stage p(roduction).
The template file:
The build process works fine using the given files.
Now I wanted to update the web.xml template to a higher JSP spec, so I changed the file as follows:
The rest is identical code, the only changed lines are at top of the file. Now the build fails with an error:
--- Nested Exception ---
de.my.ipad.antsupport.transformer.IllegalInstructionException: Unable to resolve xpath //web-app/servlet[servlet-name='ServletRedirector'] in document ipad-aip_web_template.cfg
Why can't the xpath be resolved? In my understanding nothing changed in the files structure itself. Or am I missing the obvious?
Of course the restriction "sub-element" servlet-name=ServletRedirector is still missing, I have a hard time to express this in a way like my example above. I know that I can next predicates, I just can't figure out how.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com