Help in creating a Java class to convert Html source to XML

He Everyone!
I am using selenium as my automation tool
I got the htmlsource of the page using selenium.
Now i have to write a Java class which will convert the data (html source)
(and output a data structure in standard XML format
Can anyone give me an example codejava class) in how to acheive this please?
Please mail to
[email protected]
Many thanks

getafix14 wrote:
Can anyone give me an example codejava class) in how to acheive this please?
Please mail to
[email protected]
Sorry Charlie, but this isn't a "mail me the codez" forum. Either use Google, or try to share your problem and their solutions in the forum. Besides, a little Googling will find you a solution.

Similar Messages

  • To create a java class in Web dynpro

    Hi,
    I want to create a java class which can be used in multiple views. Where will i create it and how will i access it?
    Can i create the class in Comp controller's imeplementation between "begin others"----
    "end"?
    Any help?
    regards,
    Sujesh

    Hi,
      If you create the class within the begin others"----
    "end" section, this class will not be accessible by any other class.
      You can create a class in
    Project/src/packages/<namespace>/<your component>/<create a new subdirectory>/Test.java.
    This will be accessible to all other classes. Just make sure the first line of your java file is the proper package declaration. So in this case the 1st line dhould be:
    package <namespace>.<your component>.<subdirectory name>;
    Regards,
    Satyajit.

  • I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF.   I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in th

    I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF. 
    I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in this regard is greatly appreciated.@

    You can achieve this using LiveCycle PDF Generator JAVA API. You can find required code here:
    Adobe LiveCycle * Quick Start (SOAP mode): Converting a Microsoft Word document to a PDF document using the Java API
    In parameters:
    //Set createPDF2 parameter values
    String adobePDFSettings = "Standard";
    String securitySettings = "No Security";
    String fileTypeSettings = "Standard OCR";
    "Standard OCR" file type setting will run OCR on input pdf. In the code, instead of doc file provide a pdf file. Resultant pdf will be searchable PDF i.e OCRed PDF.
    Feel feel to ask any further questions.

  • How to create custom java class in Content Server

    Hi All,
    I want to develop a custom java class (.class) file and upload in the UCM(Stellent Content Server). The problem is that I have to use some objects like DataResultSet, SharedObjects etc in my java class file. Since these class files resides in the Content Server I am not able to create a custom java class with these objects.
    Can any one help me to solve the above issue
    With thanks and regards
    Mohan

    Hey there,
    All of the core content server class files are included in a single jar file. This jar is in one of 2 places in the 10gr3 version of UCM:
    1. If you have an unpatched content server include $IntradocDir/shared/classes/server.zip in your classpath
    2. If you have a patched content server include $IntradocDir/custom/CS10gR35CoreUpdate/classes.jar in your classpath.
    In UCM 11g the jar file is located in %MIDDLEWARE_HOME%/Oracle_ECM1/ucm/idc/jlib/idcserver.jar
    P.S. Venkat is correct, post UCM specific questions in the ECM forum.
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw_OTN_WCS >

  • Create Standalone JAVA ClASS

    HI All,
    Can anyone help me out to create a stand-alone java classs??
    (It will call EJB Method).
    more Insight:
    We have developed one service. It is working fine in RAD 7.0. No issues in that. But as per requirements, We have to check that application as stand-alone class. we are trying to call stand alone Java class using command prompt and see if EJB gets invoked which is running on the WAS server?
    Is there any way ?

    Can anybody relook on my issue?
    HI All,
    Can anyone help me out to create a stand-alone java classs??
    (It will call EJB Method).
    more Insight:
    We have developed one service. It is working fine in RAD 7.0. No issues in that. But as per requirements, We have to check that application as stand-alone class. we are trying to call stand alone Java class using command prompt and see if EJB gets invoked which is running on the WAS server?
    Is there any way ?

  • Problems Creating a Java Class using a webservice with certificate

    hi,
    i'm developing a java class that call's a webservice that needs a certificate, i'm not used to work with java, last time was 10 years ago, so i'm having some troubles because of the certificate.
    I already add the certificate using java control panel > Security > Certificates. When testing i get the following error: IOException (java.io.IOException: subject key, Unknown key spec)
    I think I need to define the certificate in my class, but i'm having a lots of trouble with the samples that i found over the internet, nothing works and i'm running out of time.
    This is my Class
    create or replace and compile java source named "FishInfoAt" as
    import java.net.*;
    import java.io.*;
    import java.security.*;
    public class FishInfoAt
         public FishInfoAt()
         public static String send(String urlfishinfoat, String mensagem, String mensagem1, String mensagem2, String mensagem3)
              // Init
              String response = "";
              String msgtotal = mensagem+mensagem1+mensagem2+mensagem3;
              String a = "";
              HttpURLConnection conn = null;
              try{
                   URL url = new URL(urlfishinfoat);
                   conn = (HttpURLConnection) url.openConnection();
                   conn.setRequestMethod("POST");
                   conn.setRequestProperty("Content-type", "text/xml; charset=utf-8");
                   conn.setRequestProperty("SOAPAction", "https://servicos.portaldasfinancas.gov.pt:401/sgdtws/documentosTransporte/");
                   conn.setRequestProperty("Content-Length","" + msgtotal.length());
                   conn.setDoOutput(true);
                   conn.setDoInput(true);
                   conn.connect();
                   OutputStream out = conn.getOutputStream();
                   out.write(msgtotal.getBytes());
                   out.flush();
                   InputStream in = conn.getInputStream();
                   int value;
                   while( (value = in.read()) != -1)
                        response+=(char)value;
              catch(Exception e)
    response = ("*** ERROR - IOException (" + e.getMessage() + a + ")");
    return response;
    /

    Hi Deepak,
    Could you please let us know upto which line your code is going safe. Try printing the value in the structure before you send that to the method GetUGEntity().
    I am not too sure that would be a problem. But I have faced a problem like this, wherein I tried to access a structure for which I have not allocated memory and hence got exception because of that.
    Since your JNI code seems to be error free, I got doubt on your C part. Sorry.
    Dhamo.

  • Is there a way to create a Java class based on what's defined in a schema?

    I have a set of schemas that define what messages I will get as an XML stream (sent as UDP packets). Is there a way to parse the schemas into a set of java classes that match the fields in the schema? If so, next think would be to feed a string or byte array to instances of these objects and have a method that parses it and fills all the fields. But is the first part possible? Somebody linked http://www.cafeconleche.org/books/xmljava/chapters/ in another thread, but that seems to be for regular XML, not schema, unless I'm confused which is entirely possible, I'm new to XML and using it in Java in this way.

    For future reference, [Java API for XML Binding|http://www.dummies.com/WileyCDA/DummiesArticle/Building-Custom-Code-with-Java-API-for-XML-Binding-JAXB-.id-1489,subcat-BUILDING.html] (JAXB) allows for [generation of Java classes|http://www.oracle.com/technology/pub/articles/marx-jse6.html] from XML Schema (or even DTD) using its xjc compiler.

  • Legalities of modifying open source Java classes in a closed source App

    If there is a better forum for this thread please let me know. I looked and looked and couldn't find any place where it seemed to fit.
    Simply put, I want to know the legal ramifications of modifying open source Java classes which have been included in a commercial closed source application.
    The specifics are my problem with the javax.servlet.http.Cookie classes interpretation with RFC 2019 in regards to acceptable cookie names. I currently am debating that in a thread here:
    http://forums.sun.com/thread.jspa?threadID=5313146
    I am using Adobe ColdFusion which is a J2EE application server running as a servlet in Macromedia JRun. JRun parses request headers and creates instances of the javax.servlet.http.Cookie class for each cookie. (An error is thrown from the constructor if the cookie name is not accepted)
    I was able to work around the problem by modifying the code in the Cookie class, compiling it, and using jar.exe util in my SDK to update the new class into the jrun.jar file. I blogged it here:
    http://www.codersrevolution.com/index.cfm/2008/7/15/No-Cookie-For-You-Second-Solution
    My problem is I'm not sure if what I did conforms to the license for ColdFusion. Technically JRun is a closed source program I am not allowed to modify, but all I changed was a open source class from Sun. I didn't even need to decompile anything.
    I have Googled in vain, but I can't seem to find any information that applies to modifying pieces of open sourced code contained inside of a closed source application.

    bdw429s wrote:
    "I thought it was straightforward and I didn't feel that lawyers were necessary. But you didn't seem to want to do that."
    I'm unclear on whether you are implying that I didn't want to hire a lawyer or that I didn't want to read the licenses myself and make a decision. If you meant the former, you're darn right. I'm not paying anyone a dime to satisfy my personal acedemic curiosity concerning a random project I've been messing with in my spare time that isn't related to to any job or business decision. I'm simply looking for information because that's I do when I don't understand how something works. First, I Google the hell out of it and if I can't turn up satisfactory answers (or any at all) I find an applicable forum and ask there.
    If you were implying the latter (that I didn't want to read the licenses myself) then you haven't been reading my posts. I stated to jschell that I have no problem attempting to figure out a license agreement on my own. In fact, I have read the ColdFusion agreement from Adobe before posting here. I talks about modifying the software, but I still don't think it is crystal clear about whether third part code falls under it's own license AND Adobie's or just its own license. Then that is the point at which you must do one of the following
    1. Consult a lawyer.
    2. Decide to allow for a liberal interpretation (thus you can use the code) and understand that you personally are liable if your interpretation is wrong.
    3. Decide to allow for a conservative intepretation to avoid liable on your part.
    Regardless of what anyone says here it won't remove your own liability.
    >
    The source for the java.servlet.http.Cookie class stated that it is release under the Apache license 2.0 whcih I read up on. I will admit I'm not actually sure how to tell the exact verison of the Java Servlet API classes that JRun is built on other than to cross reference which version of the servlet API came out with which version of Java, but that is a suspect method. I have been programming for more than 8 years, but I'm relatively new to the Java landscape.
    I'm not looking for handouts here. I know this was a tough subject and I was prepared for NO ONE to respond and I would have been ok with that. I have no problems making decisions on my own and I have no intention of passing the buck to anybody.
    Here's the thing though. A useful response is one that states some facts (or opinions), references a similar peice of software for comparison, a court case, or provides a few links to some open source-type websites were I might find more information about my issue.
    Telling me to hire a lawyer and chastising me for "pass the buck" is doing about as much good as Linux snobs telling people to RTFM.
    Wrong.
    A lawyer is the best and most correct answer.
    And it is the first answer that should always be given with these sorts of questions.
    If you choose not to accept the best and most correct answer then that is up to you.
    I understand that a large number of people on public forums are lazy sponges who wish someone would just post all the code they need, but assure you I am not that person. I'll admit I don't know much about open source and I'm not sure where to start looking since I seem to have a scenario which is not really discussed much on the web. All I am looking for is information and sincere help.And presumably you also understand that we certainly can't give you legal advice but also it would be foolhardy for you to accept it as well.
    You learn by reading many license agreements and reading as much about legal situations involving computers and related technical cases as you can.
    And until you are comfortable making such decisions yourself without asking then the only useful answer is ask a lawyer.

  • Java code for converting EDI file to XML file

    Dear friends,
                     Can you please help me in getting the java code for converting to EDI file to XML file.

    Hi,
    You can convert the EDI file to XML in any of the ways
    1) Using third party seeburger adapters
    2) Conversion agent
    3) Stylus studio.
    I think using java code it will be very difficult.
    Thnx
    Chirag

  • Java app to save html source and copy to clipboard

    I'm new to Java, and I'm doing a research paper which requires gathering data from the internet. I basically need to learn commands to create an app (which I will execute on a daily basis using Windows scheduler) to do the following task:
    1. Access a specific URL
    2. Save the HTML source as a text file
    3. Copy some of the text in the saved text file to the clipboard in Windows
    4. Paste this data in Excel
    5. Run a macro in Excel to sort the data
    I know enough VBA and Excel functions to parce the data, but if it is easier to use Java to sort the data into columns and rows in Excel, I would like to learn how to do that too.
    I'm running Windows XP. My friend tells me to download Dr. Java to edit .java files and also the SDK to compile the files. He also told me to find modules from the internet which I can use, but I'm not sure how to go about it. (I tried searching on the net but didn't get the hits I wanted.)
    Any help at this point would be much appreciated.

    If your target html is so fancy and complicated(table cell contain another table) or the table miss some <tr> or <td> tags, dividing the table into rows and column can be a difficult task.
    I recommend you choose the website with high download speed. Otherwise, you have to write more code to handle any loading failure.
    I recommend you use httpunit to get webpage with Java program. (There is usually proxy server in University, you can config the parameter for proxy server in the Java program calling httpunit)
    http://httpunit.sourceforge.net/
    It will take some times to learn those Java technique.

  • Convert HTML to Cisco XML

    Hi all.
    I've got a new challenge: display information of webpage on a Cisco IP Phone. So I need to convert plain HTML to a kind of plain (cisco xml) text and display it on the phones.
    Does anyone knows how to do this?
    Any help or sugestions are welcome!!
    Thanks in advance

    If the HTML is actually XHTML, then you can use an XSL stylesheet to convery XHTML (which is really XML) to XML (Cisco XML that phones understand).
    If the web site provides an RSS feed, another option is to use a RSS reader to read RSS and convert it to Cisco XML.

  • How can convert HTML file into xml file?

    Hi,
    I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard.
    Regards,
    mahesh.

    Use the HTMLEditorKit to parse the html file.
    this kit is having the callback methods which
    are called wenever the tag appears in the HTML
    stream.

  • Need help in creating a java program

    Hi everyone.
    I'd like to say before i start about my problem, that i've only begun learning java and my teacher hasn't explained anything at all. He only showed us by doing it himself and then showing us the final version. I've searched a little on how to program but i get little success in finding a good tutorial.
    I need help creating a program which has been assigned to me due in a few days in which i can't contact my teacher for help.
    I need to write a java program which inputs 3 items. The number of kilometres you drove, the number of litres of gas you used and the price you paid for the gas. Then, the program must calculate the number of litres used per 100km driven, which is litres divided by kilometres times 100, how much it costs to drive 100km, which is the result (a) times the price per litre and the number of miles per American gallon of gas ( one American gallon = 3.785 litres, and one mile = 1.609 km.
    The program has to output my name, the inputs given, the results computed and a message saying "Program Complete".
    To give you what i've done to begin with, from what i understood, is:
    import javax.swing.JOptionPane;
    public class prog1
         public static void main(String args[])
              final double americanGallon = 3.785;
              final double mile = 1.609;
              kilometresDriven,
              gasUsed;
              priceOfLiterGas;
              System.out.println("My Name");
              System.out.println("Number of kilometres driven:");
              kilometresDriven = JOptionPane.showInputDialog ("Kilometres Driven");
              System.out.println("Number of Litres of gas used:");
              gasUsed = JOptionPane.showInputDialog ("Litres of gas used");
              System.out.println("Price of a liter of gas:");
              priceOfLiterGas = JoptionPane.showInputDialog("Price per liter");
    Up to now, that's all i've got. i know i'm wrong, but i'm not sure how to do this. Could someone give me an outline of what this program is suppose to look like?
    Thanks in advance.

    Here's an update on my program. I've worked on certain details and would need your comments whether it contains errors. I'd also want to know if it would work or not because i don't know how to check it on my computer.
    Here's the update:
    import javax.swing.JOptionPane;
    public class Prog1
    public static void main(String args[])
    String name;
    double kmDriven;
    double litresUsed;
    double pricePaidForGas;
    double priceOfALiter;
    name = JOptionPane.showInputDialog("Name");
    input = JOptionPane.showInputDialog("Number of km driven");
    kmDriven = Double.parseDouble (input);
    input = JOptionPane.showInputDialog("Number of litres of gas used");
    litresUsed = Double.parseDouble (input);
    input = JOptionPane.showInputDialog("Price paid for gas");
    pricePaidForGas = Double.parseDouble (input);
    input = JOptionPane.showInputDialog("Price of a litre of gas");
    priceOfALiter = Double.parseDouble (input);
    a = (litresUsed/kmDriven)*100;
    b = ((litresUsed/kmDriven)*100)*priceOfALiter);
    c = (kmDriven/1.609)
    System.out.println("Name:" + name);
    System.out.println("Number of litres used per 100km:" + a);
    System.out.println("Cost of driving 100km" + b);
    System.out.println("Number of miles per American Gallon of Gas:" + c);
    System.out.println("Program Complete");
    System.exit(0);
    Comments please.
    Thanks in advance

  • Help - sharing bean between java classes

    Hello,
    I have a java application that has a bean named drBean;
    I have a login class and a menu class
    The login class validates the user and populates the drBean, it then disposes the login form.
    The menu form shows null for the drBean
    How do I code a Bean to share between application forms?
    Thanks
    Frank

    I think I got this working.
    I was trying to create a bean in form 1 and reference it in form2
    All I had to do was create a class that had static variables.
    No need to do myclass p = new myclass()
    just reference the variable by the class name like myclass.name = "Frank"
    Thanks
    Frank

  • Not able to create a java class included in custom jar from script

    Hi,
    We need to call a third-party web service from within SAP Sourcing and so we have created and deployed a custom JAR. However I am not able to create any of the custom classes included in this object. I have created a simple JAR file having just a "Hello World" message and got our BASIS team to deploy this (they deployed using the steps mentioned in Installation Guide Section 4.2.4 - we are using Sourcing Wave 9). I have added the required import statement in my test script and included this line:
    HelloWorld test = new HelloWorld();
    When this script executes, it gives the error:
    Class:HelloWorld not found in namespace.
    Can you please give your suggestions on how to fix this error?
    Thanks,
    Gayathri

    The issue was fixed after including the custom jar in esourcing90/lib folder and redeploying

Maybe you are looking for