AKILKARTHIK AKILKARTHIK
2012-02-15 12:28:14 UTC
Once we get the data from the DB i had to write the data into XML format.. but how to i add the tags in tat xml file!!!!
this is my code!!!
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:xm="http://www.mulesoft.org/schema/mule/xml" xmlns:jdbc="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.2/mule-vm.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.2/mule-xml.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.2/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/3.2/mule-jdbc-ee.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.2/mule-file.xsd">
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="@@@@@@@@@@@@:"/>
</spring:bean>
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource">
<jdbc:query key="selectEmployee"
value="select * from TABLENAME where CONDITION='Data'"/>
</jdbc:connector>
<xm:object-to-xml-transformer name="ToXML"/>
<flow name="processCustomers">
<jdbc:inbound-endpoint queryKey="selectEmployee"/>
<log-component/>
<!-- <byte-array-to-string-transformer name="ByteArrayToString" />
<stdio:outbound-endpoint system="OUT" exchange-pattern="one-way"/>-->
<file:outbound-endpoint path="C:\Desktop\input" outputPattern="newOutput.xml" transformer-refs="ToXML"/>
</flow>
</mule>
the out put file was as give Below:
org.mule.util.CaseInsensitiveHashMap serialization="custom">
<unserializable-parents/>
<org.mule.util.CaseInsensitiveHashMap>
<default/>
<float>0.75</float>
<int>16</int>
<int>6</int>
<string>PM_NAME</string>
<string>Mohan</string>
<string>ASSOCIATE_NAME</string>
<string>Harish</string>
<string>ASSOCIATE_ID</string>
<big-decimal>303250</big-decimal>
<string>PROCESSED</string>
<string>Y</string>
<string>PM_ID</string>
<big-decimal>101121</big-decimal>
<string>COMPANY_NAME</string>
<string>XYZ</string>
</org.mule.util.CaseInsensitiveHashMap>
</org.mule.util.CaseInsensitiveHashMap>
I need to get like this :
<associate-name> Mohan<\associate-name>
<proccessed> y <\Proccessed>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
this is my code!!!
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:xm="http://www.mulesoft.org/schema/mule/xml" xmlns:jdbc="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.2/mule-vm.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.2/mule-xml.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.2/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/3.2/mule-jdbc-ee.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.2/mule-file.xsd">
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="@@@@@@@@@@@@:"/>
</spring:bean>
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource">
<jdbc:query key="selectEmployee"
value="select * from TABLENAME where CONDITION='Data'"/>
</jdbc:connector>
<xm:object-to-xml-transformer name="ToXML"/>
<flow name="processCustomers">
<jdbc:inbound-endpoint queryKey="selectEmployee"/>
<log-component/>
<!-- <byte-array-to-string-transformer name="ByteArrayToString" />
<stdio:outbound-endpoint system="OUT" exchange-pattern="one-way"/>-->
<file:outbound-endpoint path="C:\Desktop\input" outputPattern="newOutput.xml" transformer-refs="ToXML"/>
</flow>
</mule>
the out put file was as give Below:
org.mule.util.CaseInsensitiveHashMap serialization="custom">
<unserializable-parents/>
<org.mule.util.CaseInsensitiveHashMap>
<default/>
<float>0.75</float>
<int>16</int>
<int>6</int>
<string>PM_NAME</string>
<string>Mohan</string>
<string>ASSOCIATE_NAME</string>
<string>Harish</string>
<string>ASSOCIATE_ID</string>
<big-decimal>303250</big-decimal>
<string>PROCESSED</string>
<string>Y</string>
<string>PM_ID</string>
<big-decimal>101121</big-decimal>
<string>COMPANY_NAME</string>
<string>XYZ</string>
</org.mule.util.CaseInsensitiveHashMap>
</org.mule.util.CaseInsensitiveHashMap>
I need to get like this :
<associate-name> Mohan<\associate-name>
<proccessed> y <\Proccessed>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email