EDN Admin
Well-known member
Hello,
Im working on storing and retrieving important information from xml files. I have many xml files (100 - 200 kb) where each one is stored in a cell of TEXT column (Each cell carried one complete xml file) in MySQL table.
a very simple xml file looks like
<pre class="prettyprint <?xml version="1.0" ?>
<root>
<Header>
<System>BiosynML</System>
<Version>0.4</Version>
<date action="created 19.04.2012</date>
<date action="modified 5.1.2012</date>
<author>XYZ</author>
<description>Biosynthesis</description>
</Header>
<model id="1
<nodelist>
<node id="1
<class>carrier</class>
<context>PKS</context>
<domain>
<function>ACP</function>
<active>yes</active>
<label>ACP1</label>
<chemistry>thioester</chemistry>
<substrate>carboxylic acid</substrate>
<location>
<gene>
<g_name>cmdA</g_name>
<g_position>3997-4210</g_position>
</gene>
<protein>
<p_name>cmdA</p_name>
<sequence>AWLVARVAAISGSDPHQIDARQRFGRHGIDSLHATRLIAELSTRLERSLSPTLIWEYPTIEALAAHLGGET</sequence>
<p_position>10-81</p_position>
</protein>
</location>
</domain>
</node>
<node id="2
<class>linkage</class>
<context>PKS</context>
<domain>
<function>KS</function>
<active>yes</active>
<label>PKS_KS1</label>
<chemistry>condensation</chemistry>
<substrate>intermediate</substrate>
<location>
<gene>
<g_name>cmdA</g_name>
<g_position>4282-5554</g_position>
</gene>
<protein>
<p_name>cmdA</p_name>
<sequence>AIVGMACRFPGAPDEASFWDLLRDGVDAV</sequence>
<p_position>105-529</p_position>
</protein>
</location>
</domain>
</node>
</root>[/code]
Now I have a 100 rows which contains 100 xml files of same format. I want to make queries in this table from the windows form (GUI) like
"Give the protein sequence of a domain which consist of function "KS" then it should search each xml file and if it finds KS in any of the function attribute then it should return the particular protein sequence"
The structure of the table looks like
<pre class="prettyprint Primary key file_name filedata(Text)
1 output1 Text(file1)
2 output2 Text(file2)
3 output3 Text(file3) [/code]
I tried using Xpath but was not able to succeed so far. I can retrieve simple information but not the complex queries which I want.
Is there also a generalized way of querying the table such that any information can be retrieved from an xml file based on the interest of the users.
Can you please help me to build these complex queries and also some suggestions on the table format for storing xml file for complex queries would be very helpful.
Sorry, If I m in wrong forum
thanks a lot in advance
<br/>
View the full article
Im working on storing and retrieving important information from xml files. I have many xml files (100 - 200 kb) where each one is stored in a cell of TEXT column (Each cell carried one complete xml file) in MySQL table.
a very simple xml file looks like
<pre class="prettyprint <?xml version="1.0" ?>
<root>
<Header>
<System>BiosynML</System>
<Version>0.4</Version>
<date action="created 19.04.2012</date>
<date action="modified 5.1.2012</date>
<author>XYZ</author>
<description>Biosynthesis</description>
</Header>
<model id="1
<nodelist>
<node id="1
<class>carrier</class>
<context>PKS</context>
<domain>
<function>ACP</function>
<active>yes</active>
<label>ACP1</label>
<chemistry>thioester</chemistry>
<substrate>carboxylic acid</substrate>
<location>
<gene>
<g_name>cmdA</g_name>
<g_position>3997-4210</g_position>
</gene>
<protein>
<p_name>cmdA</p_name>
<sequence>AWLVARVAAISGSDPHQIDARQRFGRHGIDSLHATRLIAELSTRLERSLSPTLIWEYPTIEALAAHLGGET</sequence>
<p_position>10-81</p_position>
</protein>
</location>
</domain>
</node>
<node id="2
<class>linkage</class>
<context>PKS</context>
<domain>
<function>KS</function>
<active>yes</active>
<label>PKS_KS1</label>
<chemistry>condensation</chemistry>
<substrate>intermediate</substrate>
<location>
<gene>
<g_name>cmdA</g_name>
<g_position>4282-5554</g_position>
</gene>
<protein>
<p_name>cmdA</p_name>
<sequence>AIVGMACRFPGAPDEASFWDLLRDGVDAV</sequence>
<p_position>105-529</p_position>
</protein>
</location>
</domain>
</node>
</root>[/code]
Now I have a 100 rows which contains 100 xml files of same format. I want to make queries in this table from the windows form (GUI) like
"Give the protein sequence of a domain which consist of function "KS" then it should search each xml file and if it finds KS in any of the function attribute then it should return the particular protein sequence"
The structure of the table looks like
<pre class="prettyprint Primary key file_name filedata(Text)
1 output1 Text(file1)
2 output2 Text(file2)
3 output3 Text(file3) [/code]
I tried using Xpath but was not able to succeed so far. I can retrieve simple information but not the complex queries which I want.
Is there also a generalized way of querying the table such that any information can be retrieved from an xml file based on the interest of the users.
Can you please help me to build these complex queries and also some suggestions on the table format for storing xml file for complex queries would be very helpful.
Sorry, If I m in wrong forum
thanks a lot in advance
<br/>
View the full article