homepage Welcome to WebmasterWorld Guest from 23.22.29.137
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XSL transform
rookiecoder




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

Hi,

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

Thanks.

 

httpwebwitch




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

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.

see:
[w3schools.com...]

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

see:
[w3schools.com...]

rookiecoder




msg:4411153
 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.

Dijkgraaf




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

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
[stackoverflow.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved