Create a new HTML file by changing attributes

Hello, I am going to add some attributes to create a new html file.
Such as
<div id="globalWrapper">becomes
<div id="globalWrapper" style=...>I have completed partial task, but I have trouble on how to save it to a new file.
Please look at my code.
import java.awt.Point;
import java.io.*;
import java.util.*;
import javax.swing.text.EditorKit;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction;
import javax.swing.text.html.parser.ParserDelegator;
public class ReadTest extends HTMLEditorKit.ParserCallback
     public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos){
         if     (
                     (t == HTML.Tag.BR)   ||
                     (t == HTML.Tag.DIV)  ||
                     (t == HTML.Tag.P)    ||
                     (t == HTML.Tag.UL)   ||
                     (t == HTML.Tag.UL)   ||
                     (t == HTML.Tag.DD)   ||
                     (t == HTML.Tag.BR)   ||
                     (t == HTML.Tag.H1)   ||
                     (t == HTML.Tag.H2)   ||
                     (t == HTML.Tag.H3)   ||
                     (t == HTML.Tag.H4)   ||
                     (t == HTML.Tag.H5)   ||
                     (t == HTML.Tag.H6)  
         a.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED,"style=");// right or wrong? Then what?
         System.out.println(a);
    public static void main(String argv[]) {
    try {
        Reader r = new FileReader("C:/test.html");
        ParserDelegator parser = new ParserDelegator();
        HTMLEditorKit.ParserCallback callback = new ReadTest();
        parser.parse(r, callback, true);
        EditorKit kit=new HTMLEditorKit();                       
        HTMLDocument doc=(HTMLDocument)kit.createDefaultDocument();  
  } catch (IOException e) {
        e.printStackTrace();
}Thanks

The first two concerns are the source footage and then the Project/Sequence Preset.
What are these? This answer will direct others on how they suggest that you proceed.
For OOS issues, having your source footage in the proper format will go a long way to solving such issues. For "fixing" OOS, this ARTICLE might be useful.
Good luck,
Hunt

Similar Messages

  • When I open iTunes, I get a message that "iTunes has stopped working".  I've tried reinstalling itunes, creating a new user file, changing the startup programs, and am having no success in getting iTunes to stay open. Any "fixes" for this problem?

    When I open ITunes, I get a message that "iTunes has stopped working".  I have tried reinstalling iTunes, creating a new user file, changing the startup programs in accordance with articles in iTunes troubleshooting, but am having no success in getting iTunes to stay open.  Any fixes for this problem?

     

  • Creating a new HTML document - removing "todos"

    When creating a new HTML document in a KM repository (i.e. Folder > New > HTML File...), I get a form where I name my HTML document and enter the content etc. I can also choose, from a dropdown box, the document type between a Normal document or a "todos". My questions are the following:
    1) What is "todos" in this case? (I don't think it means "To Do's".)
    2) As a portal admin, how can I remove "todos" from the dropdown box or disable the dropdown box completely.
    Thank you

    Hi Mick,
    sorry, quite late, but better than never
    > how can I remove "todos" from the dropdown box or
    > disable the dropdown box completely.
    System Administration - System Configuration - KM - Configuration - CM - Global Services - Resource Types - Delete "todos".
    > What is "todos" in this case?
    > (I don't think it means "To Do's".)
    I think that in fact some SAP developer wanted to mark this place that there would be more work to be done (Resource Types to be defined or so).
    Hope it helps
    Detlev

  • Create a new password file

    Please, how do I Create a new password file.
    i am trying to change dbid of my database, Do I need to delete the old password file, and create a new one by using the orapwd utility, or does orapwd utility overwrite the old one, thanks.

    You do not have to delete the old password file. No, you have to:
    test$ ls orapw*
    orapwGX
    test$ pwd
    /opt/oracle/Ora10gR2/dbs
    test$ orapwd file=/opt/oracle/Ora10gR2/dbs/orapwGX entries=5 password=none
    OPW-00005: File with same name exists - please delete or renameYoann.

  • How to create a New Excel File programmatically

    Hi !
    I am documenting acquired data continuously in an excel file, what I need to do is to create a new excel file automatically when the size of the previous file exceeds a certain limit lets say 1MB.
    I have tried using the simple 'Create/Open File' function and the 'Write to Spreadsheet File' function to create the new excel file. I does create a file but when I open the file it says the format of the file is not what you have opened it with.
    Also when the new file is created, three new worksheet are to be added programmatically with pre-defined worksheet name and also Column headers for each of the worksheet are to be added.
    I am also using 'Labview Report Generation Toolkit for Office'.
    Regards,
    Reeves
    Solved!
    Go to Solution.

    @ Aldo A
    Thanks for the reference to tutorial, I didn't know about them. They are useful in general but unfortunately they don't answer the problem of creating an altogether new excel file programmatically.
    @ ben64
    The template thing simplifies the issue of formatting the new file. But I am still working on the new excel file creation challenge.
    Let me put my problem in a different way.
    Certain data is being acquired continually and is being written to a certain excel file, when the size of the file exceeds lets say 1MB the program should start saving the data in a NEW FILE instead of the previous file.
    I have attached the VI to explain what I am trying to achieve here.
    Reeves
    Attachments:
    New Microsoft Office Excel Worksheet.zip ‏30 KB

  • Help with creating a new XML file from an existing DOM tree!!

    i want to create a new XML file from an existing DOM tree
    i used this code to create a new document:
    static public Document createDocument(String fileName) throws ParserConfigurationException//,IOException,SAXException
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setIgnoringComments(true);
                   factory.setIgnoringElementContentWhitespace(true);
                   factory.setValidating(true);
                   DocumentBuilder builder =factory.newDocumentBuilder();
                   return builder.newDocument();
    //          handle exception creating DocumentBuilder
              catch ( ParserConfigurationException parserError ) {
                        throw new ParserConfigurationException();
              }then i used this code to transform the DOM :
    public void exportDocument(Document document) {
              try {
                   Source xmlSource = new DOMSource( document );
                   Result result = new StreamResult( System.out );
                   TransformerFactory transformerFactory =
                        TransformerFactory.newInstance();
                   Transformer transformer =transformerFactory.newTransformer();
                   transformer.setOutputProperty( "indent", "yes" );
                   transformer.transform( xmlSource, result );
           //then catching the exceptions
    But the file was not created and i didn't find where can i specify the DTD that the XML file should use and where can i enter the name of the XML file itself
    Another questoin can i write a DTD file dynamically during the execution of the program??

    Cross-post: http://forum.java.sun.com/thread.jspa?threadID=784467&messageID=4459240#4459240

  • Java code to create a new .txt file in FTP server  --- Help

    Hi,
    I wrote a standalone java app which creates a .txt file in my local machine and transfers it to FTP server. But my requirement now is to create a new .txt file with the same content in FTP server itself instead of creating locally with basic java code.
    I'm aware of transfering file from local machine to the FTP server using STOR command of FTP. But i never tried creating a new file & writing content into that in FTP server.
    So, if any one did this before please help me out with source code or any idea ???
    Thank you.
    Vj.

    simply_vijay wrote:
    thanks for your reply. yes i've seen the Apache Commons NET API , but there is no method or class to create a new file in FTP server. I'm really worried how to solve this problem ???Sure there is.
    There's a method where you can write data to a file on the server using an OutputStream, right? Well, instead of writing to a FileOutputStream, write to that OutputStream instead. Remember to close the OutputStream and call the method which says you're finished with the command (I forget what it's called).

  • How to create a New Tranport Request for changed  Extract structure

    How to create a New Tranport Request for changed  Extract structure ?
    Hi Experts,
    I have a FI AP Generic Datasource containing extract structure with appended fields.
    It has already been activated and transported to Testing System.
    Now, I am to create a new transport request for this DataSource and Extract structure.
    I do not want to delete and recreate the Generic Datasource.
    I am trying to look at the options in the extract structure top menu from where I can create a new Tranport Request.
    Please let me know the steps
    URGENT

    Hi Dev,
    Once you send the transport request for any data source from Dev to Testing you wont find that again in your Dev (I mean the TR). So, when you change anything for this data source or view now in Dev and try to save it, it will ask for a new transport request and here you can mention a new one starting from View then activate it and go to RSO2 regenerate it and use the same transport request for this too. When you transport this TR to Testing Environment the data source will automatically get changed.
    Hope it helps...

  • Is it possible to open a new Worksheet without creating a new *.sql file

    Hello Community,
    Declaimer: It may be a trivial question. I just willing to make SQL Developer my default day to day tool.
    I is possible to open a new Worksheet without creating a new *.sql file. Like in an MS Word. If I just need some space to write something and than destroy the file without saying. I can quickly click < ctrl + N > and get the space.
    In SQL Developer to get a new "space"/work sheet i
    -a- < ctrl + N >
    -b- choose "SQL File"
    -c- confirm default location
    -d- choose the connection to be used (right top conner)
    This process is way to long for getting a new sheet to put write an SQL.
    Can you suggest a better way to get a workspace with current connection assigned in no time (like in MS Word)?
    Please ;)
    Yury

    There is no need to create new .sql file.
    I don't know why you need new SQL Worksheet when you can simply do the space by pressing Enter, but you can open a new one from Tools -> SQL Worksheet. There is also a toolbar button for this.

  • How to create a new txt file on the hard disk?

    Which method in which class should I use?

    there are documantatiosn and tutorials :
    createNewFile :
    "Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. The check for the existence of the file and the creation of the file if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the file. This method, in combination with the deleteOnExit() method, can therefore serve as the basis for a simple but reliable cooperative file-locking protocol.
    Returns:
    true if the named file does not exist and was successfully created; false if the named file already exists"

  • Create a new trace-file

    hello together,
    i have a question according to creation of new user trace files in user_dump_dest:
    with the following command:
    EXEC dbms_system.set_sql_trace_in_session(18,628,TRUE);
    I created a new file in the trace directory.
    Then I stopped the tracing with:
    EXEC dbms_system.set_sql_trace_in_session(18,628,FALSE);
    I disconnected with the traced session sid=18 and connected once again.
    With retracing the session I didn't get a new trace file but the existing trace file was actualized.
    => what do I have to do to achive a new trace file for the second session-tracing?
    Thanks and Regards
    Stefan

    Hello Maran,
    I only want to trace one session; but I want to create a new trace file for the second run when tracing; but at the moment the first trace file will be continued...
    thanks

  • Create a new video file by editing & clipping old video?......Premiere CS4

    How do I take an existing video file (.wav, .mpeg, etc...) & delete unwanted footage to create a new video file? I currently have some video footage of my family but the sound & video dont play synced togather in Premiere? Any suggestions......?

    The first two concerns are the source footage and then the Project/Sequence Preset.
    What are these? This answer will direct others on how they suggest that you proceed.
    For OOS issues, having your source footage in the proper format will go a long way to solving such issues. For "fixing" OOS, this ARTICLE might be useful.
    Good luck,
    Hunt

  • Create a new log file every hour

    I have a program which receives measurement data and writes this data to TDMS file. However, I want to create a new TDMS file every hour. When I put a while loop in mu sub vi which creates the new file the program doesn't run. I have attached the sub vi. Can anyone help me out here?
    Cheers
    Attachments:
    ConfigTDMS (SubVI)_loopTDMS.vi ‏16 KB

    One trick for doing this is to prepend the file name with YYJJJHH See example
    Then just check if file exists (if not create and add headder) when you write to file.
    This also generates the reports in "alphabetical" order so windows explorer presents them chronologically.
    Jeff

  • How to create a new excel file using Excel Destination when Destination file not exists.

    how to create a new excel file using Excel Destination when Destination file not exists.

    Just need to set an expression for excel connectionstring and set delay validation to true and it will create it on the fly.
    The expression should return the full path with dynamic filename in each case.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to Create a New Admin Account and Change Original to Standard Account?

    I have a single user admin account that I set up when I got my PowerBook. Now I want to have two accounts with the new one being the admin account. This way I can leave most of the data files, email accounts, etc. with the old account and use the new one for personal data and admininistration. Then I could give out the password for the original account without fear that a user could change permissions and get access to the new account with the personal data. Can I create a new admin account and then change the original account to "Standard" instead of "admin"? What problems will this create?
    PowerBook G4   Mac OS X (10.3.9)  

    i2:
    Not sure if you are asking if or how. Templeton has
    answered if. Here's how.
    Apple Menu > System Prefs > Accounts. Click on the +
    under User Options to create new account. Go to
    Security and check box at bottom to make account
    admin. You can take care of the other items, picture
    etc, login options etc.
    To make the other account Standard select the
    account, go to Security and deselect box "Allow User
    to Administer".
    Hope this answers your questions.
    Good luck.
    cornelius
    PismoG4 550,
    100GB 5400 Toshiba internal, 1 GB RAM; Pismo 500 OS
    (10.4.4)   Mac OS X (10.3.9)   Beige G3 OS
    8.6
    Thanks, I'm tying to find out if I will run into problems, such as not being able to use the new admin account to change permissions in the old.

Maybe you are looking for

  • Standard Aging report for FI

    Hi,   Can anyone give me the Standard Aging report or tcodes for FI..Its very urgent.. Thanks

  • Any software can see the e-mail attachment with *.doc and also *.tif

    Seem Iphone itself cannot open *.doc, *.tif, need to download software from Applie store, but cannot find, anyone can help

  • How can i score music in garageband

    When I click the scissors and bring up the score part, I try to enter notes onto the sheet music, but it wont work. I've clicked cmd and click but that doesnt work either.  I've looked on Youtube but no one shows how to do this! I just want to write

  • Supplementary invoice

    We are creating  a supplementary invoce using VFRB. In the procedure we have PDIF condiition type which is the differential value + Excise duty + Cess + Additional Cess.  We are using the condition type JEx3 for separating the excise duty + cess + ad

  • Batch Publishing in CC (No Project Panel)

    I have a project with approximately 600 seperate FLA assets (in CC format). I need to do a batch publish of these assets. Since the project panel has been deprecated in CC, anyone have any suggestions of how to accomplish this?