Yes. There's a well formed way. Thanks a lot Vadim,
Vadim Gritsenko wrote: >>From: Ivan Rubin [mailto:[EMAIL PROTECTED]] >> >>Sorry. I should add a line to the example... >>Ivan Rubin wrote: >> >> >>>Not valid XML, but are not we working with a flow of events? >>> > > Reminder: XSP is and XML file => Must be well formed. > > > >>>Isn't hierarchy the last tabu? >>> >>>String operator=null; >>>while( recordset.next() ) { >>> if( operator == null || >>> !operator.equalsIgnoreCase( recordset.operator() ) ) { >>> if( operator != null ) { >>> // trigger an 'operator' closing tag >>> } >>> >>> // trigger an 'operator' opening tag >>> >>* operator = recordset.operator(); >> >> >>> } >>> >>> // trigger data events associated with this operator >>>} >>> >>>if( operator != null ) { >>> // trigger an operator closing tag >>>} >>> > > This looks like grouping by operator. But if recordset.operator() > returns null, you have a problem (not properly closed 'operator' tag). > > Why not: > > boolean f = false; > while (f || recordset.next()) { > f = false; > String operator = recordset.operator(); > // trigger an 'operator' opening tag > > while ((f = recordset.next()) && > operator.equals(recordset.operator())) { > f = false; > // trigger data events associated with this operator > } > > // trigger an operator closing tag > } > > This will be well-formed. > > > >>>I understand the error serverpages generator's error. >>>I think the logic is ok, and common. >>>I can do this with sax. >>>There's a workaround to do it with xsp? >>> > > Yep. SAX content handler is available. Check out XSP page's generate > Java code. > > > >>>Don't get angry with me Vadim, I try to do my best. >>> > > I'm not. > > Take care, > Vadim > > >>>Thanks, >>> >>>Vadim Gritsenko wrote: >>> >>> >>>>>From: Ivan Rubin [mailto:[EMAIL PROTECTED]] >>>>> >>>>>Hello, >>>>> >>>>>I need to open and close tags arbitrarily while iterating through >>>>> > a > >>>>>record set. >>>>> >>>>><xsp:content></operator></xsp:content> does not work, as >>>>><xsp:content><operator><xsp:content>, >>>>> >>>>> >>>>This is (obviously) not valid XML. Hence, the error. >>>> >>>> >>>> >>>> >>>>>and I have to do that over the basis of conditionals, and in >>>>> > different > >>>>>places. >>>>> >>>>>the logicsheet does not even generate the .java file. The log says >>>>> >>>>> >>>>that >>>> >>>> >>>>>xsp:content must be terminated with an /xsp:content tag, but thats >>>>> >>>>> >>>>ok... >>>> >>>> >>>>>I don't find a reason for the xsp generator not to process my >>>>>logicsheet. It's the logic that's going to put the things in >>>>> > order. > >>>>Please elaborate why you think that you need this before I suggest >>>>workaround for you. >>>> >>>>Vadim >>>> >>>> >>>> >>>>>Thanks, >>>>> > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > > --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>