locked
why &gt &lt being added instead of > < symobles in xml node text? RRS feed

  • Question

  • User-1623675128 posted

    Hi, i have a string whic h has query which in turn has < > sybmols (sql query)

    in code I am creating a xml document with one element <sql>pass here the string that we have above<sql>;

    the moment we add the sql stirng into XML node the symboles <> replaced by &gt &lt.

     

    how to avoid this?

    Friday, October 18, 2013 7:28 AM

Answers

  • User753101303 posted

    Hi,

    This is correct. It's just not possible to keep < or > characters unchanged as it would ambiguous with <> as used in XML tags. So they are encoded this way.

    Do you see a real issue with this ? If for example it makes some code that reads this to fail, this is this reader that is badly written and would need to be fixed.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 18, 2013 8:18 AM
  • User-1623675128 posted

    the problem was with date filed which is not closed porperly with quotes; its not an issue with < >symobls in the query.

    sorry...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 24, 2013 5:17 AM

All replies

  • User753101303 posted

    Hi,

    This is correct. It's just not possible to keep < or > characters unchanged as it would ambiguous with <> as used in XML tags. So they are encoded this way.

    Do you see a real issue with this ? If for example it makes some code that reads this to fail, this is this reader that is badly written and would need to be fixed.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 18, 2013 8:18 AM
  • User-1623675128 posted

    the problem was with date filed which is not closed porperly with quotes; its not an issue with < >symobls in the query.

    sorry...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 24, 2013 5:17 AM