locked
html table to xml RRS feed

  • Question

  • is there some free tool to convert html table(file) to xml file...with xsd offcourse?

    or some code....

    Sunday, February 24, 2008 11:00 AM

Answers

  • Ok, you have a simple problem if I understand well.
    If you have something like:

    www.pera.com/mika.html?datum=2008-2-27

    in your browser, this means that you can write in code behind:

    if (Request.QueryString["datum"] != null)
    {
      string date = Request.QueryString["datum"].ToString();
    }

    and you have value
    2008-2-27
    in variable date.And in Request.QueryString["datum"] you must
    put date because that is value in
    www.pera.com/mika.html?datum=2008-2-27
    after ? and before =
    All this is called "Query strings"

    type in search on internet, and you will find additional things, but i think this
    is enough,

    greet


    Wednesday, February 27, 2008 9:09 AM

All replies

  • If the html file is well formed (according to Xml rules) you may try to read it is as Xml document. If it is not well formed you can use a tool as tidy which will try to make it well formed. Finally you may try to read the html document using IHTMLDocument(3) interface and then generate ouput Xml document. (Please not that the last solution might be a bit challenging to say the least).

     

    Hope this helps

    Pawel

    Monday, February 25, 2008 7:02 AM
    Moderator
  • Well I don't see what problem do you have.
    HTML table is well formed by xml standards, you have exact open and closing tags.
    <table>
    <tr>
    <td>
    some data values
    </td>
    </tr>
    </table>

    so I would suggest a code that will read html file (when you reach <table> start write with xmlWriter in file and
    close file after </table>)

    It is very simple. let me know if you want me to write you this code, but it is realy very simple.
    You know in advance what are tags that are you looking (<tr> , <td>, </tr>, </td>) so when you read that
    write in xml according to that.

    You will have to read HTML file with textReader same as any other text file, and maybe there will be litle
    problems if html is not well formed. if it is, then with readline() you will get immidiately what you need without
    parsing strings.

    Let me know if you need help with coding, but first at least you try to do it,

    best regards
    Monday, February 25, 2008 9:18 AM
  • Dragoslave....brate....pomagaj....

    da stavimo po stranu problem sa tabelom i wellformed html-om....jer sad imam mnogo hitniju stvar...rok je subota...elem

    ako postoji web stranica (html) koja ima jedan deo koji se automatski osvezava, a zavisi od dana koji ja izaberem na strani, kako da ja vidim pun url, jer mislim da taj url ima u sebi npr. www.pera.com/mika.html?datum=2008-2-26, pa kad promenim datum onda je  www.pera.com/mika.html?datum=2008-2-27, medjutim ja u IE address vidim uvek samo  www.pera.com/mika.html....

    probao sam view source strane, trazio po js scriptovima koje strana poziva, probao properties....nista....

    kako da vidim "pun" url stranice....

    Hvala i placam pice kad se vidimo

     

    Wednesday, February 27, 2008 7:59 AM
  • Ok, you have a simple problem if I understand well.
    If you have something like:

    www.pera.com/mika.html?datum=2008-2-27

    in your browser, this means that you can write in code behind:

    if (Request.QueryString["datum"] != null)
    {
      string date = Request.QueryString["datum"].ToString();
    }

    and you have value
    2008-2-27
    in variable date.And in Request.QueryString["datum"] you must
    put date because that is value in
    www.pera.com/mika.html?datum=2008-2-27
    after ? and before =
    All this is called "Query strings"

    type in search on internet, and you will find additional things, but i think this
    is enough,

    greet


    Wednesday, February 27, 2008 9:09 AM
  • Hvala na brzom odgovoru....bicu iskren....evo sta pokusavam da uradim...hocu da napravim statistiku fudblskih meceva...i kad  posetim sajt http://futbol24.com/f24_livenow/LiveNow.html ja dobijam danasnje rezultate i utakmice...ali meni trebaju i one od pre par dana...na strani postoji datum koji kad se promeni, strana se ponovo ucita sa trazenim datumom, ali ja ne vidim query string, da bih mogao da stranu pogodim iz koda (VS.2005 i Net.WebClient)....do sada sam nailazio na sajtove gde mi je sve uvek radilo i ubi se da resim ovaj problem....

    ja ne znam qs da bih mogao da ga potrazim ....a hocu da iz koda posaljem neki url sa qs koji odredjuje datum i da dobijem utakmice koje su igrane na taj dan....

     

    hvala....

     

    Wednesday, February 27, 2008 10:08 AM
  • Hi,


    You can pass parameters in the querystring:


    Response.Redirect("otherpage.aspx?id=5");


    And in "otherpage.aspx" read the values:


    int id = Response.QueryString("id")



    greet

    Wednesday, February 27, 2008 10:38 AM
  • Da to znam, i kad god ja pravim sajt, to podosta koristim, ali to nije odgovor na moje pitanje...pogledaj moj prethodni post...qs je sakriven....kako da dodjem do njega?????

     

    Wednesday, February 27, 2008 1:16 PM
  • I understand now. qs is not hidden, simply on page you have dropdownlist with dates
    and you get data from query from database.

    Sorry but in this case I think you cannot access data remotely,

    greet
    Wednesday, February 27, 2008 2:15 PM
  • Only possible solution in this case is .NET Remoting but then you must work on both sides,
    client and web site , and that is not solution.

    I think that sites like that have service that you pay and then you get data that you want,

    greet
    Wednesday, February 27, 2008 2:53 PM
  • Yes, thats correct...you do have to pay...but my boss is not going to do that....its Balkan....

     

    Wednesday, February 27, 2008 8:42 PM