Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9176323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:05:10+00:00 2026-06-17T17:05:10+00:00

I am integrating against Magento ecommerce using their SOAP api, and the API returns

  • 0

I am integrating against Magento ecommerce using their “SOAP” api, and the API returns “XML” results. Problem is, this is not always well formed:

<product>
   <entity_id>18</entity_id>
   <price regular="2925  <span>Nok</span>"/>
   ...

In this specific case, the price regular attribute has both an invisible character 0xa0 (before the span tag), and < > within the attribute text.

I have no way to get proper well-formed XML from Magento it seems, so the alternative is to clean it up before I feed it to my XmlSerializer deserialization:

XmlSerializer serializer = new XmlSerializer(typeof(Responses.Product.product));
product = serializer.Deserialize(textReader) as Responses.Product.product;

The invisible character I can get rid of using a simple text replace, but I’m more unsure about the <> within the attribute text.

My question is, how to clean it up for be valid XML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:05:11+00:00Added an answer on June 17, 2026 at 5:05 pm

    The character 0x3c is the < character. For an invisible character you would rather be looking for something like the 0x09 TAB character.

    To fix the broken markup you could look for that specific HTML tag in the content, using a regular expression to allow any currency within the tag:

    xml = Regex.Replace(xml, "<span>([A-Za-z]{3})</span>", "&lt;span&gt;$1&lt;/span&gt;");
    

    This works as long as there isn’t any span elements in the XML code itself, with a three character content. You could do similar replacements for other HTML tags, but try to keep the pattern as specific as possible, to avoid false positives.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm integrating my site with another website using their API. From one of the
I am integrating the MailChimp API into my app and am using a UserObserver
I am integrating Janrain Import contacts in my Cakephp Project. While Using Janrain API
I'm trying to test my backbone front-end using Jasmine against our back-end API. Our
I am using PDO against an Oracle server and pulling query results into a
I am integrating a WordPress template. But my category list is repeating again. This
I am working on integrating scapy with twisted, but I ran into this very
I am integrating an app with a service (iContact), that describes its API as
I am looking at integrating asp.net web api in to my web application as
I'm working on integrating OpenID with my own authentication Stack for Django. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.