I have the following xml:-
<?xml version="1.0" encoding="UTF-8"?>
<patent-assignment>
<assignment-record>
<correspondent>
<name>NORTH AMERICA INTERNATIONAL PATENT OFFIC</name>
<address-1>P.O. BOX 506</address-1>
<address-2>MERRIFIELD, VA 22116</address-2>
</correspondent>
</assignment-record>
<patent-assignors>
<patent-assignor>
<name>TSAI, YU-WEN</name>
<execution-date>
<date>20050331</date>
</execution-date>
</patent-assignor>
<patent-assignor>
<name>HUANG, CHENG-I</name>
<execution-date>
<date>20050331</date>
</execution-date>
</patent-assignor>
</patent-assignors>
<patent-assignees>
<patent-assignee>
<name>FARADAY TECHNOLOGY CORP.</name>
<address-1>NO.10-2, LI-HSIN ROAD 1, SCIENCE-BASED INDUSTRIAL PARK</address-1>
<city>HSIN-CHU CITY</city>
<country-name>TAIWAN</country-name>
</patent-assignee>
</patent-assignees>
</patent-assignment>
Now at the time of loading document into Marklogic I want to change patent-assignor’s element name to assignor-name and patent-assignee’s element name to assignee-name but I want to load data with Record Loader not with Marklogic’s Information Studio. How can I do this with Record Loader ?
You will need to set
CONTENT_FACTORY_CLASSNAME=com.marklogic.recordloader.xcc.XccModuleContentFactoryand write an XQuery module to implement the content module. There is an example module at http://marklogic.github.com/recordloader/ which you can customize. Your transform code would go in thelocal:do()function, replacing the example “lower-case element localnames” code: