Compartilhar via


ISAXContentHandler::startPrefixMapping Method

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method begins the scope of the prefix-URI namespace mapping. This method is always invoked after the corresponding endElement event, but the order of the endPrefixMapping events is not otherwise guaranteed.

Syntax

HRESULT startPrefixMapping(
  const wchar_t* pwchPrefix, 
  int cchPrefix, 
  const wchar_t* pwchUri,
  int cchUri
);

Parameters

  • pwchPrefix
    [in] Pointer to the prefix being mapped.
  • cchPrefix
    [in] Length of the prefix string or –1 (if zero-terminated).
  • pwchUri
    [in] Pointer to the name space URI to which the prefix is mapped.
  • cchUri
    [in] Length of the name space URI string.

Return Value

  • S_OK
    Returned if no errors occur.
  • E_FAIL
    Returned if the parse operation should be aborted.

Remarks

The information from this event is not necessary for typical name space processing. The reader automatically replaces prefixes for element and attribute names when the "https://xml.org/sax/features/namespaces" feature is True (the default).

There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically. In those contexts, the startPrefixMapping and endPrefixMapping events can supply the information needed to expand prefixes.

Note that there is no guarantee that the startPrefixMapping and endPrefixMapping events are properly nested relative to each other. All startPrefixMapping events occur before the corresponding startElement event and all endPrefixMapping events occur after the corresponding endElement event, but their order is not guaranteed.

Requirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

ISAXContentHandler::endElement Method
ISAXContentHandler::endPrefixMapping Method
ISAXContentHandler::startElement Method
ISAXContentHandler