Hi, Mark
Sorry to bother you again. I worked on this issue
several hours already, but still have no idea what's
wrong with my code. Do you have any examples in you
hand using MathMLParser parse MathMl file? I searched
from google and didn't get anything except the one you
wrote in IO Package.
Thanks again for your kind help.
Jarry
--- Mark Hale <mj_hale@...> wrote:
>
> It should work if the xml validates against the DTD.
> But, I'm adjusting the code to be a little bit
> lenient.
>
> --- Jarry Liu <stoneofjava@...> wrote:
>
> > Mark,
> >
> > Thanks for your quick reply. I tried to add <math>
> > tag
> > into the xml file, but still got the same
> exception.
> > I
> > am not sure if I wrote the right DOCTYPE, or it
> does
> > not matter.
> >
> >
> >
> >
> > --- Mark Hale <mj_hale@...> wrote:
> >
> > > I suspect its because your XML is not valid. It
> is
> > > missing a <math> root element.
> > >
> > >
> > > --- stoneofjava <stoneofjava@...> wrote:
> > >
> >
> > > > <?xml version="1.0"?>
> > > > <!DOCTYPE html PUBLIC
> > > > "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
> > > >
> "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
> > > >
> > > > <apply>
> > > > <power/>
> > > > <apply>
> > > > <plus/>
> > > > <ci> x </ci>
> > > > <ci> y </ci>
> > > > </apply>
> > > > <cn>2</cn>
> > > > </apply>
> > > >
> > > > // Problem.java
> > > >
> > > > import JSci.io.*;
> > > >
> > > > public class Problem{
> > > >
> > > > public Problem(){
> > > > MathMLParser parser = new MathMLParser();
>
> > > > try {
> > > > parser.parse("message.xml");
> > > >
> > > > } catch(Exception e) {
> > > > e.printStackTrace();
> > > > }
> > > >
> > > > Object parseList[] =
> > > > parser.translateToJSciObjects();
> > > >
> > > > for( int i=0; i<parseList.length; i++)
> > > > {
> > > > System.out.println("***");
> > > > }
> > > > }
> > > >
> > > > public static void main(String[] args){
> > > > Problem p = new Problem();
> > > > }
> > > > }
> > > >
> > > >
> > > > Any body can give me some help?
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Jarry
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > > jsci-unsubscribe@yahoogroups.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
>
___________________________________________________________
> > >
> > > How much free photo storage do you get? Store
> your
> > > holiday
> > > snaps for FREE with Yahoo! Photos
> > > http://uk.photos.yahoo.com
> > >
> >
> >
> >
> >
> >
> ____________________________________________________
> >
> > Yahoo! Sports
> > Rekindle the Rivalries. Sign up for Fantasy
> Football
> >
> > http://football.fantasysports.yahoo.com
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> > jsci-unsubscribe@yahoogroups.com
> >
> >
> >
> >
> >
>
>
>
>
>
___________________________________________________________
>
> How much free photo storage do you get? Store your
> holiday
> snaps for FREE with Yahoo! Photos
> http://uk.photos.yahoo.com
>
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com