Support Questions
Find answers, ask questions, and share your expertise

What is the proper AVRO schema for XML that uses namespaces

What is the proper AVRO schema for XML that uses namespaces

Hi.


I have XML data that contains namespaces. I would like to use a ConvertRecord processor to convert this to JSON (eliminating message types I dont need)

<ds:tfmDataService xmlns:ds="the:ds:namespace"
                   xmlns:fdm="the:fdm:namespace">
   <fltdOutput>
      <fdm:fltdMessage param1="param1_val"                        
                       param2="param2_val">     
      </fdm:fltdMessage>
      <fdm:fltaMessage param1="param1_val"
                       param2="param2_val">     
      </fdm:fltaMessage>
    </fltdOutput>
</ds:tfmDataService>


I need to convert these messages from XML to JSON. There are messages of different types (fdm:fltdMessage is one type, fdm:fltaMessage might be another type) The contents of fltdMessage is more complex than depicted, however I'm trying to reduce this to the simplest terms that I can build on.


What would the AVRO spec look like for an XMLReader, if I wanted to convert the <fdm:fltdMessages> to JSON, but ignore the other types?

2 REPLIES 2

Re: What is the proper AVRO schema for XML that uses namespaces

Explorer

Do you got answer for this?? My question is also same 

Re: What is the proper AVRO schema for XML that uses namespaces

New Contributor

Could you solve it?