Urgent..please advise

Subject: Urgent..please advise
From: Charles Fong <cfong@xxxxxxxxxxxxx>
Date: Mon, 26 Jul 1999 01:00:08 -0700
Hi, experts,
      I am trying to do some XSLT stuffs and have such problem to solve.

This is a part of the source xml file.

  <CNTROLAREA>
  <SENDER>
  <LOGICALID>XX141HG09</LOGICALID>
  <COMPONENT>PUR</COMPONENT>
  <TASK>MAINT</TASK>
  <REFERENCEID>95129945823449</REFERENCEID>
  <CONFIRMATION>1</CONFIRMATION>
  <LANGUAGE>EN</LANGUAGE>
  <CODEPAGE>test</CODEPAGE>
  <AUTHID>CMKURT</AUTHID>
  </SENDER>
  <DATETIME qualifier="CREATION">
  <YEAR>1998</YEAR>
  <MONTH>11</MONTH>
  <DAY>21</DAY>
  <HOUR>17</HOUR>
  <MINUTE>11</MINUTE>
  <SECOND>45</SECOND>
  <SUBSECOND>0000</SUBSECOND>
  <TIMEZONE>-0600</TIMEZONE>
  </DATETIME>
  </CNTROLAREA>

I am still trying to figure out a xsl file  which can  produce the following
resulting  xml:

<CNTROLAREA>
  <SENDER>
  <LOGICALID>XX141HG09</LOGICALID>
  <COMPONENT>PUR</COMPONENT>
  <TASK>MAINT</TASK>
  <REFERENCEID>95129945823449</REFERENCEID>
  <CONFIRMATION>1</CONFIRMATION>
  <LANGUAGE>EN</LANGUAGE>
  <CODEPAGE>test</CODEPAGE>
  <AUTHID>CMKURT</AUTHID>
  </SENDER>
  <CREATION_DATE>1998/11/21 17:11:45</CREATION_DATE>
 </CNTROLAREA>

Basically, I want to try to identify the DATETIME structure in the source
xml file and collapse the structure to a simple data structure depending on
the "qualifier" value of the DATETIME as shown above. All the other xml
is untouched and need to appear in the resulting xml. Also this DATETIME structure
can appear at any level of the tree in the source xml (above only a simple example).

So my questions is : How can I achieve this in XSLT? i.e.  extracting the
DATETIME structure at whatever level from the source xml and collapsing it
as shown above with all other xml untouched in the source.  If this can be done,
could you kindly provide me the xsl command to do it? Thanks a lot in advance.

charles
 
 

Current Thread