Results 1 to 5 of 5

Thread: & (Ampersand) causes XML problems

  1. #1
    mmunem is offline Junior Member
    Join Date
    Aug 2007
    Posts
    2

    Default & (Ampersand) causes XML problems

    Hi,

    I am using Sugarcrm Version 4.5.1e (Build 1049). When I created a new contact and enter the ampersand character "&" in the name fields or if I type in "&", it is stored simply as "&". This causes problems with our xml phone directories (Cisco 7940).

    e.g.

    I created a new contact: Firstname: Jane. Lastname: & Doe

    The Cisco phones throw up CFXML errors and if I try and access the directory url, I get this error (in Firefox):

    e.g. http://10.10.10.10/cisco/services/PhoneDirectory.php

    //begin//

    XML Parsing Error: not well-formed
    Location: http://10.10.10.10/cisco/services/PhoneDirectory.php
    Line Number 5, Column 8:<Name>& Doe, Jane</Name>
    -------^

    /begin/

    Now if I manually edit the database record and change the & to Jane &amp; Doe, it works find.

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: & (Ampersand) causes XML problems

    Sounds like you found a problem with in the Cisco stuff in that they are not XML exconding the data when they retrieve it.

    Have you reported the problem to Cisco?
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default Re: & (Ampersand) causes XML problems

    Quote Originally Posted by mmunem
    Hi,

    I am using Sugarcrm Version 4.5.1e (Build 1049). When I created a new contact and enter the ampersand character "&" in the name fields or if I type in "&amp;", it is stored simply as "&". This causes problems with our xml phone directories (Cisco 7940).

    e.g.

    I created a new contact: Firstname: Jane. Lastname: & Doe

    The Cisco phones throw up CFXML errors and if I try and access the directory url, I get this error (in Firefox):

    e.g. http://10.10.10.10/cisco/services/PhoneDirectory.php

    //begin//

    XML Parsing Error: not well-formed
    Location: http://10.10.10.10/cisco/services/PhoneDirectory.php
    Line Number 5, Column 8:<Name>& Doe, Jane</Name>
    -------^

    /begin/

    Now if I manually edit the database record and change the & to Jane &amp; Doe, it works find.

    Yeah, & is not a valid XML character.
    it should be &amp;

  4. #4
    mmunem is offline Junior Member
    Join Date
    Aug 2007
    Posts
    2

    Default Re: & (Ampersand) causes XML problems

    Quote Originally Posted by sacramentojoe
    Yeah, & is not a valid XML character.
    it should be &amp;
    Can you offer any advice on automatically storing any entered "&" character as "&amp;" in the backend mysql table?

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: & (Ampersand) causes XML problems

    PHP offers a function that will URL encode it for you, which might be sufficient for your needs.

    Further info is available here: http://us3.php.net/manual/en/function.urlencode.php

    Keep in mind that you'll have to do the reverse to decode it, otherwise Sugar will display it as &amp; too...
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2007-02-03, 12:05 AM
  2. Inbound E-Mail, problems, problems, problems ...
    By Ericmuc in forum General Discussion
    Replies: 5
    Last Post: 2006-08-16, 10:24 AM
  3. Replies: 0
    Last Post: 2006-08-01, 11:24 AM
  4. problems With XML parser
    By Archylus in forum Help
    Replies: 1
    Last Post: 2006-03-24, 05:41 PM
  5. problems with scheduler and times
    By rendezvous in forum Help
    Replies: 1
    Last Post: 2005-12-15, 02:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •