473,385 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

encoding problem

freddieMaize
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,
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <documents>
  3. <document>
  4. <title>Brazil</title>
  5. <element name="body">
  6. <value>Brazil (Portuguese: Brasil), officially the Federative Republic of Brazil (Portuguese: República Federativa do Brasil) is a country...value>
  7. </element>
  8. <element name="url">
  9. <value>http://uxm-searchsrv.corp.satyam.ad:8082/ESP/Geo_Docs/Countries_Info/Brazil.html</value>
  10. </element>
  11. <element name="urls">
  12. <value>http://uxm-searchsrv.corp.satyam.ad:8082/ESP/Geo_Docs/Countries_Info/Brazil.html</value>
  13. </element>
  14. <element name="lat">
  15. <value>15.40</value>
  16. </element>
  17. <element name="lon">
  18. <value>47.57</value>
  19. </element>
  20. </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
Aug 30 '08 #1
3 4475
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,
Expand|Select|Wrap|Line Numbers
  1. [2008-08-30 16:11:39.625] ERROR      systemmsg A fatal error occurred while pars
  2. ing 'F:\Docs\ESP\Geo_Docs\Cities\Cities2.xml': SAXParseException: F:
  3. \Docs\ESP\Geo_Docs\Cities\Cities2.xml:1:1: not well-formed (invalid
  4. 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...
Aug 30 '08 #2
Dormilich
8,658 Expert Mod 8TB
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)
Aug 31 '08 #3
Thanks pal.

Got my problem fixed. Thanks
fREDDIE mAIZE
Sep 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ann | last post by:
Hi, Is there any way to Change encoding of Java Vm to ISO-8859-1? i am using Java vm along with an application called opencms. I get the following error message.. Error: the encoding of your...
8
by: janeaustine50 | last post by:
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode...
7
by: Mark | last post by:
Hi... I've been doing a lot of work both creating and consuming web services, and I notice there seems to be a discontinuity between a number of the different cogs in the wheel centering around...
8
by: davisjoseph | last post by:
Hi All, I'm newbie to this XML world. My problem is to identify the encoding type of XML at runtime. What currently I'm doing is checking whether BOM is available in the XML; based on the BOM...
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
4
by: fitsch | last post by:
Hi, I am trying to write a generic RSS/Atom/OPML feed client. The problem is, that those xml feeds may have different encodings: - <?xml version="1.0" encoding="ISO-8859-1" ?>... - <?xml...
5
by: James Wong | last post by:
Dear all, I've a web service function and it contains a parameter in System.Text.Encoding. I found that the data type of this parameter in caller application becomes MyWebSvcName.Encoding...
0
by: Janusz Nykiel | last post by:
I've stumbled upon unexpected behavior of the .NET 2.0 System.Xml.XmlWriter class when using it to write data to a binary stream (System.IO.Stream). If the amount of data is less than a certain...
3
by: Martin Z | last post by:
Hi, I have an application that involves sending a lot of XML data to various places. The problem is that once in a while, I just want the XML document as a string (for example, sending to a...
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.