Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
696 views
in Technique[技术] by (71.8m points)

Conversion from XML to Json removes 0 in Azure Data Factory

I am converting XML files to Json(gzip compression) using Azure Data Factory.

However , I observe that in the XML file I have the values stored as 0123456789. However , when this is converted to Json it is saved as "value" : 123456789. Without 0.

I would like to keep the Json values as-is from the XML . Please provide suggestions for the same.

question from:https://stackoverflow.com/questions/65896137/conversion-from-xml-to-json-removes-0-in-azure-data-factory

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I recently found using data flow will solve the problem.

  1. I created a simple test. My xml file is as follows:
<?xml version="1.0"?>
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
<number>0123456789</number>
</note>
  1. Set the xml file as the source data. Please don't import Projection.
    By default, all columns will be treated as string types. enter image description here The data preview is as follows: enter image description here

  2. Set the json file as the sink: enter image description here

  3. Select Output to single file and specify the file name. enter image description here

  4. The debug result is as follows: enter image description here

That's all.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...