Java and XML . PLEASE help

Hi,
I am using a SAX Parser to create XML documnets on the fly
I am creating an xml document with some elements
<name> userName </name>
<pwd> pwd </pwd>
Is there any class which can be used to create tag names
like CreateTag("name") and endTag();
which will create <name> </name>

wouldn't be hard to write a method to do that:
public String createTag(String tag) {
  StringBuffer buffer = new StringBuffer();
  buffer.append("<").append(name).append(">");
  return buffer.toString();
}

Similar Messages

  • Java with xml please help me :(

    Hi,
    I need to design a Jva GUI interface where when an action is triggered the event will
    first look at some pattern(rules) defined in a XML file before been fired. I have no
    idea of how the communication is going to be established . I have never used xml in the past.
    Any help will be very very appreciated!
    Thank You

    Hello,
    Try to download Jaxp-1.1, U will get 3 JAR files - xalan.jar, crimson.jar and jaxp.jar.Set the classpath to this jar files. U will find the ZIP files in http://java.sun.com/xml/jaxp-1.1/docs/api, Iam not sure about the URl.Still need any help mail me to [email protected]
    Thanx

  • Java and C please help !!

    Hi all.
    I am looking for a fix for a process problem.
    i have a c program that prints "hello world", then waits for getch( ); then prints "goodbye".
    in my java program, i use.....
    Process cp = Runtime.getRuntime().exec("filename.exe");
    OutputSream in = new BufferedOutputStream (cp.getOutputStream( ));
    in.write('a');
    the line above doesnt seem to supple the keystroke that the c program requires .
    can anybody help ???
    thanks
    Paul

    And since your in variable is an OutputStream, there is not really any reason to create a BufferedOutputStream, just apply cp.getOutputStream directly or make in an BufferedOutputStream.

  • JAVA-XML Please Help

    Hello All,
    I'm somewhat new to Java and XML and I'm having this problem:
    I have an program that does an HTTP Post and gets back an XML response. I'm trying to parse the response. I'm completely lost I think, and I apologize for my utter stupidity or if I haven't provided enough information. What follows is a snippet of code and the error message I'm getting:
    //conn is my Http connection
    // get the results
         conn.connect(); // throws IOException
         int responseCode = conn.getResponseCode(); // 200, 404, etc
         String responseMsg = conn.getResponseMessage(); // OK, Forbidden, etc
    // Read the response XML document
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    org.xml.sax.ContentHandler handler = new DefaultHandler();
    parser.setContentHandler(handler);
    InputStream in = conn.getInputStream();
    InputSource source = new InputSource(in);
    parser.parse(source);
    in.close();
    conn.disconnect();
    Error Message:
    org.xml.sax.SAXParseException: The root element is required in a well-formed document.
    I think my problem is here but I'm not sure:
    org.xml.sax.ContentHandler handler = new DefaultHandler();
    Thanks for all of your help,
    Lance

    hi
    i think u should first read the file using JFlieChooseran d grt the file likr this:::::::
    public File getXMLFileChooser()
         //Create a file chooser
         fc     = new JFileChooser();
         String type[] = new String[] {"xml"};
         fc.addChoosableFileFilter(new MyFileFilter(type,"XML Files(*.xml)"));
    fc.setMultiSelectionEnabled(false);
    int returnVal = fc.showOpenDialog(XMLFileChooser.this);
         if (returnVal == JFileChooser.APPROVE_OPTION)
         file     =fc.getSelectedFile();
              return file;
    ///now this file is to be read using BufferedReader & FileInputStream
         File file;
         FileInputStream fis;
    BufferedReader bdr=null;
    String record=null;
    FileInputStream fis = new FileInputStream(file);
    bdr= new BufferedReader(new InputStreamReader(fis));
    while ( (record=bdr.readLine()) != null )
    ParseFile(record);//in this method u can parse the file
    if it something u want i can help u more....
    cheers||||

  • Java and XML or XHTML Journey Planner Project

    Hello chaps,
    I need some help with a project I am doing.
    This project will be focusing on the area of information visualisation and the phenomena surrounding how data can be optimised in a confined space. Expanding on this, confined space can be a mobile phone screen, and personal organisers where information is shown in a limited area.
    I plan to use Java and XML. (or XHTML)
    I want to have a running application where raw data is transformed into a combination of graphics and information. To achieve this, I will be looking at route planning for mobile phones and how route instructions can be represented in a visual but a sophisticated way.
    My focus will be on the London transport.
    Here is a link to the London transport journey planner
    http://www.tfl.gov.uk/journeyplanner
    Using WAP, I surfed the website on my phone and there seems to be a lot of writing and there is a lot to process before understanding what is going on. I want to transform words into pictures e.g., the word underground or bus into a logo of a red bus or underground logo or Instead of ?walk?, a picture of a walking pedestrian. Picture are good connotations as we can easily recognise rather than processing words. I would also like to represent the time taken in a graph format, again, to easily visualise.
    The application can be on a phone or on Windows simulating a mobile phone.
    Can anyone help me with this mammoth task or at least point me out in the correct direction?
    Looking forward to your reply.

    1st, ) Raw Data e.g, journey time, journey distance
    2nd, ) I would want the system to recognise the 'raw data' mentioned before and transform this into graphical image(s).
    3rd ) a complete visualisation would look like,
    modes of transport represented by pics or logos, showing the time to get to from A to B.
    Showing various routes, eg, walking, and/or bus and/or tube

  • Java and xml option necessary?

    Hi,
    first when i build the repository database, i choose java and xml option, is this necessary or i waste my time.
    When i read Building a Help Desk Connector, i'm not sure, do i need the Diagnostic Pack.
    Best regards
    Thomas
    (Narri, Narro)

    This is the defacto site for xpath stuff for java
    http://xml.apache.org/xalan-j/

  • My itunes will not open at all. it occasionally will open but when i plug my iphone into it the program freezes and crashes. please help as soon as possible

    my itunes will not open at all. it occasionally will open but when i plug my iphone into it the program freezes and crashes. please help as soon as possible

    i think i might have a solution... i have windows vista and after i installed to latest itunes update everytime i tried to open it it would freeze. I tried everything, including uninstalling itunes and all of its components and reinstalled it numerous times. So i went to the itunes folder in my folders, not on itunes, and i deleted my itunes library and playlists. After that it worked just fine, all of my music was deleted but luckily i had my files saved elsewhere.
    I hope this helped! I know its frustrating and APPLE/ITUNES NEED TO FIX THE PROBLEM!!!!

  • My ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    my ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    Hey erinoneill24,
    Thanks for using Apple Support Communities.
    Sounds like you can't update your device. You don't mention an error that it gives you. Take a look at both of these articles to troubleshoot.
    iPod displays "Use iTunes to restore" message
    http://support.apple.com/kb/ts1441?viewlocale=it_it
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808?viewlocale=de_DE_1
    If you started your device in recovery mode by mistake, restart it to exit recovery mode. Or you can just wait—after 15 minutes the device will exit recovery mode by itself.
    Have a nice day,
    Mario

  • I lost my ipad and i need the serial number and IMEI , please help me how?

    i lost my ipad and i need the serial number and IMEI , please help me how?

    If you have registered your device, you can go to https://supportprofile.apple.com/ and log into your apple id.  Your devices appear there with serial numbers.
    Additionally, your serial number is included on the original receipt when purchased at any Apple Online or Apple Retail store, or any Authorized Apple Reseller.

  • Itunes will not respond to my ipod touch, i have re-installed countless times and it still is not working. i have also tried different USB's and nothing. please help!

    Itunes will not respond to my ipod touch, i have re-installed countless times and it still is not working. i have also tried different USB's and nothing. please help!

    - Try here:
    iOS: Device not recognized in iTunes for Windows
    - Next try a different computer to help determine if you have a computer or iPod problem.

  • I have an old version of InDesign CS5, have not used in a while..about a year.  It will not load nor allow me to uninstall and reinstall, please help.  I have original discs and serial number.  How can I fix this?

      I have an old version of InDesign CS5, have not used in a while..about a year.  It will not load nor allow me to uninstall and reinstall, please help.  I have original discs and serial number.  How can I fix this?

    CS Cleaner Tool for installation problems | CCM, CS6, CS5.5, CS5, CS4, CS3

  • Can somebody explain to me how java and xml are related?

    Hi guys
    im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it...
    the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml
    I have absolutely NO IDEA why i must convert my java to xml and have no idea how to do that.I been reading on the net that xml is a exten~ markup language and it is better and useful.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?
    2)why do ppl want to convert java to xml when they can just stick to java
    3)what is actually xml...
    4)Do i need a program to create xml like i need jcreater to create java application
    5)How do we actually convert?is there any links that you guys could tell me?
    thank you
    tomleo

    im new to java and xml.Been reading a lot regarding
    java and don't seem to have a problem with it...Okay.
    the problem is the xml part...im doing a simple GUI
    project using swing(online store) and i have to
    o convert it to xmlYou have to? So presumably somebody in a position of authority told you that?
    I have absolutely NO IDEA why i must convert my java
    to xml and have no idea how to do that.I been reading
    on the net that xml is a exten~ markup language and
    it is better and useful.I have no idea either (besides which, it doesn't make sense). But why ask us? Somebody told you to do that, ask them why.
    Sure, XML is useful. But it isn't a programming language so it can't be used as a substitute for Java.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?They aren't related, except perhaps in that they are both used in computers.
    2)why do ppl want to convert java to xml when they
    can just stick to javaThey don't.
    3)what is actually xml...Start here for numerous definitions:
    http://www.google.ca/search?hl=en&lr=&oi=defmore&q=define:XML
    4)Do i need a program to create xml like i need
    jcreater to create java applicationNo, XML is just text. But then Java code is just text too.
    5)How do we actually convert?is there any links that
    you guys could tell me?You don't convert Java to XML. My guess is that because you don't know much about Java or XML, you have misinterpreted something that somebody told you.

  • Hello Sorry for the inconvenience, but I have a problem in Java I can not open files, audio chat, which type of jnlp after the last update of the Java 2012-004 Please help me in solving this problem.

    Hello Sorry for the inconvenience, but I have a problem in Java I can not open files, audio chat, which type of jnlp after the last update of the Java 2012-004
    Please help me in solving this problem. 

    Make sure Java is enable in your browser's security settings.
    Open Java Preferences (in Utilities folder)
    Make sure Web-start applications are enabled.
    Drag Java 32-bit to the top of the list.
    jnlp isn't an audio file format. It's just a java web-start program (Java Network Launching Protocol).

  • Am Having Issues with my Apple 4 Not being Reconized by Itunes, Reinstalled Itunes, Error Mobile Service not started, Have Win 7 it worked before, i manually restareted it, Nothing, I've restarted Phone and Computer Please Help

    Have Windows 7 LapTop, Before my restore my Iphone-4 worked like a champ... Now it won't start Itunes when Plugged in Via USB cable, tried Two in Fact
    Won't Start I tunes, so i Manually opened I tunes and still No recognition of I phone in  ITunes even after reinstall, manual start of mobile service stopping and starting mobile services, restarting the phone and computer, Please Help If Possible......Thanks

    http://support.apple.com/kb/TS1538

  • I would like to keep all my Music and photos on my mac but only top rated music and certain photos on my iPad and iPhone please help

    I would like to keep all my Music and photos on my mac but only top rated music and certain photos on my iPad and iPhone how do i stop iCloud from sending all to iPad and iPhone
    please help
    Regards
    Steve Davey

    If you manually manage the device the you can remove the content from the PC after you have put it on the device. However this isn't the recommended way. At some point you'll probably need to restore it which involves wiping all the data. If you don't have all this data to hand then you'll have to try to recover it from a now problematic device first. It's much easier to sync with your library - yes you have two copies, but that's not a waste, it is prudent. As long as you have two copies you can afford to lose one knowing you have a backup. In practice I keep a complete backup of my library, in addition to the subsets of it that I can put on my devices.
    tt2

  • I have latest firefox on my desktop and laptop, was working very well since threee years. Sudenlly has stop working both on my desktop and laptop. please help me.

    I have latest firefox on my desktop and laptop, was working very well since threee years. Sudenlly has stop working both on my desktop and laptop. please help me.

    Hello becky81464
    If you were able to load websites until you updated Firefox, your Internet security software (including firewalls, antivirus programs, anti-spyware programs, and more) is likely preventing Firefox from connecting to the Internet, see [http://support.mozilla.org/en-US/kb/configure-firewalls-so-firefox-can-access-internet firewalls]
    see also : [https://support.mozilla.org/en-US/kb/configure-windows-firewall-allow-firefox-access Configure Windows Firewall to allow Firefox access to the Internet ]
    thank you

Maybe you are looking for

  • Safari and also Webkit crashes after opening

    Safari and also Webkit crashes after opening Process: Safari [585] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier: org.webkit.nightly.WebKit Version: r82096 (82096) Code Type: X86-64 (Native) Parent Process: launchd [101] Date/Time:

  • RFBIDE00 - Address data issue

    Hi, I want to populate the street2 and street3 fields of the customer master when uploading master data with LSMW using standard program - RFBIDE00 (Batch Input Program). These fields are not available in structure BKNA1 provided by the standard prog

  • HT2463 Home sharing stopped working. Windows 8 Netgear wndr3700 router

    Have two AppleTv's that home sharing stopped working on. Windows 8 Pro, Netgear WNDR3700, Dell 9100 XPS. Have gone through two calls with Appletv support but no permanent fix. Homesharing says it's on. on the appletv's and itunes, all with the same i

  • Can you backup your iphone during new software download

    Can you back up your iphone5, during the new software download

  • Mac App Store connection failed

    Hi all, Haven't been able to login to App Store with ID. Keeps saying connection failed, but user and PW are correct. In fact, have changed PW a few times to ensure. Have looked at other threads ..... changing class 3 public to trust ..... parental l