cancel
Showing results for 
Search instead for 
Did you mean: 

canonical XML

Former Member
0 Kudos

hi all,

iam working on AGILE to SAP scenario.

from agile iam getting AXML file which is in ZIP format. iam using one file adapter module to unzip into XML and procesing the data. the XML is normal XML, but my client want that XML should be canonical XML.

can any one tell me how to convert into canonical XML instead of normal XML.

Regards,

Madhav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Madhav,

The canonical form of an XML document is physical representation of the document produced by the method described in this specification. The changes are summarized in the following list:

1. The document is encoded in UTF-8

2. Line breaks normalized to #xA on input, before parsing

3. Attribute values are normalized, as if by a validating processor

4. Character and parsed entity references are replaced

5. CDATA sections are replaced with their character content

6. The XML declaration and document type declaration (DTD) are removed

7. Empty elements are converted to start-end tag pairs

8. Whitespace outside of the document element and within start and end tags is normalized

9. All whitespace in character content is retained (excluding characters removed during line feed normalization)

10. Attribute value delimiters are set to quotation marks (double quotes)

11. Special characters in attribute values and character content are replaced by character references

12. Superfluous namespace declarations are removed from each element

13. Default attributes are added to each element

14. Lexicographic order is imposed on the namespace declarations and attributes of each element

The term canonical XML refers to XML that is in canonical form. The XML canonicalization method is the algorithm defined by this specification that generates the canonical form of a given XML document or document subset. The term XML canonicalization refers to the process of applying the XML canonicalization method to an XML document or document subset.

For more, please go through:

http://www.w3.org/TR/xml-c14n

http://www.ibm.com/developerworks/library/x-c14n/

Thanks,

Varun

Former Member
0 Kudos

hi varun,

thanks for quick reply,

but i want to know whether PI convert normal XML to canonical XML.

regards,

Madhav.

Former Member
0 Kudos

Hi Madhav,

XI dosent convert. you will have to write a module processor for it.

Though you can achieve some prerequisites by using UTF-8 coding and also using the anonymizer bean which is provided by SAP XI as a standard.

Thanks,

Varun

Former Member
0 Kudos

Hi Madhav,

Sorry for late inputs, But if manual intervention is allowed in your case, you can also try out Stylus studio to generate Canonical XML out of a Normal XML.

I just found out

Thanks,

Varun

Former Member
0 Kudos

hi varun,

thanks for the reply,

iam not allowed to convert manually. XI has to convert automatically. i have gone through anonymizer bean , but it will not fulfill all the functionality.

>>write a module processor

means do i need to write a new customised adapter module?

regards,

Madhav