Altova Mailing List Archives


[xsl] Problem writing XSLT

From: Mukul <mukulw3@--------->
To:
Date: 6/12/2003 6:02:00 PM
Hello,

I have an XML file in the form below. 
 
 <trace> 
 <LEVEL>FLOW</LEVEL> 
 <TIME>2003-05-06 09:57:59:9567238</TIME> 
 <TICKS>631878118799567238</TICKS> 
 <COMPONENT>NS</COMPONENT> 
 <SUBCOMPONENT>NS_SVC</SUBCOMPONENT> 
 <ENTRY type="ProcEntry"> 
 <Datum name="Method">Init</Datum> 
 </ENTRY> 
 </trace> 

 <trace> 
 <LEVEL>FLOW</LEVEL> 
 <TIME>2003-05-06 09:58:00:2830701</TIME> 
 <TICKS>631878118802830701</TICKS> 
 <COMPONENT>NS</COMPONENT> 
 <SUBCOMPONENT>NS_SVC</SUBCOMPONENT> 
 <ENTRY type="ProcEntry"> 
 <Datum name="Method">InitMgmt</Datum> 
 </ENTRY> 
 </trace> 

 <trace> 
 <LEVEL>FULL</LEVEL> 
 <TIME>2003-05-06 09:58:00:2830701</TIME> 
 <TICKS>631878118802830701</TICKS> 
 <COMPONENT>NS</COMPONENT> 
 <SUBCOMPONENT>NS_SVC</SUBCOMPONENT> 
 <ENTRY type="ProcEntry"> 
 <Datum name="Adapter">SA</Datum> 
 <Datum name="Method">ServiceabilityAgent</Datum> 
 </ENTRY>
 </trace> 
 
I need to make an XSL file in 
such a way so that resulted o/p will be in the
following given below. 

 
 <Query>
 <Data> insert into 
table(LEVEL,TIME,TICKS,COMPONENT,SUBCOMPONENT,Method)
 values('FLOW',2003-05-06

09:58:00:2830701,631878118799567238,NS,SVC,Init)</Data>
 <Data> insert into

table(LEVEL,TIME,TICKS,COMPONENTS,SUBCOMPONENTS,Adapter,Method)
 values('FLOW',2003-05-06
09:58:00:2830701,631878118799567238,NS,SVC,SA,ServiceabilityAgent)</Data>
 </Query>
  
Pls note --
1 - each <trace> tag will generate a SQL in the
corresponding <data> tag 
2 - the value of columns of the SQL will come from
<LEVEL>, <TIME>, <TICKS>, <COMPONENT>, <SUBCOMPONENT>
and attribute values of <Datum> tag for e.g. Adapter
and Method. The table name is a constant.
3 - values of table columns will be corresponding
values of these tags
 
I'll appreciate a response to the above problem..

Regards,
Mukul



__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.