locked
XML Encoding Issue [Illegal characters in path.] RRS feed

  • Question

  • Hello All,

    I have stored XML in DB.

    <?xml version="1.0" encoding="utf-8"?>
    <RxChangeRequest xmlns="http://www.surescripts.com/messaging"> 

      <MedicationRequested>
        <DrugDescription>felbamate</DrugDescription> 
      </MedicationRequested>
    </RxChangeRequest>

    i am unable to retrieve it, it says "Illegal characters in path"

    hist.RequestXML = Convert.ToString(dr(
    "RequestXML"))


    Is it because of Encoding Issue??

    Please help me






     












    Many Thanks Deepak
    Monday, March 15, 2010 7:37 AM

Answers

  • I don't think so, but why do you convert it anyway, it should be already a string


    Success
    Cor
    • Marked as answer by Jeff Shan Monday, March 22, 2010 2:04 AM
    Monday, March 15, 2010 7:52 AM
  • Like Cor - I seriously doubt that it is an encoding issue, especially since utf-8 is the encoding inserted by default by vs  :)  Your xml looks valid...  Is that all of the code?  What is hist.RequestXml?  What is it doing?  The message you are getting looks suspiciously like the one you get when you pass an xml string to XmlDocument.Load  rather then XmlDocument.LoadXml....



    Tom Shelton
    • Marked as answer by Jeff Shan Monday, March 22, 2010 2:04 AM
    Monday, March 15, 2010 8:02 AM

All replies

  • I don't think so, but why do you convert it anyway, it should be already a string


    Success
    Cor
    • Marked as answer by Jeff Shan Monday, March 22, 2010 2:04 AM
    Monday, March 15, 2010 7:52 AM
  • Like Cor - I seriously doubt that it is an encoding issue, especially since utf-8 is the encoding inserted by default by vs  :)  Your xml looks valid...  Is that all of the code?  What is hist.RequestXml?  What is it doing?  The message you are getting looks suspiciously like the one you get when you pass an xml string to XmlDocument.Load  rather then XmlDocument.LoadXml....



    Tom Shelton
    • Marked as answer by Jeff Shan Monday, March 22, 2010 2:04 AM
    Monday, March 15, 2010 8:02 AM
  • Yes TOM,

    hist is class Object.

    It has Property called RequestXML.

    I am assigning from DATASET to Object as follow

    hist.RequestXML = dr("RequestXML")

    Then I am trying to store it in DOM as follow

     

    Dim ChangeRequestXML As System.Xml.XmlDocument

    ChangeRequestXML.Load(hist.RequestXML)

    Here it throws error..





    Many Thanks Deepak
    Monday, March 15, 2010 8:07 AM
  • You need to change your ChangeRequestXML.Load to ChangeRequestXML.LoadXml.  Load is looking for a file name - you are not loading a file, but a string containing the xml.


    Tom Shelton
    Monday, March 15, 2010 4:23 PM