Hi Gustavo, Gustavo de Sá Carvalho Honorato wrote: > Hi Werner, > > I know the validation feature and it's very good compared to anothers > frameworks. But, as far as I know, Castor just does schema-based > validation. I need also semantics validation of my XML-based language. Can I assume that you know that you can "inject" your own (custom) Validators at generation time/mapping time ? I am not sure this would be of any help, but it might be worth looking into.
> Do you know Checkstyle or PMD (http://checkstyle.sourceforge.net/ and > http://pmd.sourceforge.net/) ? Yes, I do. > I'm making this kind of framework to > perform validation just like these but for a XML-based language. It's > some kind of rule-based critics system. So, I need to walk in the > object tree, visiting the nodes with Visitors that will implement > these rules and perform checks on each node. Well, you can always use reflection to retrieve enough information about all the children of a Java class (noded in your speak), and 'apply' the visitors. > So, if a node violates > some rule, I need to feedback the user with the line number and column > of this node. Okay, I now understand your requirement. As far as I know, we don't maintain that information in our framework code (yet). > That's why I need the two representation of the XML, one > abstract just like DOM to make the TreeWalker and another "Java-beans > like" to specify the rules more friendly. It seems that Apache > XMLBeans have these features, ... We do not use DOM internally, just SAX. And that's for very good reasons. You can always (un)marshal from/to DOM, but this won't give you what you are looking for. > but It is not generating the classes > correctly for my XML Schema. > > Thanks again, > Gustavo > > On Wed, May 27, 2009 at 6:46 AM, Werner Guttmann > <[email protected]> wrote: >> Hi, >> >> Gustavo de Sį Carvalho Honorato wrote: >>> Hi again, >>> >>> I'm starting to implement a program with Castor which performs >>> validation in a XML-based programming language. The problem is that I >>> need two features which I did not find either in Castor documentation >>> or in mail archives (in fact, search in mail archives was not working >>> properly), >> Both http://castor.markmail.org and http://nabble.com should allow any >> searches. >> >>> and I want to know if it is available. These are my >>> questions: >> Before trying to answer those questions. Castor support validation at >> the object leven after unmarshalling and before masrshalling. And that#s >> out of the box. Do you know this feature ? >> >>> 1. How can I implement a generic tree transversal operation in classes >>> generated by Castor? Is there a way to call generic methods to >>> retrieve a node's children, and so, walk on tree, for example? >> There's no such feature (yet). And I am not sure - given Castor's >> support for validation - this would really make sense. >>> 2. Is it possible to add a line and column information in classes >>> generated by Castor? I need this feature to feedback programming >>> errors, just like a Java compiler does. >> What should this exactlyl look like ? >> >>> Thanks in advance, >>> Gustavo >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

