Json 2 xml Conversion Issue with spaces and number in xml elements


					
				
			
			
				
			
			
				
Solved Solved
0 1 89
1 ACCEPTED SOLUTION

My Requirement is the I need the xml as same as the json key values. i need the spaces i need the numbers in the xml element.

XML element names must not use spaces. In Well-formed XML, all element names must contain no spaces. Also, It is not valid to have XML element names that start with numbers. The conversion Apigee performs makes those adjustments, to produce well-formed XML. It is not possible to produce non-well-formed XML with the JSONToXML policy. It is not possible to produce an XML document that has element names that contain spaces.

You described it as a "Requirement" to have XML elements with spaces. Because Apigee does not support emitting non-well-formed XML, If you actually need to do this, you will need to perform the conversion "manually".

But if I were you I would double-check that requirement.

View solution in original post

1 REPLY 1

My Requirement is the I need the xml as same as the json key values. i need the spaces i need the numbers in the xml element.

XML element names must not use spaces. In Well-formed XML, all element names must contain no spaces. Also, It is not valid to have XML element names that start with numbers. The conversion Apigee performs makes those adjustments, to produce well-formed XML. It is not possible to produce non-well-formed XML with the JSONToXML policy. It is not possible to produce an XML document that has element names that contain spaces.

You described it as a "Requirement" to have XML elements with spaces. Because Apigee does not support emitting non-well-formed XML, If you actually need to do this, you will need to perform the conversion "manually".

But if I were you I would double-check that requirement.