Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Problem with XML input to JAXB parser for PE resource manager

You know, the more I think of this, the more I think something else is fishy.  Technically the validator should consider
<x></x>
and
<x/>
equivalent.

What platform are you using?  Windows, perhaps?

Al
----- Albert L. Rossi <arossi@xxxxxxxxxxxxx> wrote:
> Dave,
> 
> I've been mulling over this issue.  There is no easy way to do this in the validator except by catching the exception, checking the message and then turning it into a warning if it matches the message concerning empty children.  However, this message is used indiscriminately for cases where there are empty strings, non-empty strings and actual child elements where there shouldn't be, so if I did this, I'd be throwing out the baby with the bath and not throwing legitimate validation exceptions in the other cases.
> 
> The only other thing I could try is to preprocess the xml.  There are two possible approaches here:
> 
> 1.  Use XSLT.  This would require extra libraries in out build, if I'm not mistaken.
> 2.  Use a regex.  I started down this path but have yet to figure out the correct pattern necessary for this conversion.  I'll continue toying with this for a bit.
> 
> I'll let you know if I manage to automate this reliably.  In the meantime, I guess you'll just have to make sure that
> 
> <a ....></a>
> 
> is changed everywhere to
> 
> <a .../>
> 
> in your XML.
> 
> Al
> ----- Albert L. Rossi <arossi@xxxxxxxxxxxxx> wrote:
> > Dave,
> > 
> > cached is the right assumption.  We changed the way the RM gets initialized.  Once you create an RM, the original config is the one that defines it for its lifetime.  Kill the RM and recreate it.  That should solve the problem for you.
> > 
> > Al
> > ----- Dave Wootton <dwootton@xxxxxxxxxx> wrote:
> > > Al
> > > This didn't help. I'm still getting the same message. I deleted both 
> > > dynamic tab elements from my XML flie, including all the widgets and still 
> > > get the exact same exception and exact same line number reference (line 
> > > 187 column 20). The message still compains about grid-data even though I 
> > > don't have grid-data anywhere in my XML file.
> > > 
> > > It seems like code somewhere has cached something, or something is looking 
> > > at the wrong file since nothing I do changes the line number and column 
> > > reference, even after I restart Eclipse.
> > > 
> > > I think I still have a problem where I have not properly closed an XML tag 
> > > properly, but I'm just not seeing it. I did find a couple problems like 
> > > that but maybe not all of them.
> > > 
> > > My stripped down XML file is attached.
> > > 
> > > Dave
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Re: [ptp-dev] Problem with XML input to JAXB parser for PE      resource 
> > > manager
> > > 
> > > Albert L. Rossi 
> > > to:
> > > Parallel Tools Platform general developers
> > > 06/01/2011 09:00 AM
> > > 
> > > 
> > > Sent by:
> > > ptp-dev-bounces@xxxxxxxxxxx
> > > Please respond to Parallel Tools Platform general developers
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Dave,
> > > 
> > > The JAXB XSD validator is a steel trap.  It does not consider these 
> > > equivalent:
> > > 
> > > <grid-data widthHint="200"></grid-data>
> > > <grid-data widthHint="200"/>
> > > 
> > > Since the XSD does not allow grid-data to have children, the first form is 
> > > being interpreted as an empty-string child.
> > > 
> > > Try changing to the second form and see what happens.
> > > 
> > > I will see if there is a way to make the validator ignore implicit text 
> > > children.
> > > 
> > > Al
> > > 
> > > 
> > > ----- Dave Wootton <dwootton@xxxxxxxxxx> wrote:
> > > > Al
> > > > I'm not sure if I've broken my XML definition for the PE resource 
> > > manager 
> > > > in experimenting with checkboxes or if something else is wrong. I've 
> > > > replaced all of the org.eclipse.ptp.rm.jaxb* source with the  latest 
> > > code 
> > > > from HEAD. I ried coding a checkbox widget and got the following error 
> > > > followed by a SAXParseException.
> > > > 
> > > > !ENTRY org.eclipse.ptp.rm.jaxb.core 4 4 2011-05-31 21:22:50.920
> > > > !MESSAGE Public ID: null
> > > > System ID: null
> > > > Line number: 187
> > > > Column number: 20
> > > > Message: cvc-complex-type.2.1: Element 'grid-data' must have no 
> > > character 
> > > > or element information item [children], because the type's content type 
> > > is 
> > > > empty.
> > > > 
> > > > If I modify the source, I always get this error even if the source 
> > > > contains less than 187 lines. I've reverted the XML source to a previous 
> > > 
> > > > version which was working with the same results. I've also restarted 
> > > both 
> > > > my runtime Eclipse session and my base Eclipse session thinking 
> > > somehting 
> > > > was cached, with no luck.
> > > > 
> > > > I'm attaching my XML source. Can you look at this and let me know if 
> > > I've 
> > > > done something wrong?
> > > > 
> > > > Thanks
> > > > 
> > > > Dave
> > > 
> > > _______________________________________________
> > > ptp-dev mailing list
> > > ptp-dev@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/ptp-dev
> > > 
> > 
> > _______________________________________________
> > ptp-dev mailing list
> > ptp-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ptp-dev
> > 
> 
> _______________________________________________
> ptp-dev mailing list
> ptp-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-dev
> 



Back to the top