Reading HTML data into a DOM

Hi,
I am looking to develop DOM by parsing HTML data. I do not know of how to parse html.
Could you please help ? Any tutorial, guide, assistance ?.
Thanks in advance.
THeo

the key question is whether the html is well formed, or not. If it is, then it's is simple to just parse with DOM, just like any other xml.
If it is not, you may have to use something like
http://java-source.net/open-source/html-parsers

Similar Messages

  • Error reading XML data into a DOM

    Hi,
    I'm trying to read a SVG file from a URI into a DOM like this:
    String uri = "file://d:/mysvgfile.svg";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document svgDoc = builder.parse(uri);
    When I execute the code the following exception is thrown:
    java.net.UnknownHostException: d
    I can't figure out why the exception is thrown. I can create a File object from the URI so the file exists and can be accessed for sure.
    Any help is greatly appreciated!
    Regards,
    Stefan

    try this:
    Document svgDoc = builder.parse("d:/mysvgfile.svg");

  • Is it possible to load HTML data into BW?

    Is it possible to load HTML data into BW,I have read in some places that is is possible but I cannot find much documentation on this on Google or other SAP sources.
    If anyone has some documentation or general how-to guides that would be great!
    Even a general overview in your own words would be a great starter.
    Thank You
    Points will be assigned

    Please check these links n see if it helps
    http://help.sap.com/saphelp_nw2004s/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/frameset.htm
    http://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/icc/bw-udc-jdbc%20universal%20data%20connect%20jdbc%20interface.pdf
    http://help.sap.com/saphelp_nw04/helpdata/en/00/f01640dc88e769e10000000a155106/content.htm
    Regards,
    R.Ravi

  • Problems reading xmp data into dng files

    Hi there,
    I am working on a Mac and have exported files as lossy dng for colour correction externally. They have done the work for LR 5 process (I am using CC) and returned xml files. I cannot seem to read this data into the dng files for further editing in Lightroom. I have tried re-importing them and I have tried reading metadata from file. Any help would be appreciated as I usually simply read the xmp to the original RAW but the RAW files are currently on an external drive in another country!!!
    Thanks,
    Andy

    Moominman wrote:
    I am basically trying to export xmp files from a set of low resolution dng files so that I can access my Lightroom edits in the RAW files. I have separated the RAW and dng files in different folders
    Hi Andy,
    I dunno how best to get extracted xmp files into the raw folders, but if you are comfortable with exiftool, you can use it to extract xmp sidecars from DNG files.
    If you want a turn-key solution which does not required you to futz with exiftool, then consider a free plugin I wrote:
    robcole.com - xEmP
    It will allow you to create xmp sidecars with all your DNG adjustments and metadata (which can then be applied to the non-dng raw files).
    However, if you won't need the DNGs in your catalog afterward, then the easiest way is to convert them back to proprietary raw format using this plugin (also free, and I wrote it):
    robcole.com - UnDNG
    Conceptually, you can think of it as converting the DNGs to proprietary raw format, but note: it doesn't convert anything, it just allows existing raw files that are NOT in the catalog, to replace the DNGs that are in the catalog. All adjustments and metadata and everything else will be preserved (just like when you convert a proprietary raw to DNG format).
    Rob

  • Read Write Data into a MS Word document

    The requirement I am fullfilling directly specifies the need to write data into a Microsoft Word Document and if Necessary, Read Back data from a Microsoft Word Document. The data will be simple text but as time goes on I anticipate the systems engineers may expand the requirement. I want to cross one bridge at a time so I am just concentrating on the text issue. I must do it from within a stand-alone application. Not through a server, not through ASP, not through a browser, just a stand alone application. It appears from my own investigation of the JAVA API that this is not possible. Regrettably, I am only a day or so away from switching to C# or VB to get this job done. My first question is
    1. Can Java Do this?
    2. If not, does Sun Microsystems have any plans to add this capabiliy?
    3. Can we make recommendations to Sun to add this capability to JAVA?

    1. Can Java Do this?Java can do anything but there is no built-in ability to do just that.
    2. If not, does Sun Microsystems have any plans to add
    this capabiliy?
    3. Can we make recommendations to Sun to add this
    capability to JAVA?Very doubtful! MS Office document formats are not completely open to the public - and they are weird! Supporting this capability would probably require an agreement with Microsoft and it would mean you had to change the API for every time Microsoft chooses to change the document formats.
    But there are some open source tools that claim to be rather good at reading and writing MS Office files. Take a look at this one:
    http://jakarta.apache.org/poi/index.html

  • How to read clob data into a table

    Hi we have application which take oracle reports(10G)  xml  file as input and runs the report and save the output(csv,pdf) in a table.
    so i need some idea to impliment the follwoin task .
    I need to read the  content of the out file whcih in table stored in CLOB(I have not checked yet) column and store the data into another table .
    FYI: The out put  of the report will have 10+ different column.
    could Some please point me to the right direction  to acomplis h the task .
    Thnaks In Advance.Edited by: 852112 on Apr 13, 2011 10:47 AM

    Welcome to the forum.
    See:
    http://www.oracle-base.com/articles/8i/ImportClob.php
    http://www.oracle-base.com/articles/8i/ImportBlob.php

  • Reading decimal data into a string

    Hi,
    I am having an issue in converting the non char data like decimal into character.  Here is my code In the output I see '#' signs where I am supoose to get certain amount values in the decimal format. I require it because I need to download the data into a file. Any thoughts?  Rest of the code looks fine. Thanks in advance,
    VG
    field-symbols: <fs_table> type standard table,
                   <fs_wa>,
                   <fs_string>.
         CREATE DATA v_dref Type table of (v_tabname).
          assign v_dref->* TO <fs_table>.
          select * from (v_tabname) into table <fs_table>.
          loop at <fs_table> assigning <fs_wa>.
              assign component sy-index of structure <fs_wa> to <fs_string> casting type c.
              if sy-subrc = 0.
                write:/ <fs_string>.
             else.
               write: <fs_string>.
              endif.
            endloop.
    output:   10000100000001019999123120090101                                        ############0001

    @-Clemens - I tried your code , some problems with decimals values , adds a * in front.
    @Vinu - Just some rough modification to the code written by Clemens
    PARAMETERS:p_table TYPE tabname.
    DATA:wf_maximum TYPE i,
         wf_total_fields TYPE i,
         wi_count TYPE i,
         wf_ltype TYPE c,
         wf_length TYPE i,
         wi_index TYPE i.
    DATA:i_comp TYPE cl_abap_structdescr=>component_table,
          wa_comp LIKE LINE OF i_comp,
         wa_fields TYPE abap_compdescr.
    DATA:lr_data TYPE REF TO data,
         lr_line TYPE REF TO data,
         wf_data_str TYPE REF TO data,
         wf_type_struct TYPE REF TO cl_abap_structdescr.
    FIELD-SYMBOLS:<fs_table> TYPE STANDARD TABLE,
    <fs_wa>     TYPE ANY,
    <fs_line> TYPE ANY,
    <fs_field_s> TYPE ANY.
    CREATE DATA lr_data TYPE TABLE OF (p_table).
    ASSIGN lr_data->* TO <fs_table>.
    CREATE DATA lr_line LIKE LINE OF <fs_table>.
    ASSIGN lr_line->* TO <fs_line>.
    SELECT * FROM (p_table) INTO TABLE <fs_table> UP TO 20 ROWS.
    CLEAR:wf_ltype,wi_count.
    DESCRIBE FIELD <fs_line> TYPE       wf_ltype
                               COMPONENTS wi_count.
    LOOP AT <fs_table> ASSIGNING <fs_wa>.
      AT FIRST.
        wf_maximum = 0.
        wf_total_fields = wi_count.
        WHILE wi_count GT 0.
          wi_index = sy-index.
          ASSIGN COMPONENT wi_index OF STRUCTURE <fs_wa> TO <fs_field_s>.
          IF sy-subrc EQ 0.
            DESCRIBE FIELD <fs_field_s> TYPE          wf_ltype
                                        OUTPUT-LENGTH wf_length.
            IF wf_maximum LT wf_length.
              wf_maximum = wf_length.
            ENDIF.
          ENDIF.
          wi_count = wi_count - 1.
        ENDWHILE.
        CLEAR:wa_comp,i_comp[].
        wa_comp-name = 'FIELD'(005).
        wa_comp-type ?= cl_abap_elemdescr=>get_c( wf_maximum ).
        APPEND wa_comp TO i_comp.
        TRY.
            wf_type_struct =
            cl_abap_structdescr=>create( p_components = i_comp ).
          CATCH cx_sy_struct_creation.
        ENDTRY.
        CREATE DATA: wf_data_str TYPE HANDLE wf_type_struct.
        ASSIGN:wf_data_str->* TO <fs_line>.
      ENDAT.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> TO <fs_line>.
        IF sy-subrc = 0.
          WRITE <fs_line>.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ENDLOOP.

  • Reading html data & uploading a file in single html form using htp package

    Hi
    I have designed a html screen using htp package in which i have few text items and file upload button. I have to validate all forms data like text items and check box elements and upload file to unix. I am using java script for file validations and cgi script to upload file. With this I am able to either read form data or upload file but not both.
    At a time I want to insert a record to database with html form values and upload file to unix with htp package. Please suggest how can I read html form data + uploading a file to unix simultaneously in a single htp procedure.
    Thanks,
    Pradeep

    Have you ever considered using Application Express (APEX)?
    Oracle Application Express (APEX)
    Sounds like you're going the long way around to create a web based application.

  • How to read RMAN data into an ORACLE Table?

    Hallo,
    With regards to RMAN, how should we store the data into a database table, from the commands which can run only on RMAN prompt without using Recovery Catalog?
    For Example:
    RMAN> Report need backup days 3;
    RMAN DATA:
    RMAN-03022: compiling command: report
    Report of files whose recovery needs more than 3 days of archived logs
    File Days Name
    1 1203 D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF
    2 1203 D:\ORACLE\ORADATA\TEST\RBS01.DBF
    3 1203 D:\ORACLE\ORADATA\TEST\USERS01.DBF
    Should it done via UTL_FILE?
    If so, could someone give simple example/code how to do that, in order to write this RMAN data into an Oracle Database table?
    I also set the utl_file_dir parameter to a particular directory in my database.
    Thanks
    W.Benvort

    Actually, I am not using Recovery Catalog, so the views like RC_database, Rc_tablespaces etc , which are specific to recovery catalog are not available.
    r.- this make sense at 100% because those views belong to the recovery catalog.
    So, I wanted that these information, which we can get via using the commands like above, transfer into an Oracle table
    r.- If you want to access the views of the Recovery Catalog to store part of that information in tables you have to have the database registered in a Recovery Catalog.
    Should we keep the Recovery Catalog in Control file? Instead of using separate Schema.
    r.- I recommend you to create a catalog for your database because the space the controlfile to store information regarding RMAN is reused and you can lose important information about your backups.
    Can we run Catrman.sql script as a sys in order to keep the recovery catalog in sys schema?
    r.- As you know, this is not recommended at all.
    Conclusion : Create a Recovery Catalog and you will be able to perform all that you want regardind what you mentioned above.
    I have a thread for this:
    RMAN ( CATALOG CREATION ) STEP BY STEP by Joel Pérez
    Joel Pérez
    http://otn.oracle.com/experts

  • Reading controller data into LabVIEW through serial connections to controllers?

    I'd like to read data from environmental chamber controllers (System Plus) into LabVIEW through RS232 connections.  Has anyone done something similar?
    I see interfacing with the serial controllers as the biggest obstacle and although not directly related to LabVIEW programming, I'm hoping someone here can give me some advice or resources on how best to do so now days.
    My first thought is to write a program with VB or C++ to act as a terminal and write the data to a text file for LabVIEW to poll.  Aside from using Telix decades ago to work with BBSes, my only other serial experience consists of interfacing with a Kiethly multimeter using a C++ program. 
    I would rather not use multiple PCs but I have never worked with more than one serial port on a computer before in the past.  Perhaps LabVIEW itself already provides for multiple serial card communications (wouldn't that be perfect)?
    Any info would be great.
    Regards,
    Dave

    Thanks Dennis.
    I spoke with Envirotronics and they do not provide the driver for the System Plus controller any longer since there were issues with changing hardware and software.  Their IT department may be able to put something together for me.
    Using USB->RS232 connections would be nice given the abundant number of USB ports available on modern PCs.
    Without a driver I see parsing the serial text as a challenge in LabVIEW.  I know how to approach this with a traditional programming language but are there any examples around here of how this is done with LV (most recent version is fine)?
    Dave

  • How do i read form data into subject lines of email?

    I'm having a problem pulling form data and putting it in the subject line of my email.
    "mailto:[email protected]?subject=Formform form+ F_Name.rawValue + L_Name.rawValue";
    I thought this would read text fields from the form and print them in my subject line. Instead it tprints it without the data.
    I was wondering if someone could point me in the right directon on what i am doing wrong.
    Button2.event__click.submit.target  "mailto:[email protected]?subject=Formform form" + F_Name.rawValue + L_Name.rawValue;
    Button2.execEvent("click");
    Any help would be appreciated.
    jj
    Also if anyone would happen to know if there is a way to bypass the two email prompts and choose to directly send it using the users local email client would help or maybe its impossible.

    Button2.event__click.submit.target ="mailto:xxxxx.com?subject=FORM Form Form for " + topmostSubform.firstName.value;
    Can i use rawValue or value like this? Right after i put anything after those quotation marks that aren't more quotatin marks my button stops workin.

  • Streaming data to disk, need help reading data into Power Spectrum/O​ctave vi

    I'm streaming data to disk in one loop, however once this finishes I'd like to read the data into power spectrum vi/Octave analysis vi in another loop. The data from the read vi is a string and power spectrum vi needs 1d waveform. Does anyone have experience with this process?

    From your general description, I gather you are streaming to a text based file (comma or tab separated spreadsheet format) and would like to analyse this data with a power spectrum or octave analysis when you finish. Since you are streaming, I assume you have a lot of data. Do you have more than one channel?
    In any case, you have two simple options (and lots of complex ones). You can either read the data back from disk and convert it to a 1D array (try the Read From Spreadsheet File.vi - will get a 2D array, take the first column or the column of your choice if you have more than one channel) or you can use the Spreadsheet String to Array primitive to create an array from your text data before you save it to disk.
    If your data rate is slow enough, you can analyze as you acquire and store.
    Taking your data as text is very inefficient. What you really want to do is read the data as binary, use that for your analysis, and use something like the Write to Spreadsheet File.vi to save text data to disk.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Problem when cleaning HTML data in coldfusion

    Hi,
    I have below piece of CF code to clean&convert HTML data into a well formatted one.
    <cffunction name="cleanHTML" returntype="string">
         <cfargument name="sHTML" type="string" required="yes">
           <cfset sHTML = reReplace(sHTML, "\r\n(\S?)<br>\s*(<(u|o)l>)", "\1", "all")>
           <cfset sHTML = reReplace(sHTML, "</?(p)>(\s+| +)*(<br>(\s+| +)*)+$", "", "all")>
         <cfreturn sHTML>
    </cffunction>
    <cfquery name="getDetailsOfReport" datasource="datasource_name" >
    select details from reports where report_id = 1326065
    </cfquery>
    <cfoutput>#cleanHTML(getReport.details)#</cfoutput>
    Above code is working fine when getDetailsOfReport query is returning small amount of data, however fails when query returns large data.
    Note:
    Details column of REPORTS table is a clob field which contains html data.
    Can anybody assist me solving this issue?
    (OR)
    Please let me know the right procedure to clean HTML if I am on the wrong way.
    Thanks in advance,
    Best Regards,
    Manoz.

    Clean & Convert means,
    1) Remove new lines from html
    2) Remove breaks before lists eg <br><ol>
    3) Get rid of paragraph tags
    4) Get rid of trailing line breaks (including white space and forces spaces  
    The expected input is some HTML content
    eg:
    <ul>
        <li><span style="font-size: 7.5pt; font-family: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'">Tool measurement assessment in lab achieved.</span></li>
        <li><span style="font-size: 7.5pt; font-family: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'"><span style="font-size: 7.5pt; font-family: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'">1<sup>st</sup> coil tubing job.</span></span></li>
    </ul>
    And the expected output is also HTML content (But after applied above 4 operations to the given input).

  • Reading Unicode data from a file...

    I am writing an application that needs to read some configuration data from a file. An end user edits the configuration file to provide the configuration data. The Java code reads this file and uses the configuration data supplied by the user.
    The user can also save non-ascii characters as part of the configuration data. hence, I do not want to use java properties files. What are the other options available that allow me reading Unicode data into my Java code and will also allow user to save the configuration file as Unicode?

    Java characters are Unicode characters. Read file data that consists of Unicode characters as Java characters or strings.
    You can read the data as primitive char values using the DataInputStream class. The InputStreamReader class can also read Unicode (UTF-16) data.
    Data can be written using the OutputStreamWriter class.

  • Reading .txt file into char array, file not found error. (Basic IO)

    Iv been having some trouble with reading characters from a text file into a char array. I havnt been learning io for very long but i think im getting the hang of it. Reading and writing raw bytes
    and things like that. But i wanted to try using java.io.FileReader to read characters for a change and im having problems with file not found errors. here is the code.
    try
    File theFile = new File("Mr.DocumentReadMe.txt");
    String path = theFile.getCanonicalPath();
    FileReader readMe = new FileReader(path);
    char buffer[] = new char[(int)theFile.length()];
    int readData = 0;
    while(readData != -1)
    readData = readMe.read(buffer);
    jEditorPane1.setText(String.valueOf(buffer));
    catch(Exception e)
    JOptionPane.showMessageDialog(null, e,
    "Error!", JOptionPane.ERROR_MESSAGE);
    The error is: java.io.FileNotFoundException: C:\Users\Kaylan\Documents\NetBeansProjects\Mr.Document\dist\Mr.DocumentReadMe.txt (The system cannot find the file specified)
    The text file is saved in the projects dist folder. I have tried saving it elsewhere and get the same error with a different pathname.
    I can use JFileChooser to get a file and read it into a char array with no problem, why doesnt it work when i specify the path manually in the code?

    Well the file clearly isn't there. Maybe it has a .txt.txt extensionthat Windows is kindly hiding from you - check its Properties.
    But:
    String path = theFile.getCanonicalPath();
    FileReader readMe = new FileReader(path);You don't need all that. Just:
    FileReader readMe = new FileReader(theFile);And:
    char buffer[] = new char[(int)theFile.length()];You don't need a buffer the size of the file, this is bad practice. Use 8192 or whatever.
    while(readData != -1)
    readData = readMe.read(buffer);
    }That doesn't make sense. Read the data into the buffer and repeat until you get EOF? and do nothing with the contents of the buffer? The canonical read loop in Java goes like this:
    while ((count = in.read(buffer)) > 0)
      out.write(buffer, 0, count); // or do something else with buffer[0..count-1].
    jEditorPane1.setText(String.valueOf(buffer));Bzzt. That won't give you the content of 'buffer'. Use new String(buffer, 0, count) at least.

Maybe you are looking for

  • Heelllpppp!!!!! can i use someone else computer to charge my ipod

    I'm out of town and my ipod battery is dead. Can I use my nephew's computer, which equipped for a nano, to just charge my ipod. I don't want any of his songs and I surely don't want to erase.

  • To Define Business group in HRMS

    Hi, I am new to HRMS module. I like to know how to create a Business group If any one could share the "Oracle HRMS-The fundamantals" guide that would help me a lot Regards Ramesh Kumar S

  • MySAP ERP 2004 XSS

    Hi experts I have installed both the ESS and the MSS ITS based buissness packages. I have downloaded the new mysap ERP 2004 buissness packages those are based on Web dynpro and java. do i need to install the full ERP 2004 as a backend to deploy those

  • Plz help me with the font problem T_T

    Could you help me with this problem ? Here's my code : Font font = new Font("Arial", Font.BOLD, 12); Map fontAttributes = new HashMap(); fontAttributes.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_ULTRABOLD); font = font.deriveFont(fontAttributes);

  • AE 5.2 Configuration deletion.

    Hi All,    I deployed AE 5.2 couple of months ago and tried to configure the workflow. Then i realised that i messed up the configuration. Is there anyway i can delete all the configuration and start from scratch. I re-deployed the AE components, but