Using "Save As" execCommand in IE8 to save XML file in ANSI format instead of UCS2-Little Endian

I am currently trying to save an XML data using "SaveAs" execCommand  from Javascript in Internet Explorer 8 only.I am using document.write(xml) to write the xml content after i open a window.The document object in IE8 uses a saveAs Exec
Command to allow the user to save the xml file in the local folder.The XML file is generated but it doesnt set the encoding to my preferred type  for a different interface where i need to send this XML which is ANSI/UTF-8   encoding.I can only save
the XML in UCS2 little Endian encoding format.Below is the code i am using.
     var location = "D:\\export_to_MCT"+dateTime+".xml";
        var xml = tmpSelectedConfigurationXML.transformNode(xslDoc);// XML Is generated here
       alert(xml);
         **var testlink = window.open  ("about:blank","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none");
         testlink.document.write(xml); //fileData has contents for the file
    testlink.document.close();
    testlink.document.execCommand('SaveAs', false, location);**
    testlink.close();
My purpose is to save the xml  in ANSI/UTF-8 encoding without BOM format.I cant use Scripting.FileSystemObject method of ActiveX object.Please suggest

@panda Boy--
But my intention isnt that .I need to download the xml in ANSI format

Similar Messages

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

  • How to make a save state in the Flash iphone ios xml file?

    Hi, I'm looking for a way of pausing an ipad app, when you press the home button. So if you leave the app, you can come back to
    the place you were at.
    Is there a toggle from within flash CS5.5 that does this? If not is there some AS3 code I can put into my first frame?
    I've seen the code below on a recent post, so I though I'd insert it near the bottom of the XML file. But whenever I modify this and
    republish the FLA, it comes up with errors.
    I'd like a reverse of this code below - instead of exit, pause. and also need to know where exactly to put it?
    "When a user switches away from an AIR application it enters the background and pauses. If you want your application to exit completely instead of pausing, set the UIApplicationExitsOnSuspend property to YES"
    <key>UIApplicationExitsOnSuspend</key>
    <string>NO</string>
    Anyone got a simple solution for this? Thanks!

    It isn't dependent on the AIR in stalled in your system, it's just based on the packager you're using. If you're using a trial download of CS5.5, then the second line of the app descriptor xml should read like this:
    <application xmlns="http://ns.adobe.com/air/application/2.6">
    That would show that it's AIR 2.6.

  • Using an XML file for server URL instead of hard coding

    I can't find a good example.
    Could someone give me an example of using a local XML file to set a server url variable so i don't have to hard code url's?
    This works and i can trace the xml file but how do i access the individual xml data nodes?
    protected function initApp():void
         var loader:URLLoader = new URLLoader(new URLRequest("config.xml"));
         loader.addEventListener(Event.COMPLETE,configLoadComplete);
    private function configLoadComplete(event:Event):void
         trace(event.target.data);

    Hi,
    <a href="foobar.xml">right click and select save as from the context menu</a>
    or
    write your xml data or a copy of it with a different extension (text) so that it is not parsed as application/xml-xhtml
    or
    Use AJAX to retrieve the xml file and display it as the textContent of a <textarea>
    window.open wraps the xml markup in html tags for display purposes.
    Rob^_^

  • How to use web dynpro's web service to import XML file

    Hi
    I have an xml file and I want to use a web dynpro's web service to cosume this file which is existing on my local drive. Can anyone help me which steps I have to do to use this file as a web service using web dynpro.
    Thanks

    Hi
    You can refer below Wiki Article on SDN. I hope that will help you out.
    [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/emtech/consuming%2babap%2bweb%2bservices%2busing%2bflex]
    Thanks.

  • XSLT, using document() to fetch a local JSP generated XML file

    All,
    I have 1 XML document that keeps track of various subsite owners of a domain I manage. The xml file doesn't hold much, something along the lines of:
    <?xml version="1.0"?>
    <sitedirectory>
         <page id="/marys_page" name="Mary's Page"">
              <content_contact ntid="smithm" />
              <technical_contact ntid="techguy" />
         </page>
    </sitedirectory>Now I also have a JSP page, that when given an NT id as a URL parameter, rifles through LDAP and spits out an xml document with all the relavent ISID fields for that person's id (first name, last name, phone number, e-mail address etc).
    I use the document() function in an XSL file to access that dynamic JSP page, fetch the contents of the resulting XML file. Using the document() function with just a regular file call like "getldap.jsp" only feeds my stylesheet the source of that JSP file, not the resulting XML file that I'm looking for when it's been processed.
    So... I have my document() function calling the full URL to that JSP file on my domain, an example <value-of /> call in my XSL file would be:
    <xsl:value-of select="document('http://my.domain.com/jsp_util/ldap_person.jsp?ntid=smithm')/person/firstname" />and I get what I want, that person's first name, drawn from LDAP into my XSL file. But it seems a little weird to me, having a server-side transformation, accessing a JSP file by making an http call to the same server the transformation resides in.
    Am I missing something? Is there a better way to do this or some directive I'm missing? I'd appreciate any help.

    That's a creative but perfectly reasonable way to use the document() function.
    There are other ways to solve the problem, such as including Java calls in your XSL and applying a customized URIResolver to your transformation, but my approach would be to use the simplest method that works acceptably. So if you don't have performance problems with your solution, I would leave it alone.

  • Using abap code data from internal table to XML file create

    Hi ALL,
    i am using methods
      L_VALUE = GS_DOCUMENT-U_MITARBEITER.
      L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'U_Mitarbeiter' VALUE = L_VALUE ).
      CLEAR: L_VALUE,
             L_RC.
      L_VALUE = GS_DOCUMENT-VORNAME .
      L_RC = L_ELEMENT_FLIGHTS->SET_ATTRIBUTE( NAME = 'Vorname' VALUE = L_VALUE ).
         ENDLOOP.
      LOOP AT GS_DOCUMENT-GI_TIMETABLE INTO GS_TIMETABLE.
        L_ELEMENT_AIRLINE  = L_DOCUMENT->CREATE_SIMPLE_ELEMENT(
            NAME = 'Timetable'
            PARENT = L_ELEMENT_FLIGHTS  ).
          Create attribute 'code' of node 'airline'
        L_VALUE = GS_TIMETABLE-BEGINNUHRZEIT.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Beginnuhrzeit' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-BEMERKUNGEN.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Bemerkungen' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-ENDEUHRZEIT  .
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Endeuhrzeit' VALUE = L_VALUE ).
        L_VALUE = GS_TIMETABLE-BUCHUNGSDATUM.
        L_RC = L_ELEMENT_AIRLINE->SET_ATTRIBUTE( NAME = 'Buchungsdatum' VALUE = L_VALUE ).
      ENDLOOP.
      Creating a stream factory
      L_STREAMFACTORY = L_IXML->CREATE_STREAM_FACTORY( ).
      Connect internal XML table to stream factory
      L_OSTREAM = L_STREAMFACTORY->CREATE_OSTREAM_ITABLE( TABLE = L_XML_TABLE ).
      Rendering the document
      L_RENDERER = L_IXML->CREATE_RENDERER( OSTREAM  = L_OSTREAM
                                            DOCUMENT = L_DOCUMENT ).
      L_RC = L_RENDERER->RENDER( ).
      Saving the XML document
      L_XML_SIZE = L_OSTREAM->GET_NUM_WRITTEN_RAW( ).
    i am geting the output,
    line1
    <?xml version="1.0"?><Head Document="002_TMA1_KW1_SAP.XML" Innenauftragsnummer="008004000800" Kalenderwoche="17" MonatJahr="04/2008" Name="" Personalnummer="91003139" Projektnummer="1400000700" Regionalstelle="B" U_Entleiher="1" U_Mitarbeiter="1" Vorname=
    line 2
    Ricky"><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="21.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="22.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrz
    line 3
    it="16:30" Buchungsdatum="23.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="24.04.2008"/><Timetable Beginnuhrzeit="08:00" Bemerkungen="" Endeuhrzeit="16:30" Buchungsdatum="25.04.2008"/></Head>
    but i want this type line by line
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Document Dokumentnummer="001_TMA7_KW2_MAN" Dokumenttyp="TN_HE" Innenauftragsnummer="8004750104" Kalenderwoche="15" MonatJahr="04/2008" Name="Banana" Personalnummer="166326" Projektnummer="1400000203" Regionalstelle="RV1" U_Entleiher="1" U_Mitarbeiter="1" Vorname="Sepp">
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="07.04.2008" Endeuhrzeit="16:00"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="08.04.2008" Endeuhrzeit="16:00"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="09.04.2008" Endeuhrzeit="16:30"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="10.04.2008" Endeuhrzeit="16:30"/>
    <TimeTable Beginnuhrzeit="08:00" Bemerkungen="" Buchungsdatum="11.04.2008" Endeuhrzeit=""/>
    </Document>
    for line breaking, please give me solution
    Regards,
    Santha

    Hi,
    Please give me more inforamtion, how to use this
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    cl_abap_char_utilities=>newline
    Regards,
    Santha

  • Which method to use to separate out invoices from one large xml file

    I will generate one massive invoice file , say , containgoin aout 200 invoices.
    However, I would like them to be produced as separate .pdf files instead of a singular pdf
    Th eintention is to take each pdf and email it out to customers.
    Is there another approach?

    Thank you Dominic,
    I found the chapter on bursting in another User Guide .
    But since I have not worked with java ( classes), I am not sure where to place the separate code units.
    From user guide I understand that the following need to be done:-
    1. Write up a control file
    2. Write up another little class , which will use DocumenTProcessor class and registerListener method.
    example
    public BurstingTest()
    try
    DocumentProcessor dp = new DocumentProcessor
    ("\burst\burstCtrl.xml", "\\burst\\empData.xml","\\burst");
    dp.registerListener(this);
    dp.process();
    catch (Exception e)
    { System.out.println(e);
    Where should this new code be placed on the server ? Will it be JAVA_TOP ?
    Will the bursting be a stand-alone process , called from the server ? And how to call it ?

  • Trying to save the data from the pdf into XML

    I have Adobe Live Cycle 8.0 installed and without the blade for Reader Extension.
    The objective is to save the editable data from the pdf into a XML file
    the code for that is:
    // to fetch the input pdf file from the local drive
    FileInputStream fileInputStream2 = new FileInputStream("C:\\Adobe-Final PDF\\stitched_Letters.pdf");
    Document inPDF = new Document(fileInputStream2);
    Properties connectionProps=new Properties();
    connectionProps.load(new FileInputStream(_propertiesPath));
    //propertiesPath is the path of the properties file
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    FormDataIntegrationClient dataClient = new FormDataIntegrationClient(myFactory);
    Document resultPDF=dataClient.exportData(inPDF);
    What happens is that this ultimate resultPDF does not get the XML with data but rather with empty tags. Does this require Reader Extension?

    //Set connection properties required to invoke LiveCycle ES
    Properties connectionProps = new Properties();
    connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
    connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
    connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
    connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
    connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
    //Create a ServiceClientFactory object
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    //Create a FormDataIntegrationClient object
    FormDataIntegrationClient dataClient = new FormDataIntegrationClient(myFactory);
    //Reference a PDF form from which to export data
    FileInputStream fileInputStream2 = new FileInputStream("C:\\Adobe\\Loan.pdf");
    Document inputPDF = new Document(fileInputStream2);
    //Export data from the form
    Document resultPDF = dataClient.exportData(inputPDF);
    //Save the exported form data as an XML file
    File resultFile = new File("C:\\Adobe\\formData.xml");
    resultPDF.copyToFile(resultFile);
    }catch (Exception e) {
    e.printStackTrace();

  • Using XML file in Java script to create Google Map

    Hello,
    I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path.
    Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that will have pop-up info bubbles with additional info inside (using html), once the marker is clicked.
    Here is the XML script example that is used in the tutorial I am following:
    <markers>
    <marker lat="43.65654" lng="-79.90138" html="Some stuff to display in the<br>First Info Window"
    label="Marker One" />
    <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window"
    label="Marker Two" />
    <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window"
    label="Marker Three" />
    </markers>
    ...and this is how it looks when the file is retrieved by the java script and mapped: http://econym.googlepages.com/example_map3.htm
    This is the java script that creates the Google Map. I have emboldened the section of the script that retrieves the data and parses it to create the markers:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA6GoL8P5zqjQlG5A5uM1ETBSUPozAscB0cY3RG8xEGnZyeom4axRySak889rVpvHYRsV4f9OZZzbboA"
    type="text/javascript"></script>
    </head>
    <body onunload="GUnload()">
    <!-- you can use tables or divs for the overall layout -->
    <table border=1>
    <tr>
    <td>
    <div id="map" style="width: 800px; height: 1200px"></div>
    </td>
    <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
    <div id="side_bar"></div>
    </td>
    </tr>
    </table>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
    However, it seems JavaScript is either disabled or not supported by your browser.
    To view Google Maps, enable JavaScript by changing your browser options, and then
    try again.
    </noscript>
    <script type="text/javascript">
    //<![CDATA[
    if (GBrowserIsCompatible()) {
    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";
    // arrays to hold copies of the markers used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];
    var i = 0;
    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    // add a line to the side_bar html
    side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
    i++;
    return marker;
    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 37.251699,-119.604315), 7);
    *// Read the data from testXML2blackpoolformat.xml*
    var request = GXmlHttp.create();
    request.open("GET", "testXML2blackpoolformat.xml", true);
    *request.onreadystatechange = function() {*
    *if (request.readyState == 4) {*
    var xmlDoc = GXml.parse(request.responseText);
    *// obtain the array of markers and loop through it*
    var markers = xmlDoc.documentElement.getElementsByTagName("ConnectoryRecord");
    *for (var i = 0; i < markers.length; i++) {*
    *// obtain the attribues of each marker*
    *var lat = parseFloat(markers[i].getAttribute("lat"));*
    *var lng = parseFloat(markers[i].getAttribute("lng"));*
    var point = new GLatLng(lat,lng);
    *var html = markers[i].getAttribute("html");*
    *var label = markers[i].getAttribute("label");*
    *// create the marker*
    var marker = createMarker(point,label,html);
    map.addOverlay(marker);
    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;
    request.send(null);
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm
    //]]>
    </script>
    </body>
    </html>
    Here is my delima--
    This is the xml format that I need to use because it can accept the rest of my excel file and loop it through the 14,000+ records to create a functioning xml file. This is just a sample (2 records) of the larger file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ConnectoryAug2008>
    <ConnectoryRecord>
         <lng>-117.03683</lng>
         <lat>32.944505</lat>
         <ConnectoryID>1</ConnectoryID>
         <Name>$2.95 Guys</Name>
         <StreetAddress>13750 Stowe Drive</StreetAddress>
         <City>Poway</City>
         <State>CA</State>
         <Zip>92064</Zip>
    <Marker>White</Marker>
         <IndustryGroup>Technical Services</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=1</ConnectoryProfileLink>
    </ConnectoryRecord>
    <ConnectoryRecord>
         <lng>-117.272843</lng>
         <lat>33.13337</lat>
         <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <Marker>Orange</Marker>
         <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    </ConnectoryRecord>
    </ConnectoryAug2008>
    This is the tutorial where I found the formatting techniques to successfully create the large xml file that will format/convert my excel file properly: http://www.mrexcel.com/tip064.shtml
    These variables should appear as html in the info bubble:
    <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    The "Marker" variable instructs Google Maps to label the marker with a particular color. I will be so grateful to the person(s) that helps me get through this wall that I have been hitting for a long time. It's very difficult without having the luxury of peers who know about these types of issues.
    Thank you!!

    Here is the relationship: They both contain geographic coordinates that produce a point on a map. I will use the rest of the information in the second xml file (company name, address, link, etc.) to produce the information for the bubble that will pop up once the marker is clicked.
    My problem is that I need to try to keep the second xml file in a relatively similar format, so the rest of my records will still be accepted. If I had a smaller amount of records I could place them directly into the javascript, but because there are so many records, I need to use an xml file that can be retrieved by the java script. I chose to use the second type of xml file because I can easily copy and past the 14,000+ records that are now in excel document.
    After the xml issue is corrected I need to rework the javascript that is now emboldened so that it will read the new xml file correctly. I included the first xml file so that the readers will understand what type of xml format is currently being used to produce the markers in the tutorial map.

  • Upload xml file from aplication server using read dataset, parser error.

    Hi,
    I would like to upload xml file from app. server but parser failed. If I upload this xml file from workstation (using ws_upload) it is correct. For uploading xml file from app. server I use open dataset... read dataset. In loop section I remove '#' char. How do You upload xml file from app server? What Could be incorrect.
    I try to open dataset in binary mode, text mode...
    TYPES: BEGIN OF xml_line,
            data(255) TYPE c,
          END OF xml_line.
    DATA: gt_xml_table TYPE TABLE OF xml_line,
          gs_xml_structure TYPE  xml_line,
          gv_xml_table_size TYPE i.
    OPEN DATASET s FOR INPUT IN BINARY MODE.
      IF sy-subrc <> 0.
        MESSAGE e001(zet) WITH '....'.
      ENDIF.
      DO.
        READ DATASET s INTO gs_xml_structure.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
         len = STRLEN( gs_xml_structure ).
         len = len - 1.
         check len > 0.
         WRITE gs_xml_structure(len) TO gs_xml_structure.
          APPEND gs_xml_structure TO gt_xml_table.
        ENDIF.
      ENDDO.

    You Can do this too
    parameters: p_file like rlgrap-filename.
    data: subrc like sy-subrc.
      create object me.
      REFRESH t_data.
    *  Open XML File
      CALL METHOD me->CREATE_WITH_FILE
        EXPORTING
          filename = p_file
        RECEIVING
          retcode  = subrc.
    * Saves Data in an itab from XML File.
      CALL METHOD me->get_data
        IMPORTING
          retcode    = subrc
        CHANGING
          dataobject = t_data[].
    Regards,
    Claudio.

  • How to Update existing XML File Using Java Swing

    Hi,
    I am reading XML file and getting keywords into JList. When i add some keywords into JList through textfield and remove keywords JList, then after click on save button it should update xml file. How can i do it ?
    Please provide me some code tips for updating xml file
    This is the code that i am using for reading XML File:
    import javax.swing.*;
    import java.awt.event.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    import java.io.IOException;
    import java.util.*;
    import java.text.Collator;
    import java.util.regex.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import com.cloudgarden.layout.AnchorConstraint;
    import com.cloudgarden.layout.AnchorLayout;
    public class getKeywords extends JFrame implements ActionListener
    static JPanel p;
    static JLabel lbl;
    static JButton btnSave,btnAdd,btnRemove;
    static String path;
    static Vector v;
    static JList lstCur;
    static JTextField txtKey;
    Document dom;
    static image imgval;
    NodeList nodelstImage;
    static AnchorLayout anchorLay;
    private DefaultListModel lstCurModel;
    public getKeywords()
         super("Current Keywords");
        v=new Vector();
        p=new JPanel();
        txtKey=new JTextField(10);
        btnAdd=new JButton("Add");
        btnRemove=new JButton("Remove");
        btnSave=new JButton("Save");
        lbl=new JLabel("Current Keywords");
        lstCurModel=new DefaultListModel();
            lstCur=new JList();
            JScrollPane scr=new JScrollPane(lstCur);
        runExample();
         lstCur.setModel(lstCurModel);
         p.add(lbl);
         p.add(scr);
         p.add(txtKey);
         p.add(btnAdd);
         p.add(btnRemove);
         p.add(btnSave);
         add(p);
         btnAdd.addActionListener(this);
         btnRemove.addActionListener(this);
         btnSave.addActionListener(this);
         setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    public static void main(String arg[])
         getKeywords g=new getKeywords();
         g.resize(250,400);
         g.setVisible(true);     
    public void actionPerformed(ActionEvent ae)
         if(ae.getSource()==btnAdd)
              lstCurModel.addElement(txtKey.getText());
         if(ae.getSource()==btnRemove)
              lstCurModel.remove(lstCur.getSelectedIndex());
         if(ae.getSource()==btnSave)
              //Code to Write
         public void runExample()
              //Parse the XML file and get the DOM object
              ParseXMLFile();
              //Get the Detail of the Image Document
              parseImageDocument();
              //Get the Detail of the LML Document
              //parseLMLDocument();
              //System.out.println(lmlval.Title);
         public void ParseXMLFile()
              //Get the Factory
              DocumentBuilderFactory builderFac = DocumentBuilderFactory.newInstance();
              try
                   //Using factory get an instance of the Document Builder
                   DocumentBuilder builder = builderFac.newDocumentBuilder();
                   //parse using builder to get DOM representation of the XML file
                   dom = builder.parse("LML.xml");
              catch(ParserConfigurationException pce)
                   pce.printStackTrace();
              catch(SAXException sax)
                   sax.printStackTrace();
              catch(IOException ioex)
                   ioex.printStackTrace();
         public void parseImageDocument()
              //Get the root element
              Element docImgEle = dom.getDocumentElement();
              //Get a nodelist for <Image> Element
              nodelstImage =  docImgEle.getElementsByTagName("Image");
              if(nodelstImage != null && nodelstImage.getLength() > 0)
                   for(int i = 0; i < nodelstImage.getLength(); i++)
                        //Get the LML elements
                        Element el = (Element)nodelstImage.item(i);
                        //Get the LML object
                        getImage myImgval = new getImage();
                        imgval = myImgval.getimage(el);
                        v.addElement(new String(imgval.Thumb));
                        String[] x = Pattern.compile(",").split(imgval.Keys);
                        for (int s=0; s<x.length; s++)
                        lstCurModel.addElement(x[s].trim());
                        //System.out.println(x[s].trim());
    }     Thanks
    Nitin

    You should update your DOM document to represent the changes that you want made.
    Then, using the Transformation API you simply transform your document onto a stream representing your file. Something like this:
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    // TODO - set indentation amount!
    Source source = new DOMSource(dom);
    Result result = new StreamResult(file);
    transformer.transform(source, result);Hope this helps.

  • Saving acquired data in text format instead of TDMS using the NI DAQ ANSI C code

    Hello,
    I would like to know how to change the code to make it save the file in .txt format instead of TDMS format.
    It would be great if you could help me out with this !!!
    I am attaching the DAQ mx ANSI C code for your reference
    Thanks, 
    Haritha Srinivasan
    Attachments:
    TDMS-Cont Acq-Int Clk.zip ‏1360 KB

    Hello Haritha, Hope you are doing great!
     I think this covers up what you are looking for.
    This has been covered in other forum before, please feel free to check it.
    Regards, 
    LuisA 

  • How do i use a flash gallery with xml file

    Hi there....
    I am trying to include a flash banner template i have downloaded into my webpage using dreamweaver CS5.
    the template comes with an XML file with it in which you can reference your own images etc..
    I understand how to inclued the Flash object into my webpage by insert-swf- and then navigating to the .swf file...
    what i am having trouble with is understanding how this refereces the XML file in the download pack as i cant find any references to it in the code??
    I am just getting the grey flash box with no images appearing when i hit play etc..
    sorry if this is a really silly question!!
    mart

    If you are using DW to insert the Flash, that could be the problem.  It is not reliable resource in that respect (my opinion, but a shared one). I normally only use Flash to create the code and copy/paste it into my html page.  Did you get an fla file with the set, and do you have Flash?
    What you should do is test the swf file by itself to make sure it works.   Normally you can link directly to the swf file to check that out.  Just type in the url to the swf file and see if it plays.  There may be some other setup required that maybe an accompanying set of instructions might explain.
    Also, if you have a link to the html file you uploaded, providing it here may help in getting things resolved.

  • Problem reading an xml file using java

    i have a Com File which is called through .Net application and i made another java application that call the same COM file using JNI . but the problem is that the xml format generated from the Com file in case of the .Net application is approx 49.9K and the same Xml file Contents generated through java is half the size of the previous file in .net about 24.9K . I had figured out that the .Net application generates the xml file as unicode format while the java application generates the same xml format as ANSI format which is approx the half of the .Net counterpart .
    but the problem now is that i can't deserialize the java generated xml to convert it into its java object using XMLDecoder because it is ill formed xml whereas its tags are well structured .
    even when i try to open that .NEt xml file into the IE browser it structures the xml file successfully
    while the java xml file version tells me that the file is ill formed knowing that the file is well structured and all the tags are valid.

    First of, that's not "Unicode" and "ANSI". Those are not really encodings per-se. "Unicode" is sometimes used to refer to UTF-16/UCS-2, and "ANSI" is sometimes used to refer to whatever the current 1-byte encoding of the machine is. But again: Those are not valid encoding names. The encodings used are probably UTF-16 (or UCS-2) and UTF-8, respectively.
    Next: unless you tell us some exact error message we can't tell you what went wrong.
    And if you want to find out if any given XML file is valid, just run it through some validator (such as [the one from the W3C|http://validator.w3.org/]).

Maybe you are looking for

  • ITS 6.20 connect to another client doesn't work

    We have an ITS 6.20 . Glabal service belong the caracteristics of connection to SAP server (login, pasword, client, systemnamme, systemnumber). I want to connect to another client but all the others parameter stay the same as in global service defini

  • File not found error when checking file into SCC

    I am attempting to setup the built in source code control features in Labview 7.0. I set up the master directory and my working directory. I copied the project I was working on into my working directory and opened the top level V.I.. I was able to su

  • Make a DLL with LabView??

    Hi LabViewers!! I'm doing a program with C++Builder and I would like to use some features from LabView, and I think that I can do that creating a dll with LabView but I dont know if this is possible. Could someone tell me if there is another way on m

  • About OGG-01028 recovery record is missing error

    Hi! everybody, My enviroment is :windows server 2008 64bit ,oracle 11GR2,goldengate 11.1.1.1.I often meet the error :ogg-01028 recorery record is missing . In mos,I found the relative article((Doc ID 1094767.1) In this Document Symptoms Cause Solutio

  • Cocomo Dev Console

    hi guys, if I edit my account and change 'Display Name for this Account' in the console. the name doesn't get updated till the console is restarted. thxs paddy ;)