HI, I have a requirement to parse all <assert> in XSD and convert those conditions in to JavaScript so that cross field validations in UI is achieved. So far i'm able to parse all <assert> tags in XSD using XERCES 2.11 Example: *<xsd:complexType name="StartElement"> <xsd:assert test="(((element1 = 'SOMEVALUE') and exists(element2) and exists(element3) and exists(element4)) or (element1!= 'SOMEVALUE'))"/> </xsd:complexType>*
In above example i'm able to parse and store value between double quotes against each complex type in XSD. My question: Is there a way to arrive a JavaScript function using XPATH API or any other way, so that if user selects 'SOMEVALUE' for element1, I should be able to make sure element2,element3,element4 are existing without which form is not saved. Somehow i should arrive like the following JS function, *function StartElement(){ if (element1 = 'SOMEVALUE'){ exists(element2); exists(element3); exists(element4); } else if(element1 != 'SOMEVALUE') { return false; } } * Thanks. Viswanthan -- View this message in context: http://apache-xml-project.6118.n7.nabble.com/XSD-assert-parsing-and-converting-to-JavaScript-tp42363.html Sent from the Xerces - J - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org For additional commands, e-mail: j-users-h...@xerces.apache.org