Re: Improving File Connector to split an XML file to multiple XML files based on xpath expression

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Improving File Connector to split an XML file to multiple XML files based on xpath expression

Biruntha
+ Extensions

On Wed, Dec 13, 2017 at 12:08 PM, Biruntha Gnaneswaran <[hidden email]> wrote:
Hi All,

Currently, I'm working on improving the file connector to split an XML file to multiple XML files based on xpath expression [1].
If we have input xml file as in [2] and xpathExpression as [3], then output will be as [4].

Please let me know if you have any concerns.

[1] https://wso2.org/jira/browse/ESBCONNECT-225
[2]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<products>
    <product>
        <description>Sony 54.6" (Diag) Xbr Hx929 Internet Tv</description>
        <gtin>00027242816657</gtin>
        <price>2999.99</price>
        <orderId>2343</orderId>
        <supplier>Sony</supplier>
    </product>
    <product>
        <description>Apple iPad 2 with Wi-Fi 16GB - iOS 5 - Black
        </description>
        <gtin>00885909464517</gtin>
        <price>399.0</price>
        <orderId>2343</orderId>
        <supplier>Apple</supplier>
    </product>
    <product>
        <description>Panasonic TC-L47E50 47" Smart TV Viera E50 Series LED
            HDTV</description>
        <gtin>00885170076471</gtin>
        <price>999.99</price>
        <orderId>2344</orderId>
        <supplier>Panasonic</supplier>
    </product>
</products>

[3] //products/product
[4]

product1.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<products>
<product>
        <description>Sony 54.6" (Diag) Xbr Hx929 Internet Tv</description>
        <gtin>00027242816657</gtin>
        <price>2999.99</price>
        <orderId>2343</orderId>
        <supplier>Sony</supplier>
</product>
</products>

product2.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<products>
<product>
        <description>Apple iPad 2 with Wi-Fi 16GB - iOS 5 - Black
        </description>
        <gtin>00885909464517</gtin>
        <price>399.0</price>
        <orderId>2343</orderId>
        <supplier>Apple</supplier>
    </product>
</products>

product3.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<products>
<product>
        <description>Panasonic TC-L47E50 47" Smart TV Viera E50 Series LED
            HDTV</description>
        <gtin>00885170076471</gtin>
        <price>999.99</price>
        <orderId>2344</orderId>
        <supplier>Panasonic</supplier>
    </product>
</products>


Thanks,
--
Biruntha

Software Engineer
WSO2
Email: [hidden email]
Mobile : <a href="tel:+94%2077%20371%208986" value="+94773718986" target="_blank">+94773718986



--
Biruntha

Software Engineer
WSO2
Email: [hidden email]
Mobile : +94773718986

_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture