Help! Flash error: 1088 (Markup in doucment not well-formed)

I'm trying to use ASP.NET to retrieve data from the sql server, place in inside an xml and sends the xml to flash to display the data.
However, I'm getting
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
at news_fla::mainTimeline/loaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
This is my code:
ASP.NET
=======
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim adapter As SqlDataAdapter
        Dim ds As New DataSet
        Dim sql As String
        Dim con As New SqlConnection("data source = GN80000798-0\SQLEXPRESS2008; initial catalog = EL; integrated security = true")
        sql = "select * from news"
        Try
            con.Open()
            adapter = New SqlDataAdapter(sql, con)
            adapter.Fill(ds, "data")
            con.Close()
            Response.ContentType = "text/XML"
            Response.HeaderEncoding = Encoding.UTF8
            ds.WriteXml(Response.OutputStream, XmlWriteMode.WriteSchema)
            MsgBox("Done")
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
Flash
====
import flash.xml.*;
var newsrequest:URLRequest = new URLRequest("http://localhost:1179/DB/DB.aspx"); //ASP.NET development server
var newsloader:URLLoader = new URLLoader();
var newsxml:XML;
var dvar:URLVariables = new URLVariables();
dvar.dummy = "dummy";
newsrequest.data = dvar;
newsrequest.method = URLRequestMethod.POST;
newsloader.load(newsrequest);
newsloader.addEventListener(Event.COMPLETE, loaded);
titlenews.autoSize = TextFieldAutoSize.LEFT;
bodynews.autoSize = TextFieldAutoSize.LEFT;
function loaded(event:Event){
newsxml = new XML(event.target.data);
newsxml.ignoreWhitespace = true;
trace(newsxml);
HOWEVER, if i replace the
"ds.WriteXml(Response.OutputStream, XmlWriteMode.WriteSchema)"
with
"ds.WriteXml("C:\new.xml")
it works. But i dont wan a .xml file residing in the server. so i hope that the .xml file would be cleared off as soon as the request is done.
Did i do something wrong?
PS: I don't know if i post this in the correct section but since it's related to AS3, thats why i post it here. sorry if i made a mistake.

Please paste the following line as first statement in loaded function, also compare the output of the following line with expected output from ASP page.
trace(event.target.data);
The error is causing due to the fact that XML received is not well formed.
I guess the problem is with write XML you are getting some additional tag elements and these are not wellformed. so flash is giving error.

Similar Messages

  • Error using XML Loader: XML not well-formed

    Hi all,
    I am facing a problem using the XML loader in xMII 12.0 when trying to load the following XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <Users>
      <User>
        <UserID>IMXOO</UserID>
        <CWID>IMXOO</CWID>
        <Prename>Michael</Prename>
        <Surname>Otto</Surname>
        <CreatedOn>2001-12-31T12:00:00</CreatedOn>
        <CreatedBy>IMXOO</CreatedBy>
      </User>
    </Users>
    I also tried a most basic XML file which shows the same error:
    <?xml version="1.0"?>
    <ausgabe>
      <anzeige>Testausgabe</ausgabe>
    </ausgabe>
    To my understanding both files are well-formed, however xMII shows the error:
    "The markup in the document following the root element must be well-formed."
    Do I break any rules concerning the markup? IE loads the files without showing any errors.
    Best Regards
    Michael

    Jeremy,
    again you gave the key to the solution. When the error occured, I have set up the following path within the xMII workbench:
    "Catalog-Tab"
    <server>
      > Sandbox
            > XML
                myFile.xml
    When I tried to load the mxFile.xml with the XML Loader, I got the error described above (XML not well-formed). I also cannot drag the file into a transaction in the workbench. I have manually configured the XML Loader with "http://<server:port>/XMII/CM/Sandbox/XML/mxFile".
    Now using your hint I have changed to the "Web-Tab":
    "Web-Tab"
    <server>
        > Sandbox
            > WEB
                > XML
                    myFile.xml
    Then all works fine, when I now drag the file into the transaction. As you described, an XML Loader action is created with configuration "db://Sandbox/WEB/XML/myFile.xml" and the XML is loaded correctly.
    Thanks for your help!
    Best regards
    Michael

  • Essbase Studio, Grid is not well formed !!

    Hi All,
    Everything in Studio is prepared for a drill through on an Essbase model.
    A report is created and after pressing the button Show Result the first 20 rows appear on the screen.
    Switching to SmartView a selection is made and on a cell a balloon is showing that drill through is available.
    When selecting Drill Through reports from the SmartView menubar a menu appears, because to reports are prepare.
    Clicking on the first report an error messages appears: Grid is not well formed !!
    Do you have any idea what went wrong or what is going on.
    Thanks a lot for your prompt response !!
    Regards,
    Ed

    There is a patch for that. The error is in ASP. look fore patch 12987654

  • Not well-formed error while implementin ajax in firefox---can anyone help

    hi techies,
    I'm trying to implement ajax in firefox and i'm getting not well-formed error in error console
    heres part of code
    var xmlHttp;
    function create(){
    if(window.ActiveXObject){
    xmlHttp=window.ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest){
    xmlHttp=window.XMLHttpRequest();
    else{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    function getEmployeeDetails(){
    frm = document.forms[0];
    empid = frm.elements["empid"].value;
    url="empdetails.jsp?empid=" + empid;
    xmlHttp.open("GET" ,url, true);
    xmlHttp.onreadystatechange=doUpdate;
    xmlHttp.send(null);
    function doUpdate(){
    if(xmlHttp.readyState==4 && xmlHttp.status == 200){
    var root = xmlHttp.responseXML.documentElement;
    ----so on
    jsp Page is
    <%@ page import="java.sql.*" contentType="text/xml" %>
    <%
    String empid=request.getParameter("empid");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:vmouli","hr","hr");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select first_name,salary from employees where employee_id=" + empid);
    if(rs.next()){
    out.println("<employee><name>");out.println(rs.getString(1));
    out.println("</name><salary>");out.println(rs.getString(2));
    out.println("</salary></employee>");
    else{
    out.println("<error>Employee ID not found</error>");
    rs.close();
    st.close();
    con.close();
    %>
    Firefox error console is saying not well-formed and is pointing to starting of my jsp page
    can anyone help plzzz

    mouli007 wrote:
    Thanx for that Cotton
    My XML document is wellformed no doubt about thatNo doubt about that?!?
    I would say there is a great deal of doubt about that, especially since the subject of this thread, which you stated was the error message from FireFox is that the document is not well formed at all. I have some more wild guesses about what you've screwed up. Would you like to hear them? My best guess at this point would be that you are outputting some whitespace at the start of the output.
    Anyway, this seems pretty pointless. Your code is crap. And I really don't see the point in telling us you have an error, posting code, then having several people identify several major problems in your code and then for you tell us that your code is perfect. Your code is not perfect. It's terrible. Fix it. You've been given several ideas in this and your cross-post as to how to fix it.

  • Not well-formed error in firefox in implementing ajax--pls help

    hi techies,
    I'm trying to implement ajax in firefox and i'm getting not well-formed error in error console
    heres part of code
    var xmlHttp;
    function create(){
    if(window.ActiveXObject){
    xmlHttp=window.ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest){
    xmlHttp=window.XMLHttpRequest();
    else{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    function getEmployeeDetails(){
    frm = document.forms[0];
    empid = frm.elements["empid"].value;
    url="empdetails.jsp?empid=" + empid;
    xmlHttp.open("GET" ,url, true);
    xmlHttp.onreadystatechange=doUpdate;
    xmlHttp.send(null);
    function doUpdate(){
    if(xmlHttp.readyState==4 && xmlHttp.status == 200){
    var root = xmlHttp.responseXML.documentElement;
    ----so on
    jsp Page is
    <%@ page import="java.sql.*" contentType="text/xml" %>
    <%
    String empid=request.getParameter("empid");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:vmouli","hr","hr");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select first_name,salary from employees where employee_id=" + empid);
    if(rs.next()){
    out.println("<employee><name>");out.println(rs.getString(1));
    out.println("</name><salary>");out.println(rs.getString(2));
    out.println("</salary></employee>");
    else{
    out.println("<error>Employee ID not found</error>");
    rs.close();
    st.close();
    con.close();
    %>
    Firefox error console is saying not well-formed and is pointing to starting of my jsp page
    can anyone help plzzz

    As BalusC said - run the JSP producing the xml.
    Save that xml to a file - INCLUDING any white space - because thats what you actually get.
    Open that xml file in your browser - it should tell you at that point if your xml is well formed.
    AS BalusC said this is better done in a servlet - especially since you're just doing out.println.
    JSPs add extra whitespace and carriage returns. While that won't necessarily break XML, it can cause problems with the first few characters.

  • XML Parsing Error: not well-formed Help!

    Hello Everyone,
    I followed this link "http://quest4apps.wordpress.com/2010/07/31/xmlp_report/" to create data template and RTF to generate a report. I have done exactly the same. But when i run the concurrent program i get "Completed" with "Warning" and on View Log i see ".....One or more post-processing actions failed...". And when i view XML i get
    XML Parsing Error: not well-formed
    Location: ********
    Line Number 3, Column 2:
    &lt;&gt;
    -^This is my data template:
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
        <dataTemplate description="Invoice Data" Version="1.0">
            <parameters>
                <parameter name="p_OrgId" dataType="number" />
                <parameter name="p_VendorId" dataType="number" />
            </parameters>
            <dataQuery>
                <sqlStatement name="Q1">
                    <![CDATA[
                        SELECT invoice_num,invoice_currency_code,invoice_amount
                        FROM ap_invoices_all
                        WHERE org_id = :p_OrgId
                        AND vendor_id = :p_VendorId
                    ]]>
                </sqlStatement>
            </dataQuery>
            <dataStructure>
                <group name="G_INV" source="Q1">
                    <element name="INV_NUMBER" value="invoice_num" />
                    <element name="INV_CUR_CODE" value="invoice_currency_code" />
                    <element name="AMOUNT" value="invoice_amount"/>
                </group>
            </dataStructure>
        </dataTemplate>And also when i run run other RDF reports it works fine. Please help me on this..
    Thanks & Regards
    John.

    Are you sure the parameters are passed correctly to data template?
    Can you try hardcoding the org and vendor details in query and try running the conc pgm again?
    Also validate if that query return records...

  • XML Parsing error: not well-formed (invalid token) (error code 4) --- Urgent Help Needed!

    Hi all, what im doing now is im trying to create a database connection my my MS SQL 2005 database. I created a data source and went to my Adobe Lifecycle Designer 7.1, i created a new data connection, selected OLEDB and created the connection string using the build function.
    Ok, now the problem is, after creating the new data connection and i click on the preview tab, i will receive the error stated above.
    'XML Parsing error: not well-formed (invalid token) (error code 4), line 444, column 1 of file'
    Does anyone know why am i receiving this error and how do i go about solving this?
    I need this database connection to pre-fill my form when the user downloads the form =(

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • Since installing the latest update, Firefox will not load; it gives me the following error -- XML Parsing Error: not well formed.

    since installing the latest update, Firefox first operated with some errors but now will not load at all; it gives me the following error --
    XML Parsing Error: not well formed
    locations chrome://browser/content/browser.xml
    Line Number 1191, column 20:
    utton id="back-forward-dropmarker" type="menu" chromedir="&locale.dir;"-------------------
    please note that the words "utton ID" are exactly as the error message gives it; and at the end of the message there are exactly 19 hyphens.
    I don't know why this faulty code is referencing things to do with "chrome"... the Chrome browser is not installed on this PC or anywhere on our network.
    Also, this is not the first problem I had after clicking Firefox's prompt for the latest update. Before Firefox retreated into this error message, it was loading but running with some faults...
    1. the bookmark symbol was not appearing on the right hand side of the URL line, so I had always to click on "bookmark this page", after which the bookmark symbol did appear; however I don't know if the bookmarking function worked properly.
    2. the back and forward buttons were not highlighted, as if I had not come from a previous page; so once I clicked on a link to a new page I could not go back to where I came from because Fiefox thought I hadn't come from anywhere.
    3. there may have been other errors, but I did not find them.
    How do I reinstate my Firefox program to work properly please? do I have to download the latest version and reinstal? if so, do I have to remove the old version first? or is there a fix?
    Even to write this message I have been forced to use (yuk -- I don't like to say this!!!) Internet Explorer. So please -- I need help urgently.
    Thanks,
    NOEL

    Some how I solved my problem by opening a user account and downloading Firefox 4.0 beta and installing it, I did try it, worked fine, so I did close the user account and did go back to my own account(switched user), the main page that I had problem with Firefox which would not open, I dabble click on Firefox it start working again!! I hope that solves your problem too.
    firefox will not open, it gives me this cod and would not turn off, Error on switching in renew: NS_ERROR_UNEXPECTED, Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref] id: none

  • Error message "Not Well Formed." Can this be repaired?

    Help!
    I have been attempting to open an InCopy (CS6) file, but it will not open. Instead, I get this error message:
    "Not Well Formed"
    Is there any way to repair this file? It was checked in and saved normally. If it cannot be repaired, I will lose about 1 month's worth of work because my backup has failed. I would appreciate any guidance

    Firefox has no built-in email features, if you are using Firefox to access your email it will be a web based email service and email features will be part of the email service. You will need to check with the support for the email service for how to do this.
    If this questions is about Thunderbird, for Thunderbird support you can ask in one of these forums:
    * http://forums.mozillazine.org/viewforum.php?f=39
    * http://getsatisfaction.com/mozilla_messaging

  • Error: "LPX-00240: element-start tag is not well formed"

    Hello all,
    i'm getting this error parsing a XML file:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00240: element-start tag is not well formed*
    Error at line 18
    What could be the issue in this case ???
    i'm running out of tryings and options for this solution....
    thank you all
    ---------------------- XML FILE -----------------------------
    <?xml version="1.0" encoding="iso-8859-1"?>
    <FormList>
         <Form name="SERVIDOES_REGLA_BASE" table="IVBAM.ANA_SERV_PEDIDOSPARECER" idfield="ID">
              <FormField name="ID" label="ID" datatype="LONG" type="TEXTFIELD" readonly="true" visible="false" mandatory="false" saveable="true" lovemtpy="false" multiselect="false"/>
         </Form>
         <Form name="PEDIDO_PARECER_UPDATE" table="IVBAM.ANA_SERV_PEDIDOPARECER" idfield="ID" help="sdfsf sdf sdf 4 43 43 3 4534 54 " usesession="true" geometryfield="GEOMETRY">
              <FormAction name="FORM_ACTION_01" function="2" help="true"><param name="CONFIRM" value="YES_NO" title="confirmar ??????"/>
                   <param name="LALLALA" value="dddd" title="ddddd"/>
              </FormAction>
    line 18:     <FormField name="NUM_ENTRADA" label="Número de entrada" datatype="STRING" type="TEXTFIELD" visible="false" mandatory="false" saveable="false" lov="Sim,Não" lovemtpy="false" maxlength="50" multiselect="false" />
         </Form>
    </FormList>
    -------------------------------------------------------------------

    <?xml version="1.0" encoding="iso-8859-1"?>
    <FormList>
    <Form name="SERVIDOES_REGLA_BASE" table="IVBAM.ANA_SERV_PEDIDOSPARECER" idfield="ID">
    <FormField name="ID" label="ID" datatype="LONG" type="TEXTFIELD" readonly="true" visible="false" mandatory="false" saveable="true" lovemtpy="false" multiselect="false"/>
    </Form>
    <Form name="PEDIDO_PARECER_UPDATE" table="IVBAM.ANA_SERV_PEDIDOPARECER" idfield="ID" help="sdfsf sdf sdf 4 43 43 3 4534 54 " usesession="true" geometryfield="GEOMETRY">
    <FormAction name="FORM_ACTION_01" function="2" help="true"><param name="CONFIRM" value="YES_NO" title="confirmar ??????"/>
    <param name="LALLALA" value="dddd" title="ddddd"/>
    </FormAction>
    line 18: <FormField name="NUM_ENTRADA" label="Número de entrada" datatype="STRING" type="TEXTFIELD" visible="false" mandatory="false" saveable="false" lov="Sim,Não" lovemtpy="false" maxlength="50" multiselect="false" />
    </Form>
    </FormList>

  • R12 - Format Payment Instructions XML Parsing Error: not well-formed

    We are going from 11.5.10 to R12,
    We followed the Note : 562806.1 to generate the XML file but we are getting the following error?
    XML Parsing Error: not well-formed
    Location: http://XXXXXXXXXXXXXX.com:8030/OA_CGI/FNDWRR.exe?temp_id=3412576704
    Line Number 1, Column 9:%PDF-1.4
    --------^
    Any help or suggestions would be great!
    Thanks

    Please see if the solution in (BI Publisher Reports End With Error When There Is An Ampersand Character ( & ) On The Xml Data File [ID 1081175.1]) is applicable.
    Thanks,
    Hussein

  • 0x8004005 / Error: Configuration file is not well-formed XML

    Hello,
    I am getting a complete headache from this! I uninstalled Visual Studio 2013 Ultimate and installed in on another hard drive. Since then nothing works! It seems to be an error with IIS...
    The following happens:
    When I want to create ASP.NET Empty Web Application:
    When I ceate an ASP.NET MVC 4 Web Application
    When I open an existing project:
    similar to first screenshot, can only upload 2 images...
    I already tried the following:
    Reinstalling Visual Studio Ultimate 2013 
    Reinstalling IIS Express 8
    Thanks!

    Hi,
    In order to resolve your problem. You should give us some information:
    First, is there any error occur when you install the VS or do you can successfully install the VS? You can use
    http://aka.ms/vscollect to gather the latest installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to
    https://Onedrive.live.com/ and share the link here.
    Second, the error may related to .NET FrameWork. You can use the tool in the link to check the .NET Framework Setup:
    http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx
    If there are something wrong, you should repair the .NET framework.
    At last, there is a blog related to the error, you can follow up to handle your issue:
    http://blogs.msdn.com/b/acoat/archive/2013/04/23/iisexpress-configuration-file-is-not-well-formed-xml.aspx
    Best Wishes!
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • XML Parsing Error: not well-formed (C# Visual Studio 2013)

    I am working on a project in visual studio that imports a csv, and exports an xml file. I'd like to be able to get the code to work as xml and html, and view it in a browser. I am getting this error when I load the xml file into a browser:
    Firefox
    XML Parsing Error: not well-formed Location: file:///C:/Users/fenwky/XmlDoc.xml Line Number 2, Column 6:?> -----^
    Chrome
    This page contains the following errors: error on line 2 at column 16: colon are forbidden from PI names 'xsl:transform'
    This is what my c# code looks like in visual studio 2013:
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Stylesheet
    String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    newPI = doc.CreateProcessingInstruction("abc:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Save document
    doc.Save(xmlfilename);

    Hi
    Kylee Fenwick,
    Could you show us your CSV file? And the code how do you imports a csv and exports an xml file?
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Hi Kristen,
    Thank you in advance for your healp. Here is my CSV file:
    Item Code;Item Description;Current Count;On Order
    A0001;"Wheels, Horse on";5;No
    A0002;"Wheels, Elephant on";2;No
    A0003;"Wheels, Dog on";0;Yes
    A0004;"Wheels, Seal on";3;No
    A0005;"Wheels, Bear on";7;No
    A0006;"Bear, Teddy";2;Yes
    A0007;"Clown,";5;No
    A0008;"Puppy(crouch),";3;No
    A0009;"Puppy(stand),";2;No
    A0010;"Puppy(jump),";2;Yes
    A0011;"Pupp(lying),";1;Yes
    A0012;"(50), Cart with Blocks";0;Yes
    A0013;"(100), Cart with Blocks";5;No
    A0014;"(200), Cart with Blocks";4;No
    A0015;"Carriage, Train with 0";12;No
    A0016;"Carriage, Train with 1";10;No
    A0017;"Carriage, Train with 2";5;Yes
    A0018;"Carriage, Train with 3";4;Yes
    A0019;"Carriage, Train with 4";5;No
    A0020;"Carriage, Train with 5";2;No
    A0021;"(20), Building Blocks";15;No
    A0022;"(30), Building Blocks";13;No
    A0023;"(40), Building Blocks";16;No
    A0024;"(50), Building Blocks";5;Yes
    A0025;"(100), Building Blocks";2;Yes
    A0026;"(200), Building Blocks";8;No
    A0027;"Windmill,";5;No
    A0028;"Farmhouse,";6;Yes
    A0029;"Fencing,";22;Yes
    A0030;"Barn,";12;Yes
    A0031;"Tractor,";6;Yes
    A0032;"Animals,";3;Yes
    A0033;"House,";9;No
    A0034;"Car,";12;No
    A0035;"(small), Building";4;No
    A0036;"(medium), Building";3;No
    A0037;"(tall), Building";4;No
    A0038;"Shop,";7;No
    A0039;"Lights, Traffic";5;Yes
    A0040;"Station, Petrol";4;Yes
    And here is my code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.OleDb;
    using System.Xml;
    using System.Xml.Xsl;
    using System.Xml.XPath;
    namespace CSVImporter
    public partial class CSVImporter : Form
    //const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml"; - file name and location of xml file
    const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml";
    // New code
    //const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml"; - file name and location of xsl file
    const string stylesheetsimple = @"C:\Users\fenwky\style1.xsl";
    //const string xmlfilecomplex = @"C:\Users\fenwky\XmlDoc2.xml";
    const string xmlfilecomplex = @"C:\Users\fenwky\XmlDoc2.xml";
    DataSet ds = null;
    public CSVImporter()
    InitializeComponent();
    // Create a Open File Dialog Object.
    openFileDialog1.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*";
    openFileDialog1.ShowDialog();
    string fileName = openFileDialog1.FileName;
    //doc.InsertBefore(xDeclare, root);
    // Create a CSV Reader object.
    CSVReader reader = new CSVReader();
    ds = reader.ReadCSVFile(fileName, true);
    dataGridView1.DataSource = ds.Tables["Table1"];
    private void WXML_Click(object sender, EventArgs e)
    WriteXML();
    public void WriteXML()
    StringWriter stringWriter = new StringWriter();
    ds.WriteXml(new XmlTextWriter(stringWriter), XmlWriteMode.WriteSchema);
    string xmlStr = stringWriter.ToString();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xmlStr);
    XmlDeclaration xDeclare = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.InsertBefore(xDeclare, doc.FirstChild);
    // Test code //
    // Load the style sheet.
    XslCompiledTransform xslt = new XslCompiledTransform();
    xslt.Load("style1.xsl");
    // Test code //
    // Transform the file and output an HTML string.
    string HTMLoutput;
    StringWriter writer = new StringWriter();
    xslt.Transform("XmlDoc.xml", null, writer);
    HTMLoutput = writer.ToString();
    writer.Close();
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Stylesheet
    // String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    String PItext = "<xsl:stylesheet xmlns:xls=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    // newPI = doc.CreateProcessingInstruction("abc:stylesheet", PItext);
    newPI = doc.CreateProcessingInstruction("xls:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Save document
    doc.Save(xmlfilename);
    private void btExportComplexXML_Click(object sender, EventArgs e)
    WriteXMLComplex();
    public void WriteXMLComplex()
    // Creates stringwriter
    StringWriter stringWriter = new StringWriter();
    ds.WriteXml(new XmlTextWriter(stringWriter), XmlWriteMode.WriteSchema);
    string xmlStr = stringWriter.ToString();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xmlStr);
    XmlDeclaration xDeclare = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.InsertBefore(xDeclare, doc.FirstChild);
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Uses XML transformation.
    String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    newPI = doc.CreateProcessingInstruction("xsl:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Saves document.
    doc.Save(xmlfilecomplex);
    //Creates a CSVReader Class
    public class CSVReader
    public DataSet ReadCSVFile(string fullPath, bool headerRow)
    string path = fullPath.Substring(0, fullPath.LastIndexOf("\\") + 1);
    string filename = fullPath.Substring(fullPath.LastIndexOf("\\") + 1);
    DataSet ds = new DataSet();
    try
    if (File.Exists(fullPath))
    string ConStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" + ";Extended Properties=\"Text;HDR={1};FMT=Delimited\\\"", path, headerRow ? "Yes" : "No");
    string SQL = string.Format("SELECT * FROM {0}", filename);
    OleDbDataAdapter adapter = new OleDbDataAdapter(SQL, ConStr);
    adapter.Fill(ds, "TextFile");
    ds.Tables[0].TableName = "Table1";
    foreach (DataColumn col in ds.Tables["Table1"].Columns)
    col.ColumnName = col.ColumnName.Replace(" ", "_");
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    return ds;

  • Xml parsing error: not well-formed (invalid token) (error code 4) - URGENT

    Hi all, i am doing an adobe form which requires me to pre-fill my form when a user downloads the form, but 1st i need a database connection, after creating a Data Source, i opened my intereactive form and created a new data connection, but after creating a data connection and i click on the preview tab, i will receive this error:
    'Xml parsing error: not well-formed (invalid token) (error code 4), line 444, column 1 of file'
    It really is a headach for me, i tried many ways of creating a database connection to my MS SQL 2005 database but failed, can anyone tell me why is am i receiving this error? and can someone guide me on solving this problem?
    POINTS AWARDED HANDSOMELY IF ANYONE IS WILLING TO HELP ME
    Thanks in advance

    Hi all, i am doing an adobe form which requires me to pre-fill my form when a user downloads the form, but 1st i need a database connection, after creating a Data Source, i opened my intereactive form and created a new data connection, but after creating a data connection and i click on the preview tab, i will receive this error:
    'Xml parsing error: not well-formed (invalid token) (error code 4), line 444, column 1 of file'
    It really is a headach for me, i tried many ways of creating a database connection to my MS SQL 2005 database but failed, can anyone tell me why is am i receiving this error? and can someone guide me on solving this problem?
    POINTS AWARDED HANDSOMELY IF ANYONE IS WILLING TO HELP ME
    Thanks in advance

  • Every time I launch Firefox it pops up an error stating "Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem."

    Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem.
    The statement above is in the pop up error box every time, when I launch Firefox. If I click ok in the box Firefox then opens. How do I fix this initializing/launch problem?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")<br />

Maybe you are looking for

  • Inserting flash in Dreamweaver.

    now I have seen tutorials over and over and I have done this website 3 times now. I do the div's first at then I do make an editable region and save the template. Then I do the pages. Then I go to the left middle div to insert the flash (in the templ

  • Installing oracle 10g and 9i

    Firstly, When i was runing the oracle 10g installation for winxp, I was the following error :"c:\temp\orainstall_10-02-04. Please be sure that this directory is writable and has at least 45MB of disk space". Then I check this directory and there was

  • Expected Hardware requirements

    Hi Experts, Currently my system is running on SAP4.7, DB -> Oracle 10g 10.2.0.4, OS -> HP-UX 9000/800 Our current DB size is 4 TB. I would like to know how we can plan the expected Hardware requirements(like CPU, RAM)  size would be 10 TB considering

  • Mac seems to print larger than Windows!

    Im still fairly new to a Mac having been a Windows PC user for years. I certainly like what I've seen so far. Reasonably competent with Photoshop CS3 and have loaded Mac version. I have 24" iMac with latest Leopard. Main printer is Epson R2400 but al

  • Incompatibilities with Mac OSX 10.9

    Is it possible to revert back to an older version of system software since 10.9 makes my Photoshop incompatible?