Wrong XML Format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tamir Khason

    Wrong XML Format

    After serialization XMLNode recieved consist of \" signs instead of ". So it
    can not be parsed and processed. How to get rid of it?

    --
    Tamir Khason
    You want dot.NET? Just ask:
    "Please, www.dotnet.us "



  • Nick Malik

    #2
    Re: Wrong XML Format

    please provide an example of what was produced, what was expected, and the
    code that produced it.
    --- Nick

    "Tamir Khason" <tamir-NOSPAM@tcon-NOSPAM.co.il> wrote in message
    news:u0PmuueYEH A.2908@TK2MSFTN GP10.phx.gbl...[color=blue]
    > After serialization XMLNode recieved consist of \" signs instead of ". So[/color]
    it[color=blue]
    > can not be parsed and processed. How to get rid of it?
    >
    > --
    > Tamir Khason
    > You want dot.NET? Just ask:
    > "Please, www.dotnet.us "
    >
    >
    >[/color]


    Comment

    • Kevin Yu [MSFT]

      #3
      Re: Wrong XML Format

      Hi Tamir,

      First of all, I would like to confirm my understanding of your issue. From
      your description, I understand that the quotes were serialized to \" in
      your application. If there is any misunderstandin g, please feel free to let
      me know.

      As far as I know, quote will not be coverted to \" in the serialization.
      Could you try to open the xml file after serialization in Notepad and check
      it again? If the problem still persists, could you provide us an example as
      Nick mentioned, so that we can deliver our assistance more quickly?

      If anything is unclear, please feel free to reply to the post.

      Kevin Yu
      =======
      "This posting is provided "AS IS" with no warranties, and confers no
      rights."

      Comment

      • Tamir Khason

        #4
        Re: Wrong XML Format

        I think that I know what is a problem, however following the method wich
        called it

        SomeClass.Seria lizer ser = new SomeClass.Seria lizer();

        System.Xml.XmlD ocument doc = new System.Xml.XmlD ocument();


        doc.AppendChild (doc.ImportNode (SomeOtherClass .GetObjectsData (),true)); //
        return serialized XML Node

        return ser.DeSerialize (doc); //make deserialization

        -------------------------

        Strange thing,

        doc.InnerXML == doc.OuterXml.

        The XML was previously serialized and saved:

        Here is the beginning of this XML

        doc.OuterXml "<TESTData xmlns:xsd=\"htt p://www.w3.org/2001/XMLSchema\"
        xmlns:xsi=\"htt p://www.w3.org/2001/XMLSchema-instance\" xmlns=\"Some
        Processes\"><Pr ocessCollection Name=\"Process
        1\"><ObjectStat e>Null</ObjectState><Na mes
        Name=\"Boba\">< ObjectState>Nul l</ObjectState><SI G><p1>10</p1><p2>169</p2><p3[color=blue]
        >2</p3><p4>1</p4></SIG><Position>< PinX>0</PinX><PinY>0</PinY></Position></Na[/color]
        mes>" string

        etc...etc As you can see all " are covered by \

        What to do. Desiarilization failed on

        There is an error in XML document (1, 2). --->

        System.InvalidO perationExcepti on:

        <TESTData xmlns='TestName Space'> was not expected.

        Why it need it???





        --
        Tamir Khason
        You want dot.NET? Just ask:
        "Please, www.dotnet.us "


        "Kevin Yu [MSFT]" <v-kevy@online.mic rosoft.com> wrote in message
        news:7Q%23VtTjY EHA.3208@cpmsft ngxa06.phx.gbl. ..[color=blue]
        > Hi Tamir,
        >
        > First of all, I would like to confirm my understanding of your issue. From
        > your description, I understand that the quotes were serialized to \" in
        > your application. If there is any misunderstandin g, please feel free to[/color]
        let[color=blue]
        > me know.
        >
        > As far as I know, quote will not be coverted to \" in the serialization.
        > Could you try to open the xml file after serialization in Notepad and[/color]
        check[color=blue]
        > it again? If the problem still persists, could you provide us an example[/color]
        as[color=blue]
        > Nick mentioned, so that we can deliver our assistance more quickly?
        >
        > If anything is unclear, please feel free to reply to the post.
        >
        > Kevin Yu
        > =======
        > "This posting is provided "AS IS" with no warranties, and confers no
        > rights."
        >[/color]


        Comment

        • Kevin Yu [MSFT]

          #5
          Re: Wrong XML Format

          Hi Tamir,

          Could you let me know, where did you check the content of doc.OuterXml? Did
          you check it in the watch window? If so, the " were not converted at all,
          the \ was added only for display. If you put the OuterXml into a TextBox
          for display, you will not see the \.

          Kevin Yu
          =======
          "This posting is provided "AS IS" with no warranties, and confers no
          rights."

          Comment

          • Tamir Khason

            #6
            Re: Wrong XML Format

            You are right. The REAL problem described at my post with title : "
            De/Serialization problem

            " at 05-Jul-04

            Please assist with it, if you can

            --
            Tamir Khason
            You want dot.NET? Just ask:
            "Please, www.dotnet.us "


            "Kevin Yu [MSFT]" <v-kevy@online.mic rosoft.com> wrote in message
            news:sh%231rMzY EHA.600@cpmsftn gxa06.phx.gbl.. .[color=blue]
            > Hi Tamir,
            >
            > Could you let me know, where did you check the content of doc.OuterXml?[/color]
            Did[color=blue]
            > you check it in the watch window? If so, the " were not converted at all,
            > the \ was added only for display. If you put the OuterXml into a TextBox
            > for display, you will not see the \.
            >
            > Kevin Yu
            > =======
            > "This posting is provided "AS IS" with no warranties, and confers no
            > rights."
            >[/color]


            Comment

            Working...