473,403 Members | 2,183 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,403 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 4477
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.