Is our objective to generate 'Mapping Config' , Runtime or both? If XML to XML mapping config is jst a xslt ?
On Mon, Jul 15, 2013 at 10:11 AM, Srinath Perera <[email protected]> wrote: > Following shows inputs and output for mapping > [image: Inline image 1] > > > > We chatted and plan to do XML->CSV, XML->JSON, CSV->JSON mappings as the > POC > > We will use above same example for POC > > We need to write a path resolver for XML (this is a xpath engine), for > CSV, and for JSON (this is JSON xpath impl) and way to generate the output > from mapping config. > > > --Srinath > > > On Mon, Jul 15, 2013 at 8:52 AM, Susankha Nirmala <[email protected]>wrote: > >> Hi All, >> >> I have started working on $subject with Srinath. >> >> As we discussed, I have done a research of some data transformation >> technologies and architectures of them. >> >> 1) We assume all data types we map can be represented as a tree and >> accessed via a/b/c xpath like format. For example, values in relational >> table we represented via one level paths. >> >> >> 2) We describe the mapping using a Avro like format. Let us take an >> example. Lets assume we need to convert following XML file to a JSON >> document. >> >> <employee> >> <firstname>Susankha</firstname> >> <lastname>Nirmala</lastname> >> <address>Street,123,State</address> >> <dob>1985.10.31</dob> >> </employee> >> We define the mapping using following Avro like format. >> >> mapping.json : >> >> { >> fullName:concat($fname, $lname), >> Address{ >> address: >> { >> "Street":"str.split($address, ",")[0]", >> "Zip":"str.split($address, ',')[1]", >> "State":"str.split($address, ',')[2]", >> } >> "Age":"date.getAge($dob)" >> } >> } >> >> Here str.split(..) date.getAge() are functions, and we pass reference to >> input document via xpath like paths starting with $. >> >> When we apply the mapping, the output will look like following. We will >> use defined path to travel the input file and extract values. >> >> { >> "fullname":"Susankha Nirmala", >> "address":{ >> "Street": "Street", >> "Zip": "123", >> "State": "State" >> } >> } >> >> Note, the output can be anything. For example, it can be a database and >> we will auto map the structure define in mapping.config to output type. >> (e.g. if output is a database, then it can only have one level). >> >> >> After Comparing this two schemas, Srinath and myself decided to use JSON >> for representing data mapping configuration. Also we decided to use Jackson >> library for processing JSON configurations. >> --Susankha and Srinath >> >> -- >> Susankha Nirmala >> Software Engineer >> WSO2, Inc.: http://wso2.com >> lean.enterprise.middleware >> Mobile : +94 77 593 2146 >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > ============================ > Srinath Perera, Ph.D. > Director, Research, WSO2 Inc. > Visiting Faculty, University of Moratuwa > Member, Apache Software Foundation > Research Scientist, Lanka Software Foundation > Blog: http://srinathsview.blogspot.com/ > Photos: http://www.flickr.com/photos/hemapani/ > Phone: 0772360902 > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- *Susinda Perera* Software Engineer Mobile:(+94)716049075 WSO2 Inc. http://wso2.com/
<<image.png>>
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
