Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Dealing with special characters in XML files read by vb script

Avatar of Cerixus
CerixusFlag for United States of America asked on
ProgrammingVisual Basic ClassicVB Script
2 Comments1 Solution760 ViewsLast Modified:
I have a script that runs that imports a bunch of XML files.  One of the elements it grabs frequently has special characters (for example, "ç").  When the import script processes this XML file, it errors out with the following message:

Error #-1072896760  An invalid character was found in text content.

Is there any way to catch this on the import?  I know on the export I could manually replace "ç" with "c", but I don't want to do that for every character.  I'd even be happy with catching them all on the export, though would prefer doing it on the import.  The readelement function is attached.  Any tips would be appreciated.
Public Function ReadElement(element)
	on error resume next
	Set objNodeList = xmlDoc.getElementsByTagName(element) 
	
	If objNodeList.length > 0 then 
		For each x in objNodeList 
			ReadElement = x.Text
		Next 
	Else 
		ReadElement = ""
	End If
	if Err.Number <> 0 then 
		errornumber = Err.Number
		errormessage = Err.Description
		logError WMIGetLocalName(),errornumber,errormessage,"ReadElement()"
		Err.Clear
	end if	
end function
ASKER CERTIFIED SOLUTION
Avatar of ltlbearand3
ltlbearand3Flag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers