BookmarkSubscribeRSS Feed
kaziumair
Quartz | Level 8

Hi everyone , 

I am trying to parse an XML file , but getting the following error in SAS Studio 

Character is unclassifiable. XML parsing error. Please verify that the XML content is well-formed.

I am generating an XML map using the SAS XML Mapper . It is also giving the following error when I open the same XML file.

An invalid XML character (Unicode: 0x19) was found in the element content of the document.

On checking the XML file in Notepad++ I noticed that there is one character which is different and might be the problem .

I tried changing the encoding but it did not work. Please find attached, the XML file section where the character is present .

I have highlighted the character in the sentence.

"SCREEN PRINT: Boity Thulo, Catherine Grenfell and Zama Dube in Marie Claires annual Issue."

<media:thumbnail url="https://www.citizen.co.za/wp-content/uploads/2014/02/Boity-Thulo1-150x150.jpg" />
		<media:content url="https://www.citizen.co.za/wp-content/uploads/2014/02/Boity-Thulo1.jpg" medium="image">
			<media:title type="html">Boity Thulo</media:title>
			<media:description type="html">SCREEN PRINT: Boity Thulo,  Catherine Grenfell and Zama Dube in Marie Claires annual Issue. Picture tweeted by @AMBgirls</media:description>
			<media:thumbnail url="https://www.citizen.co.za/wp-content/uploads/2014/02/Boity-Thulo1-150x150.jpg" />
		</media:content>
<media:content xmlns:media="http://search.yahoo.com/mrss/" medium="image" type="image/jpeg" url="https://www.citizen.co.za/wp-content/uploads/2013/10/boity-thulo-e1472977723303.jpg" width="800" height="727" ></media:content>	</item>
		<item>
		<title>Lloyd Cele opens up about his life</title>
		<link>https://www.citizen.co.za/entertainment/celebrity-news/129870/a-vision-achieved/</link>
					<comments>https://www.citizen.co.za/entertainment/celebrity-news/129870/a-vision-achieved/#comments</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 19 Feb 2014 04:00:00 +0000</pubDate>
				<category><![CDATA[Celebs And Viral]]></category>
		<category><![CDATA[entertainment]]></category>
		<category><![CDATA[idols sa]]></category>
		<category><![CDATA[musician]]></category>
		<guid isPermaLink="false">https://www.citizen.co.za/129870/a-vision-achieved/</guid>

					<description><![CDATA["Keep breathing, Lloyd. I thought about my wife, my son. I thought about the other two contestants. I thought about my dream of being a musician; a songwriter; an artist. Finally, ProVerb exhaled, 'The Top 2 Finalists are: Lloyd Cele and Elvis Blue!'"]]></description>
										<content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>This is how Cele begins a chapter in his autobiography The Dream Of An Idol. Being in the top two of Idols SA, Cele thought he was close to his dream &ndash; he would finally be the superstar he had dreamed of being since he was a child. But little did he know, that the hard work was only just about to begin.</p>
<p>&ldquo;When I was on Idols I was unemployed and I was behind on all my payments,&rdquo; explains Cele.</p>
<p>&ldquo;I was pouring my heart out every week on the Idols stage, yet it hurt me that I couldn&rsquo;t even afford to send money to my family to come and support me every week.&rdquo;</p>
<p>These were only some of the challenges that Cele was faced with. While his book aims to inspire aspiring musicians, Cele also opens up about the harsh realities behind the glamorous facade of Idols and the entertainment industry as a whole.</p>
<p>&ldquo;When you&rsquo;re on a big show like Idols, you assume that contestants who made it to the top five would be offered recording deals left right and centre,&rdquo; explains Cele.</p>
<div id="attachment_129872" style="width: 810px" class="wp-caption aligncenter"><a href="https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417.jpg"><img aria-describedby="caption-attachment-129872" class="size-full wp-image-129872 img-fluid" alt="JOVIAL. Lloyd Cele's upbeat nature has helped him handle the hard work involved in making a name for himself. Picures: Supplied." src="https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417.jpg" width="800" height="600" srcset="https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417.jpg 800w, https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417-300x225.jpg 300w, https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417-130x98.jpg 130w, https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417-588x441.jpg 588w, https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417-533x400.jpg 533w, https://www.citizen.co.za/wp-content/uploads/2014/02/Lloyd-Bianca-068A_606576417-272x204.jpg 272w" sizes="(max-width: 800px) 100vw, 800px"></a><p id="caption-attachment-129872" class="wp-caption-text">JOVIAL. Lloyd Cele&rsquo;s upbeat nature has helped him handle the hard work involved in making a name for himself. Picures: Supplied.</p></div>
<p>&ldquo;But obviously this is not the case. I was runner-up and every single recording label I approached rejected me.&rdquo;</p>
<p>&ldquo;The music industry is just not big enough for all of us,&rdquo; says Cele.</p>
<p>&ldquo;After the show is over, people always ask: &lsquo;What happened to the winner? Why didn&rsquo;t they release an album?&rsquo;, but the truth is, after Idols you are on your own. If you don&rsquo;t push yourself, no one else will.&rdquo;</p>
<p>And push himself he did. Instead of giving up after the competition, Cele continued to pursue his dream independently. He and Elvis Blue &ndash; who ultimately won that season &ndash; had made a pact to split the R500 000 cash prize regardless of who won.

Please suggest a way to overcome this.

Thanks and Regards,

Mohammad Umair Kazi

1 REPLY 1
ballardw
Super User

It may be more helpful to provide the code you are using to invoke the xml mapper. It may also help to show just how you attempted to change encoding.

 

Please look at the posted text and see if you see any different characters. The text box may have been set to modify whatever your have that is odd in the file. I had to copy from the text and paste into a different editor to see that there is supposed to be a character likely some form of single quote to make an equivalent of Claire's.

 

I might suggest a simple text editor and replace the character with a single quote unless you have multiple files like this.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1071 views
  • 0 likes
  • 2 in conversation