473,792 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

encoding problem

freddieMaize
85 New Member
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 4490
freddieMaize
85 New Member
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 Recognized Expert Moderator Expert
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
freddieMaize
85 New Member
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
49361
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 Java VM is different from the OpenCms encoding! Java VM file encoding: UTF-8
8
2817
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 object, it is encoded in utf-8 automatically. It can be a problem when I'm building an interactive environment using "compile", with a different encoding from utf-8. IDLE itself has the same problem. ( '<a string with non-ascii-encoding>' is...
7
4974
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 windows-1252 and that it is not equivalent to iso-8859-1. Looking in the registry under HKEY_CLASSES_ROOT\MIME\Database\Charset and \Codepage, it seems that all variations on iso-8859-1 (latin1, etc) are mapped to code page 1252, which I'm...
8
2496
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 I'm identifying the encoding type. Here is the problem, some type of UTF-8 encoded file does'nt have BOM in the starting. So I'm identying the file as iso-8859-1 encoded which is actually encoded in UTF-8. I dont have much idea about the...
8
607
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 resulting xml ends up with the following declaration: <?xml version="1.0" encoding="utf-16"?> changing the encoding to utf-16, is there something I'm doing wrong? Is it
4
8852
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 version="1.0" encoding="utf-8" ?>... - ... I am using the WebRequest functionality to get the feeds. So, my code
5
3513
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 (where "MyWebSvcName" is the name of my web service). I don't know how to assign value to this parameter. (I'm using VB.NET 2003.) Here are some sample codes:
0
3635
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 value (which varies depending on the data being written), characters not available in the encoding specified in the Encoding property of the XmlWritterSettings instance used to create the XmlWriter are being written to the resulting XML document as...
3
2492
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 typed dataset tableadaptor). In that case, I have a problem: what encoding do I use to conver the byte (or memorystream) into a string? The encoding is in the file, of course, like any XML file, but how do I find out which? I tried using an...
23
5030
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 from another HTML page viewed in IE7, that is also UTF-8 encoded (search for "china" on google.com). I paste the chineese chars into a content editable div. My Ajax webservice compiles an XML where the data from the content editable div is...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9033
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.