.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. Advertisements

  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. Advertisements

  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. Advertisements

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,627
    Joergen Bech
    Jun 14, 2005
  2. Replies:
    2
    Views:
    1,046
  3. Laszlo Nagy

    convert html entities into real chars

    Laszlo Nagy, Apr 10, 2007, in forum: Python
    Replies:
    2
    Views:
    385
    Larry Bates
    Apr 10, 2007
  4. ldng
    Replies:
    3
    Views:
    2,377
    Tim Golden
    May 10, 2007
  5. 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:
    765
    Bruno Desthuilliers
    Nov 24, 2007
  6. Jim Higson
    Replies:
    3
    Views:
    383
    Eric Amick
    Jul 25, 2004
  7. Rwag
    Replies:
    9
    Views:
    481
    robic0
    Apr 23, 2006
  8. Stefan Mueller
    Replies:
    3
    Views:
    392
    Stefan Mueller
    Mar 21, 2006
Loading...