Menu

precceding nonequal tags

Help
2008-09-16
2013-04-27
  • BubikolRamios

    BubikolRamios - 2008-09-16

    situation; (no class, style, ... or something)

    <body>
    <pre>some text</pre>
    <pre>some text</pre>
    <table><td-s...></table>
    <pre>some text</pre>
    <table>><td-s...></table>
    <body>

    Need to parse tables data into database, putting the contence inside<pre> into first columnn of resulting database table.
    If I have NodeList containing tables ...how can I get preceeding <pre>s for each table in NodeList ?

     
    • BubikolRamios

      BubikolRamios - 2008-09-16

      Ok this works somewhere in my way, but how come that  toPlainTextString,
      , toHtml for <PRE> tag comes out as "" instead actual content ?

            tnf = null;
            tnf = new TagNameFilter();
            tnf.setName("TABLE");
           
            tnf1 = null;
            tnf1 = new TagNameFilter();
            tnf1.setName("PRE");
           
            OrFilter of = new OrFilter(tnf,tnf1);
           
           
            nl = parser.parse(of);
           
           
            for(int i =0; i < nl.size(); i++)
            {
              String sdjfasdf = nl.elementAt(i).getText();
              String sdjfasdf1 = nl.elementAt(i).toPlainTextString();
              String sdjfasdf2 = nl.elementAt(i).toHtml();
              String sdjfasdf3 = nl.elementAt(i).toString();
            
            }

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.