Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XSL transform



4:54 pm on Jan 26, 2012 (gmt 0)


I am quite new to xsl. I have an requirement, where I have 3 files - xsd schema, xml based on the schema and an xsl stylesheet.

My aim is to check for mandatory values in xml for all the xsd elements using annotation (not using minoccurs).

For example,

IF documentation of element says mandatory
and field has no value in xml
print an error message



5:16 pm on Jan 26, 2012 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

you can accomplish "if" conditions in the XSL, using <xsl:if>. Check the value of the element, and if it's not valid, display your error.


if you need an if/else structure, then use <xsl:choose>



5:24 pm on Jan 26, 2012 (gmt 0)

yes i do understand this, but i am not getting the syntax to read anotation->documentation for all elements in xsd.


8:40 pm on Jan 26, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

The question is, why are you trying to use the annotations for that in the first place? Sounds fraught with problems.
There is a blog here that will help you however

Featured Threads

Hot Threads This Week

Hot Threads This Month