.NET-ey way to convert XML-encoded/escaped entities into normal characters/HTML?

Discussion in 'ASP .Net' started by Guest, Jun 20, 2007.

  1. Guest

    Guest Guest

    I've written an app to parse an XML RSS feed. Some of the content in that
    RSS feed has entities properly encoded for XML, e.g.:

    UW's Hawes To Enter NBA Draft
    High school's 'No-shush' to retire

    My app reads the content using XmlDocument/XmlNodeList and then commits
    selected pieces to my DB.

    I want to know the best/easiest/most reliable/most complete way to translate
    entities that are escaped as in the example above and convert them to normal
    characters or entities. Am I stuck writing a translation function, or is
    there a .NET class or method set that I can plug into?

    Thanks,
    -KF
    Guest, Jun 20, 2007
    #1
    1. Advertising

  2. Microsoft's free Anti-Cross Site Scripting Library provides superb encoding
    and decoding functionality:
    http://msdn2.microsoft.com/en-us/security/aa973814.aspx

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net



    <> wrote in message
    news:...
    > I've written an app to parse an XML RSS feed. Some of the content in that
    > RSS feed has entities properly encoded for XML, e.g.:
    >
    > UW&apos;s Hawes To Enter NBA Draft
    > High school&apos;s &apos;No-shush&apos; to retire
    >
    > My app reads the content using XmlDocument/XmlNodeList and then commits
    > selected pieces to my DB.
    >
    > I want to know the best/easiest/most reliable/most complete way to
    > translate entities that are escaped as in the example above and convert
    > them to normal characters or entities. Am I stuck writing a translation
    > function, or is there a .NET class or method set that I can plug into?
    >
    > Thanks,
    > -KF
    >
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jun 20, 2007
    #2
    1. Advertising

  3. Guest

    Guest Guest

    Great, thank you very much, Steve.

    -KF

    "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <> wrote in
    message news:...
    > Microsoft's free Anti-Cross Site Scripting Library provides superb
    > encoding and decoding functionality:
    > http://msdn2.microsoft.com/en-us/security/aa973814.aspx
    >
    > --
    > I hope this helps,
    > Steve C. Orr,
    > MCSD, MVP, CSM, ASPInsider
    > http://SteveOrr.net
    >
    >
    >
    > <> wrote in message
    > news:...
    >> I've written an app to parse an XML RSS feed. Some of the content in that
    >> RSS feed has entities properly encoded for XML, e.g.:
    >>
    >> UW&apos;s Hawes To Enter NBA Draft
    >> High school&apos;s &apos;No-shush&apos; to retire
    >>
    >> My app reads the content using XmlDocument/XmlNodeList and then commits
    >> selected pieces to my DB.
    >>
    >> I want to know the best/easiest/most reliable/most complete way to
    >> translate entities that are escaped as in the example above and convert
    >> them to normal characters or entities. Am I stuck writing a translation
    >> function, or is there a .NET class or method set that I can plug into?
    >>
    >> Thanks,
    >> -KF
    >>

    >
    Guest, Jun 20, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joergen Bech
    Replies:
    2
    Views:
    4,436
    Joergen Bech
    Jun 14, 2005
  2. Replies:
    2
    Views:
    763
  3. ldng
    Replies:
    3
    Views:
    1,809
    Tim Golden
    May 10, 2007
  4. Just Another Victim of the Ambient Morality

    How do I convert escaped HTML into a string?

    Just Another Victim of the Ambient Morality, Nov 24, 2007, in forum: Python
    Replies:
    6
    Views:
    617
    Bruno Desthuilliers
    Nov 24, 2007
  5. Jim Higson
    Replies:
    3
    Views:
    224
    Eric Amick
    Jul 25, 2004
Loading...

Share This Page