encoding problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freddieMaize
    New Member
    • Aug 2008
    • 85

    encoding problem

    Hi,

    I'm need to build an XML which i'd use to feed datas to a Search Engine Server for Indexing purpose.

    Below is a valid XML that i have,
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <documents>
    <document>
    <title>Brazil</title>
    <element name="body">
    <value>Brazil (Portuguese: Brasil), officially the Federative Republic of Brazil (Portuguese: República Federativa do Brasil) is a country...value>
    </element>
    <element name="url">
    <value>http://uxm-searchsrv.corp.satyam.ad:8082/ESP/Geo_Docs/Countries_Info/Brazil.html</value>
    </element>
    <element name="urls">
    <value>http://uxm-searchsrv.corp.satyam.ad:8082/ESP/Geo_Docs/Countries_Info/Brazil.html</value>
    </element>
    <element name="lat">
    <value>15.40</value>
    </element>
    <element name="lon">
    <value>47.57</value>
    </element>
    </document>
    But i tried the below,
    copy all the content from http://en.wikipedia.org/wiki/Brazil and paste it in the <value> tag...

    The parse was showing error after error (I mean, it'd show an error, i would make the correction, and this would repeat...)

    I also took off the "encoding=" utf-8" and tried... then too it was showing some error... I'm not mentioning the exact errors becasue they were many in numbers. But all were general errors like, "invalid char", "white space" etc.....

    Right now, after taking off the encoding, i'm getting, "Whitespace is not allowed at this location. Error processing resource 'file:///D:/MyFolder/Fast/Geo_Docs/Countries_Info/Cou..."

    Can any one help me out...

    Thank you
  • freddieMaize
    New Member
    • Aug 2008
    • 85

    #2
    Okay Fine... I some how managed and right now when i open my XML file with IE, its showing the whole XML... This is one way to check the well formness of XML. Am I correct?? Sorry if this is very trival!

    Now, when I tried to use this XML (as mentioned above), I get an exception saying,
    Code:
    [2008-08-30 16:11:39.625] ERROR      systemmsg A fatal error occurred while pars
    ing 'F:\Docs\ESP\Geo_Docs\Cities\Cities2.xml': SAXParseException: F:
    \Docs\ESP\Geo_Docs\Cities\Cities2.xml:1:1: not well-formed (invalid
    token)

    Any Suggestions???
    -------------------------------------------------
    I hate working on the weekends (especially being a novice at the work which I’m assigned to)... See... There would be none to help when one is stuck...

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      some links where you can do validation:
      w3c validator
      xmlvalidation
      by using the xml you put as an example:
      - closing root element missing (</documents>)
      - (writing mistake, line 6) missing closing element (</value> was truncated)

      Comment

      • freddieMaize
        New Member
        • Aug 2008
        • 85

        #4
        Thanks pal.

        Got my problem fixed. Thanks
        fREDDIE mAIZE

        Comment

        Working...