Advertisement

09.12.2008 at 08:44AM PDT, ID: 23726823
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.1

XML Difficulties, unexpected token?

Asked by kidl33t in Visual Basic Programming

Tags: , ,

Hello,

I have a program that sends HTML formatted emails.  It reads in an HTML file and inserts variables into span tags that are formatted with IDs.  For example <span id="fname"></span> will get its contents replaced with a users first name.  This all works fine.

The function which does the subbing in is the first one in the code section.  

However, when one of the values to be inserted has an & in it, followed at any distance by an equals ( = ) sign, it throw the exception " '=' is an unexpected token,  The expected token is ';'.  Line 2, position 74. "

The offending line in question is:

<li> <a href="http://www.google.ca/search?rlz=1C1GGLS_en-USCA291&sourceid=chrome&ie=UTF-8&... (it continues on)

Where the character in question is the = before the word chrome (incidentally, yes I am playing with Chrome at the moment).  

This bit of code is actually inserting a list of links, and works fine when no &'s are in the links.  I tried URLencoding the links, or just replacing the & with %26, but sadly that breaks the link (at least for google maps).  

Any ideas?  Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
Private Sub replaceSpanContents(ByRef xDoc As Xml.XmlDocument, ByVal id As String, ByVal content As String)
        Dim el As Xml.XmlNodeList = xDoc.SelectNodes("//span[@id='" + id + "']")
        For Each n As Xml.XmlNode In el
 
            Try
                n.InnerXml = content.ToString
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical, "XML Exception")
            End Try
        Next
    End Sub
 
Loading Advertisement...
 
[+][-]09.12.2008 at 09:17AM PDT, ID: 22461317

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: Microsoft, Visual Studio, 2005
Sign Up Now!
Solution Provided By: c0ldfyr3
Participating Experts: 1
Solution Grade: B
 
 
[+][-]09.12.2008 at 09:17AM PDT, ID: 22461322

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.12.2008 at 09:39AM PDT, ID: 22461532

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.12.2008 at 09:50AM PDT, ID: 22461635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.12.2008 at 09:59AM PDT, ID: 22461720

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.12.2008 at 12:45PM PDT, ID: 22463224

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.15.2008 at 08:45AM PDT, ID: 22479812

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.15.2008 at 01:31PM PDT, ID: 22482534

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.15.2008 at 03:28PM PDT, ID: 22483471

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628