Статус: Активный участник
Группы: Участники
Зарегистрирован: 30.01.2019(UTC) Сообщений: 43 Откуда: Москва Сказал(а) «Спасибо»: 3 раз Поблагодарили: 5 раз в 5 постах
|
Согласно стандарту процессинга XML https://www.w3.org/TR/2008/REC-xml-20081126/ пп 3.3.3 Цитата: 3.3.3 Attribute-Value Normalization
Before the value of an attribute is passed to the application or checked for validity, the XML processor MUST normalize the attribute value by applying the algorithm below, or by using some other method such that the value passed to the application is the same as that produced by the algorithm.
All line breaks MUST have been normalized on input to #xA as described in 2.11 End-of-Line Handling, so the rest of this algorithm operates on text normalized in this way.
Begin with a normalized value consisting of the empty string.
For each character, entity reference, or character reference in the unnormalized attribute value, beginning with the first and continuing to the last, do the following:
1. For a character reference, append the referenced character to the normalized value. 2. For an entity reference, recursively apply step 3 of this algorithm to the replacement text of the entity. 3. For a white space character (#x20, #xD, #xA, #x9), append a space character (#x20) to the normalized value. 4. For another character, append the character to the normalized value.
и https://www.w3.org/TR/xmldsig-core1/#sec-ReferenceGenerationпп 7.1 Цитата: XML 1.0 defines an interface where a conformant application reading XML is given certain information from that XML and not other information. In particular,
1. line endings are normalized to the single character #xA by dropping #xD characters if they are immediately followed by a #xA and replacing them with #xA in all other cases, 2. missing attributes declared to have default values are provided to the application as if present with the default value, 3. character references are replaced with the corresponding character, 4. entity references are replaced with the corresponding declared entity, 5. attribute values are normalized by 5.1 replacing character and entity references as above, 5.2 replacing occurrences of #x9, #xA, and #xD with #x20 (space) except that the sequence #xD#xA is replaced by a single space, and 5.3 if the attribute is not declared to be CDATA, stripping all leading and trailing spaces and replacing all interior runs of spaces with a single space.
Note that items (2), (4), and (5.3) depend on the presence of a schema, DTD or similar declarations. The Signature element type is laxly schema valid [XMLSCHEMA-1][XMLSCHEMA-2], consequently external XML or even XML within the same document as the signature may be (only) well-formed or from another namespace (where permitted by the signature schema); the noted items may not be present. Thus, a signature with such content will only be verifiable by other signature applications if the following syntax constraints are observed when generating any signed material including the SignedInfo element:
attributes having default values be explicitly present, all entity references (except "amp", "lt", "gt", "apos", "quot", and other character entities not representable in the encoding chosen) be expanded, attribute value white space be normalized
Получается что мы вступили в несовместимость реализации процессоров XML. Майкрософтовский ридер XML не выполняет п 3 нормализации атрибутов. Исходя из всего получается что для совместимости нужно корежить исходные данные.
|
1 пользователь поблагодарил migel за этот пост.
|
|