4 Replies Latest reply on Oct 12, 2011 12:09 PM by igarashitm

    Right place to validate (XML) Message contents

    igarashitm

      Hi all,

       

      I've been comparing XSLT stuff of JBossESB with one of SwitchYard, and noticed that JBossESB's XsltAction has  functionality of input source validation with various type of schema(DTD, XML Schema, RELAX NG)

      http://docs.jboss.org/jbossesb/docs/4.10/manuals/html/Programmers_Guide/index.html#OOB-transformers-xsltaction

       

      I'm not sure where is the best to implement on SwitchYard.. is that OK to implement it in XsltTransformer?

       

      BTW, JBossESB/XsltAction also has failOnWarning option, which is currently an advantage against SwitchYard/XsltTransformer. That seems to be implemented easily using ErrorListener. I'll raise a JIRA for it later.

        • 1. Re: Right place to validate (XML) Message contents
          kcbabo

          Tomohisa igarashi wrote:

           

          I've been comparing XSLT stuff of JBossESB with one of SwitchYard, and noticed that JBossESB's XsltAction has  functionality of input source validation with various type of schema(DTD, XML Schema, RELAX NG)

          http://docs.jboss.org/jbossesb/docs/4.10/manuals/html/Programmers_Guide/index.html#OOB-transformers-xsltaction

           

          I'm not sure where is the best to implement on SwitchYard.. is that OK to implement it in XsltTransformer?

           

          This came up in one of the Japan workshops.  After a little bit of chatting, an idea came out around allowing validation to be declared similar to the way transformation is today.  So you could have a Validator instance that is defined in the application configuration that is always invoked during message exchange.  The difference between Validator and Transformer would be that Validator only works on one type - i.e. there is no 'from' and 'to', there is just a 'type'.  When a validator is discovered for a certain type, it's executed.  I think this option could be quite flexible and it also allows validators to be used independent and across transformer implementations, instead of doing it inside of each transformer implementation.

           

          Thoughts?

           

           

          BTW, JBossESB/XsltAction also has failOnWarning option, which is currently an advantage against SwitchYard/XsltTransformer. That seems to be implemented easily using ErrorListener. I'll raise a JIRA for it later.

           

          Nice one.

          • 2. Re: Right place to validate (XML) Message contents
            igarashitm


            This came up in one of the Japan workshops.  After a little bit of chatting, an idea came out around allowing validation to be declared similar to the way transformation is today.  So you could have a Validator instance that is defined in the application configuration that is always invoked during message exchange.  The difference between Validator and Transformer would be that Validator only works on one type - i.e. there is no 'from' and 'to', there is just a 'type'.  When a validator is discovered for a certain type, it's executed.  I think this option could be quite flexible and it also allows validators to be used independent and across transformer implementations, instead of doing it inside of each transformer implementation.

             

            Thoughts?

            Sounds great to me

            • 3. Re: Right place to validate (XML) Message contents
              kcbabo

              Tomohisa igarashi wrote:

              Thoughts?

              Sounds great to me

               

              Cool, would you mind filing a JIRA on it?

               

              thanks,

              keith

              • 4. Re: Right place to validate (XML) Message contents
                igarashitm

                [Add message contents validation mechanism] - https://issues.jboss.org/browse/SWITCHYARD-492