Compartilhar via


EscapeXML

Call this function to convert characters that are unsafe for use in XML to their safe equivalents.

inline int EscapeXML( 
   const wchar_t * szIn, 
   int nSrcLen, 
   wchar_t * szEsc, 
   int nDestLen, 
   DWORD dwFlags = ATL_ESC_FLAG_NONE  
) throw( );

Parameters

  • szIn
    The string to be converted.

  • nSrclen
    The length in characters of the string to be converted.

  • szEsc
    Caller-allocated buffer to receive the converted string.

  • nDestLen
    The length in characters of the caller-allocated buffer.

  • dwFlags
    Flags describing how the conversion is to be performed. See ATL_ESC Flags.

Return Value

The length in characters of the converted string.

Remarks

Possible conversions performed by this function are shown in the table:

Source

Destination

<

&lt;

>

&gt;

&

&amp;

'

&apos;

"

&quot;

Requirements

Header: atlenc.h

See Also

Other Resources

Active Template Library (ATL) Concepts

ATL COM Desktop Components

ATL Functions Alphabetical Reference