xml error in ajax

ajax , xml India
  • 10 years ago
    hiii,
    if there is no one can who can solve my problem.
    i have and error in ajax. and ie xml declaration not at start of external entity.
    how i can remove it.
    thanks


    XML Parsing Error: xml declaration not at start of external entity
    Location: http://192.168.1.6/idoweddings/index.php?_act=manageWeddingRequest1API&DO=getState&id=6
    Line Number 1, Column 2:    <?xml version='1.0' encoding='iso-8859-1'?><list_data>    <id>1</id>    <name>England</name>    <id>2</id>    <name>France</name>    <id>3</id>    <name>Germany</name>    <id>4</id>    <name>Italy</name></list_data>
    --------^

    thanks again
    vineet












  • 10 years ago
    Try this for your XML data, it's more readable:

    <?xml version="1.0" encoding="iso-8859-1"?>

    <list_data>

        <entry>
            <id>1</id>
            <name>England</name>
        </entry>

        <entry>
            <id>2</id>
            <name>France</name>
        </entry>
       
        <entry>
            <id>3</id>
            <name>Germany</name>
        </entry>

        <entry>
            <id>4</id>
            <name>Italy</name>
        </entry>
       
    </list_data>

    Then you just parse each 'entry'.

    One note: the <?xml ?> MUST be the FIRST thing in the file (no space, tab etc... before it).































Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”