Page 1 of 1

Remove optional elements

Posted: Mon Apr 06, 2009 9:51 am
by alk
Hi,

I'd like to run an XSLT that removes all elements from the source document which are optional according to the related schema. Is there a way to determine if an element ist mandatory or optional???

Regards
- Alex

Re: Remove optional elements

Posted: Tue Apr 07, 2009 11:19 am
by george
Hi Alex,

In the general case I believe it is very difficult as you practically need to implement an XML Schema processor in XSLT. If you can take advantage of some patterns in your schema then that may be a reasonably doable task.

Best Regards,
George