Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to remove NS0: from XML

    I have a request XML that generates as below -
    Code:
         <ns0:userID>Someusername</ns0:userID>
         <ns0:password>Somepassword</ns0:password>
         <ns0:refcode>0123456789</ns0:refcode>
    The issue is that because of NS0: the web service fails. If i remove ns0: exmaple sending below in request
    Code:
         <userID>Someusername</userID>
         <password>Somepassword</password>
         <refcode>0123456789</refcode>
    The web service responds correctly.

    So my question is how to remove the NS0: without modifying anything in XSD.
    Last edited by Alex Vincent; Apr 26th, 2018 at 03:05 AM. Reason: adding code tags

  2. #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,520
    Thanks
    1
    Thanked 24 Times in 22 Posts
    I'm slightly confused: is your client receiving or sending this XML?

    If it's receiving, and your XML document is parsed into a Document Object Model before your code sees it, you might be in a bad position here. It's much harder to manipulate DOM namespaces than to do a simple text-search-and-replace operation.

    Can you show us the code generating this markup?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


 

Tags for this Thread

Posting Permissions

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