Remove all the occurrence of a element from xsd using java
Can I get a sample java program which scans a folder for all the xsd and then
1. Removes the <choice> </choice> element from all the xsd
2. When there is a <choice> element could we check that the immediate parent element is <sequence> or not .
If its not there then wrap it by <sequence> </sequence> element.
Geert Bormans,
>>the specification is in the question<<
It's just that the specifications weren't that clear to me. If the specifications were shown as follows:
Remove all <choice><\choice> elements with an immediate parent element of <sequence>.
Where there is no immediate parent element of <sequence>, convert any <choice> element to a <sequence> element.
I wouldn't have any issue. I just thought that seeing a final example of the output would confirm the requirements for me. I also think your xslt solution is the best way to go.
java domain,
Do you still need code which does the folder scanning to retrieve the xsds?
(I think the smart way to perform such a task is using XSLT by the way)