0
我有下面的XML:XML到XML的轉換使用XSLT - 多個節點合併成1
<STUDENT_LIST>
<STUDENTS>
<MALE>
<STUDENT_ID>10000</STUDENT_ID>
<F_NAME>REGGIE</F_NAME>
<M_NAME></M_NAME>
<L_NAME>MILLER</L_NAME>
<DOB>
<YEAR>1980</YEAR>
</DOB>
<STUDENT_TYPE>MORNING</STUDENT_TYPE>
<STUDENT_REF>BLUE</STUDENT_REF>
<JOIN_DATE>04-20-2000</JOIN_DATE>
<NOTES></NOTES>
<FATHER_NAME>
<NAME>MILLER A</NAME>
</FATHER_NAME>
<MOTHER_NAME>
<NAME>MILLER B</NAME>
</MOTHER_NAME>
<REFRESH_DATE>04-14-2014</REFRESH_DATE>
<CORE_SUBJECTS>
<SUBJECT_A>CALCULUS A</SUBJECT_A>
<SUBJECT_B>CALCULUS B</SUBJECT_B>
<SUBJECT_C>PERFORMING ARTS</SUBJECT_C>
</CORE_SUBJECTS>
<OPT_SUBJECTS>
<SUBJECT_A>AMERICAN HISTORY</SUBJECT_A>
<SUBJECT_B></SUBJECT_B>
<SUBJECT_C></SUBJECT_C>
</OPT_SUBJECTS>
<STUDENT_KEY>ABC10000-1</STUDENT_KEY>
<STUDENT_KEY_CREATION_DATE>04-20-2000</STUDENT_KEY_CREATION_DATE>
</MALE>
</STUDENTS>
</STUDENT_LIST>
我需要將它轉換爲另一個XML(使用XSLT),其給出以下輸出:
<STUDENT_LIST>
<STUDENTS>
<MALE>
<STUDENT_ID>10000</STUDENT_ID>
<F_NAME>REGGIE</F_NAME>
<M_NAME/>
<L_NAME>MILLER</L_NAME>
<DOB>
<YEAR>1980</YEAR>
</DOB>
<JOIN_DATE>04-20-2000</JOIN_DATE>
<NOTES>
STUDENT_TYPE: MORNING
STUDENT_REF: BLUE
FATHER_NAME: MILLER A
MOTHER_NAME: MILLER B
CORE_SUBJECTS: CALCULUS A, CALCULUS B, PERFORMING ARTS
OPT_SUBJECTS: AMERICAN HISTORY
STUDENT_KEY: ABC10000-1
STUDENT_KEY_CREATION_DATE: 04-20-2000
REC_REFRESH_DATE: 04-14-2014
</NOTES>
</MALE>
</STUDENTS>
</STUDENT_LIST>
因爲我對XSLT轉換的想法很少,所以對XSLT代碼的任何幫助將不勝感激。
謝謝。
喬爾,但這對我來說。儘管只是另一個要求;如果我想將原始XML轉換爲如下所示,該怎麼辦? XSLT的外觀如何? –
我沒有看到任何給定的。最好能夠提出另一個問題。 –
我修改了原來的帖子。 –