| Previous | Next |
| WCM_E_INVALIDPATH | WCM_E_INVALIDVERSIONFORMAT |
WCM_E_WRONGESCAPESTRING
The Windows SDK describes the condition as “Wrong XML escape sequence in string.”
Interpretation without overreach
XML escaping in the SMI string is invalid. The operation reached decoding a path, keyed-list value, or serialized settings string that uses XML entity escaping. The first branch to test is whether an ampersand begins an incomplete entity reference; keep that separate from the possibility that text was escaped twice and then partially decoded.
SMI object or metadata state
At this boundary, capture raw source bytes and decoded string at every transformation boundary, then correlate it with ISettingsResult line and column for XML-originated data. Assign ownership only after checking the exact path argument received by the SMI API.
Common origins
- an ampersand begins an incomplete entity reference
- text was escaped twice and then partially decoded
- a custom XML writer emitted a nonstandard entity name
- a path was truncated in the middle of a character/entity sequence
Useful artifacts
- raw source bytes and decoded string at every transformation boundary
- ISettingsResult line and column for XML-originated data
- the exact path argument received by the SMI API
- whether standard XML APIs or manual replacements performed escaping
- comparison between the original value and a round-trip through the chosen XML writer
How to isolate the defect
- replace hand-written entity substitution with a conforming XML serializer
- decode exactly once at the correct layer
- Preserve opaque SMI paths rather than displaying and reconstructing them
- Validate the final stream before deserialization
- Add tests for ampersands, angle brackets, quotes, and non-ASCII key values
When another attempt is justified
Retry after repairing the source string. Repeating the operation with the same malformed escape cannot succeed.
Related result codes
WCM_E_INVALIDPATH covers general path grammar; WRONGESCAPESTRING pinpoints the XML-escape layer even when the unescaped logical value would otherwise be legal.
Example from an offline image
A keyed list contains an ampersand. One exporter writes it correctly, then a second exporter escapes the already escaped text and leaves an invalid sequence after partial decoding.
Official Microsoft references.
Looking for a different code? Search another status or error code.
