<?xml version="1.0" encoding="euc-kr"?>
<!--	
	1) 사업명 : 건설공사정보 DB구축 4차
	2) 주제   : 연구보고서
	3) 회사   : (주) SON Korea
	4) 화일명 : report.xsl
	5) 설명   : 연구보고서 Stylesheet
	6) 개발   : <<2004.08>>
	7) 수정   : <<2005.01.06>>
	            2005/0622       - 영문목차에 <br> 추가	
                              - 요약본문/제목 뒤에 <br/> 추가
                              - 요약문 제목 부분 크기 변경 : Ct0
              2005/0623       - 목차 3Depth 까지 확장
	      2006/02/13      - 한글 폴더 및 한글명사용시 오류 수정
	                      - Encoding 문제 해결
			      - <xsl:output method="xml" encoding="euc-kr" indent="yes"/> <== 추가
-->
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;" >]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" encoding="euc-kr" indent="yes"/>
<xsl:template match="/">
<xsl:variable name="sTitle1" select="연구보고서/전체요약서/연구원정보/수행기관"/>
<xsl:variable name="sTitle2" select="연구보고서/전체요약서/연구원정보/연구책임자/성명"/>
<xsl:variable name="sTitle3" select="연구보고서/요약서/연구원정보/수행기관"/>
<xsl:variable name="sTitle4" select="연구보고서/요약서/연구원정보/연구책임자/성명"/>
	<html>
		<link href="style.css" rel="stylesheet" type="text/css" />
		<head>
				<title>연구보고서 : <xsl:value-of select="연구보고서/요약서/일반정보/중점과제명"/></title>			
				<style>
					body {font-family:굴림;font-size:11pt;text-align:justify}
					th,td {font-family:굴림;font-size:11pt}					
				</style>		
				<style type="text/css">
				#box {height="100%"; overflow: auto; padding:0px;border:0 solid #F0A002; color: #F0A002;line-height:15pt;font-size:9pt;}
				#xxx1 {solid #F0AFF2; color: #F0A002;line-height:25pt;font-size:16pt;}
				</style>
				
				<!-- Load the Javascript -->
				<script language="javascript">
					<xsl:comment>
			function settitle(bflag)
			{
			var str1 = '<xsl:value-of select="$sTitle1"/>';
			var str2 = '<xsl:value-of select="$sTitle2"/>';
			var str3 = '<xsl:value-of select="$sTitle3"/>';
			var str4 = '<xsl:value-of select="$sTitle4"/>';
				var strTitle = '';
				if(str1.length > 0){
					if(strTitle.length > 0) strTitle += ', ' + str1;
					else										strTitle += str1;
				}
				if(str2.length > 0){
					if(strTitle.length > 0) strTitle += ', ' + str2;
					else										strTitle += str2;
				}
				if(str3.length > 0){
					if(strTitle.length > 0) strTitle += ', ' + str3;
					else										strTitle += str3;
				}
				if(str4.length > 0){
					if(strTitle.length > 0) strTitle += ', ' + str4;
					else										strTitle += str4;
				}
				if(bflag == 0) {
					if(strTitle.length > 20) strTitle = strTitle.substring(0,20) + "...";
				}
//				alert(strTitle);
				document.all.stable.rows[0].deleteCell(1);
				var obj = document.all.stable.rows[0].insertCell(1);

				obj.innerHTML = strTitle;
			}
			function runprn()
			{
				window.print(this.form);
			}
			function rsimg()
			{
			settitle(0);
			box1.style.display = "inline";
			var x = document.images.length;
				for(i=0;i &lt; document.images.length;i++) {
					var orgimg;							
					orgimg = document.images[i];
					
					var Wo = orgimg.width;
					var Ho = orgimg.height;
					
					if(Wo > 400) {
						orgimg.width = 400;
						orgimg.height = Ho * 400 / Wo;
					};
				}
			}		
			function hiddentoc()
			{
				<!-- 출력용 -->
				if (box1.style.display == "inline"){
					box1.style.display = "none";

					// 타이틀/저자/날짜 출력부분
					toptb.width ="726";
					toptb.align ="left";
					toptb_bg1.width = "694";
					toptb_bg2.width = "694";
					toptb_bg3.width = "694";

					// body background image
					mainbody.background="";

					// content 형태 변경
					// left = 0
					// width = 695 - 290 : 405
					cont.style.left = 0;
					cont.style.width = 726;
					cont.style.overflow = "";

					standardfrm.style.display = "none";
					prnfrm.style.display = "inline";
					settitle(1);
					}
				<!-- 일반보기용 -->
				else {
					box1.style.display = "inline";

					// 타이틀/저자/날짜 출력부분
					toptb.width ="990";
					toptb.align ="center";
					toptb_bg1.width = "958";
					toptb_bg2.width = "958";
					toptb_bg3.width = "958";

					// body background image
					mainbody.background="images/textbox_bg.gif";

					// content 형태 변경
					// left = 290
					// width = 695
					cont.style.left = 290;
					cont.style.width = 695;
					cont.style.height = 430;
					cont.style.overflow = "auto";

					standardfrm.style.display = "inline";
					prnfrm.style.display = "none";
					settitle(0);
				}
			}
					</xsl:comment>
				</script>
		</head>
			<body id="mainbody" bgcolor="#EDEFEE" background="images/textbox_bg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="rsimg();">
				<div style="width:1000;height:100pt;z-index:1;padding-left:0pt;border=0px">
<table width="1000" height="100%" border="0" cellpadding="0" cellspacing="0">
	<tr valign="top"> 
		<td height="109" width="1000" colspan="2" align="center" background="images/xml_top_bg1.gif"> 
			<table width="990" border="0" cellpadding="0" cellspacing="0">
				<tr> 
					<td height="20" ></td>
				</tr>
				<tr> 
					<td width="100%" align="left" valign="bottom">
						<div id="standardfrm">
							<table width="100%">
								<tr>
									<td width="100%" align="left" valign="bottom">
										<img src="images/i_printview.gif" width="85" height="20" style="cursor:hand" onclick="hiddentoc();"/> 
										<img src="images/i_close.gif" width="52" height="20" style="cursor:hand" onclick="window.close();" />
									</td>
								</tr>
							</table>
						</div>
						<div id="prnfrm" style="display:none">
							<table width="100%">
								<tr>
									<td width="100%" align="left" valign="bottom">
										<img src="images/i_return.gif" width="85" height="20" style="cursor:hand" onclick="hiddentoc();"/> 
										<img src="images/i_print.gif" width="52" height="20" style="cursor:hand" onclick="runprn();"/> 
										<img src="images/i_close.gif" width="52" height="20" style="cursor:hand" onclick="window.close();" />
									</td>
								</tr>
							</table>
						</div>
					</td>

				</tr>
			</table>
			<table width="990" border="0" cellpadding="0" cellspacing="0" id="toptb" >
				<tr>
					<td width="100%" >
						<table width="100%" border="0" cellpadding="0" cellspacing="0" >
							<tr> 
								<td> 
									<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" height="16" valign="bottom" background="images/xml_box_01.gif"></td>
											<td id="toptb_bg1" width="958" height="16" background="images/xml_box_02.gif"></td>
											<td width="16" valign="bottom" background="images/xml_box_03.gif"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr> 
								<td> 
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" background="images/xml_box_04.gif">&nbsp;</td>
											<td width="958" bgcolor="#FFFFFF" id="toptb_bg2">
												<table width="100%" border="0" cellpadding="0" cellspacing="0">
													<tr>
														<td width="60%" valign="top"> 
															<table border="0">
																<tr> 
																	<td width="50" height="20" align="right" class="At2" valign="top">제목 :</td>
																	<td rowspan="2" valign="top" class="At3">
																	<xsl:value-of select="연구보고서/전체요약서/일반정보/중점과제명"/>
																	<xsl:value-of select="연구보고서/요약서/일반정보/중점과제명"/>
																	</td>
																</tr>
															</table>
														</td>
														<td width="40%" valign="top" background="images/xml_box_line1.gif">
															<table border="0" align="right" id="stable">
																<tr class="Acate"> 
																	<td width="60" height="20" align="right" valign="top" class="At2">작성자 : </td>
																	<td class="At3">작성자 로딩중 ...</td>
																</tr>
																<tr class="Acate"> 
																	<td width="60" height="20" align="right" class="At2">날짜 :</td>
																	<td class="At3" >
																	<xsl:value-of select="연구보고서/전체요약서/일반정보/발행일"/>
																	<xsl:value-of select="연구보고서/요약서/일반정보/발행일"/>
																	</td>
																</tr>
															</table> 
														</td>
													</tr>
												</table>
											</td>
											<td width="16" background="images/xml_box_05.gif">&nbsp;</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr> 
								<td> 
									<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" height="16" valign="top" background="images/xml_box_06.gif"></td>
											<td id="toptb_bg3" width="958" height="16" background="images/xml_box_08.gif"></td>
											<td width="16" height="16" valign="top" background="images/xml_box_07.gif"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
				</div>
				<div id="box1" style = "position:absolute;
								 padding-left:0pt;
							   padding-right:0pt;
							   width:284;
							   height:435;
							   z-index:2;
							   border:0px;
							   overflow:auto"> 			
			<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
				<tr> 
					<td valign="top" align="center"> 
						<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
							<tr> 
								<td height="16"> 
									<table width="260" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" height="16" valign="bottom"><img src="images/xml_box_01.gif" width="16" height="16"/></td>
											<td height="16" background="images/xml_box_02.gif"><img src="images/xml_box_02.gif" width="16" height="16"/></td>
											<td width="16" valign="bottom"><img src="images/xml_box_03.gif" width="16" height="16"/></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr> 
								<td> 
									<table width="260" height="100%" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" height="16" background="images/xml_box_04.gif">&nbsp;</td>
											<td valign="top" bgcolor="#FFFFFF">
<!-- 목차 출력 부분 시작 -->
				<!-- 목차 -->
				<xsl:copy-of select="$TOC"/>
				<xsl:copy-of select="$LOT"/>
				<xsl:copy-of select="$LOF"/>
				<xsl:copy-of select="$LOE"/>
				<xsl:copy-of select="$LOP"/>
				<xsl:copy-of select="$LOG"/>
<!--
				<hr/>
				<hr/>
-->
<!-- 목차 출력 부분 끝 -->
											</td>	
											<td width="16" background="images/xml_box_05.gif">&nbsp;</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr> 
								<td height="16"> 
									<table width="260" border="0" cellpadding="0" cellspacing="0" align="center">
										<tr> 
											<td width="16" height="16" valign="top"><img src="images/xml_box_06.gif" width="16" height="16"/></td>
											<td background="images/xml_box_08.gif"><img src="images/xml_box_08.gif" width="16" height="16"/></td>
											<td width="16" valign="top"><img src="images/xml_box_07.gif" width="16" height="16"/></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td height="16">&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table> 
				</div>
				<div id="cont" style="position:absolute;width:695;height:430;z-index:2;left:290;top:140;overflow:auto">
					<xsl:apply-templates select="연구보고서"/>
				</div>
			</body>			
	</html>
</xsl:template>

<!-- ###################################################################################################### -->
<!-- 목차영역																																																-->
<!-- 작성자 : SON Korea 																																										-->
<!-- 작성일 : 2005-01-06 																																										-->
<!-- ###################################################################################################### -->

<xsl:variable name="TOC">
	<font class="Bt1"><strong>목 차(Table Of Contents)</strong></font><br/>
	<xsl:for-each select="//본문/제목[@id]">
		<xsl:choose>
			<xsl:when test="@level = '0'">
				<font class="Bt2">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/>
				</xsl:element>
				</font>
			</xsl:when>
			<xsl:when test="@level = '1'">&nbsp;
				<font class="Bt3">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/>
				</xsl:element>
				</font>
			</xsl:when>
			<xsl:when test="@level = '2'">&nbsp;&nbsp;
				<font class="Bt4">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/>
				</xsl:element>
				</font>
			</xsl:when>
			<xsl:when test="@level = '3'">&nbsp;&nbsp;&nbsp;
				<font class="Ct4">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/>
				</xsl:element>
				</font>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
</xsl:variable>

<!-- (기존) 표목차 (List of Table) ....... -->
<xsl:variable name = "LOT">
	<xsl:if test="//표">
		<br/><br/><font class="Bt1"><strong>표 목 차(List of Figure)</strong></font><br/>
	</xsl:if>
	<xsl:for-each select="//표">
		<font class="Bt3">
			<xsl:element name="a">
				<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="제목"/><br/>
			</xsl:element>
		</font>
	</xsl:for-each>
</xsl:variable>

<!-- 그림목차 (List of Figure) ...... -->
<xsl:variable name = "LOF">
	<xsl:if test="//그림그룹">
		<br/><br/><font class="Bt1"><strong>그 림 목 차(List of Figure)</strong></font><br/>
	</xsl:if>
	<xsl:for-each select="//그림그룹">
		<xsl:choose>
			<xsl:when test="그림내용">
				<font class="Bt3">
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="그림내용/@id"/></xsl:attribute><xsl:value-of select="제목"/><br/>
					</xsl:element>
				</font>
			</xsl:when>
			<xsl:when test="서브그림">
				<font class="Bt4">
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="제목/@id"/></xsl:attribute><xsl:value-of select="제목"/><br/>
				</xsl:element>
				</font>
				<xsl:for-each select="서브그림">
					<font class="Bt5">
						<xsl:element name="a">
							<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="그림내용/@id"/></xsl:attribute><xsl:value-of select="제목"/><br/>
						</xsl:element>
					</font>
				</xsl:for-each>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
</xsl:variable>

<!-- 영문목차 ....... -->
<xsl:variable name = "LOE">
	<xsl:if test="count(//영문목차) > 0">
		<br/><br/><font class="Bt1"><strong>Table of Content</strong></font><br/>
	</xsl:if>
	<xsl:for-each select="//영문목차/제목">
		<xsl:choose>
			<xsl:when test="@level = '0'">
				<font class="Bt2"><xsl:value-of select="."/></font><br/>
			</xsl:when>
			<xsl:when test="@level = '1'">&nbsp;
				<font class="Bt3"><xsl:value-of select="."/></font><br/>
			</xsl:when>
			<xsl:when test="@level = '2'">&nbsp;&nbsp;
				<font class="Bt4"><xsl:value-of select="."/></font><br/>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
</xsl:variable>

<!-- 영문표목차 ....... -->
<xsl:variable name = "LOP">
	<xsl:if test="count(//영문표목차) > 0">
		<br/><br/><font class="Bt1"><strong>List of Table</strong></font><br/>
	</xsl:if>
	<xsl:for-each select="//영문표목차/제목">
		<xsl:choose>
			<xsl:when test="@level = '1'">
				<font class="Bt3"><xsl:value-of select="."/></font>
			</xsl:when>
			<xsl:when test="@level = '2'">
				<font class="Bt4"><xsl:value-of select="."/></font>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
</xsl:variable>

<!-- 영문그림목차 ....... -->
<xsl:variable name = "LOG">
	<xsl:if test="count(//영문그림목차) > 0">
		<br/><br/><font class="Bt1"><strong>List of Figure</strong></font><br/>
	</xsl:if>
	<xsl:for-each select="//영문그림목차/제목">
		<xsl:choose>
			<xsl:when test="@level = '1'">
				<font class="Bt3"><xsl:value-of select="."/></font>
			</xsl:when>
			<xsl:when test="@level = '2'">
				<font class="Bt4"><xsl:value-of select="."/></font>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
</xsl:variable>


<!-- ###################################################################################################### -->
<!-- 본문영역																																																-->
<!-- 작성자 : SON Korea 																																										-->
<!-- 작성일 : 2005-01-06 																																										-->
<!-- ###################################################################################################### -->

<!-- (요약서, 목차, 본문, 부록물?, 부속물?) -->
<xsl:template match="연구보고서">
	<div style="padding-left: 50pt; padding-right: 50pt">
		<xsl:apply-templates select="전체요약서"/>
		<xsl:apply-templates select="요약서"/>
		<xsl:apply-templates select="본문"/>
		<xsl:apply-templates select="부록물"/>
		<xsl:apply-templates select="부속물"/>
	</div>
</xsl:template>

<!-- (일반정보, 연구원정보+, 세부사항?, 요약본문+, 키워드?) -->
<xsl:template match="전체요약서">
	<xsl:apply-templates select="일반정보"/>
		<xsl:for-each select="연구원정보">
			<xsl:if test="position() = 1 or preceding-sibling::연구원정보[1]/@유형 != @유형">
<!--				<font class="Tt5"><xsl:value-of select="@유형"/></font>		-->
				<table width="600" border="0">
					<tr>
						<td width="50%">&nbsp;</td>
						<td width="50%" align="left"><font class="Tt5"><xsl:value-of select="@유형"/></font></td>
					</tr> 
				</table>
			</xsl:if>
			<xsl:apply-templates select="."/>
		</xsl:for-each>
		<xsl:apply-templates select="세부사항"/>
		<xsl:for-each select="요약본문">
			<xsl:apply-templates select="."/>
		</xsl:for-each>
	<xsl:apply-templates select="키워드"/>
</xsl:template>

<!-- (일반정보, 연구원정보+, 세부사항?, 요약본문+, 키워드?) : 전체 요약서와 동일하게 처리 -->
<xsl:template match="요약서">
	<xsl:apply-templates select="일반정보"/>
	<xsl:for-each select="연구원정보">
		<xsl:if test="position() = 1 or preceding-sibling::연구원정보[1]/@유형 != @유형">
<!--				<font class="Tt5"><xsl:value-of select="@유형"/></font>		-->
				<table width="600" border="0">
					<tr>
						<td width="50%">&nbsp;</td>
						<td width="50%" align="left"><font class="Tt5"><xsl:value-of select="@유형"/></font></td>
					</tr> 
				</table>
		</xsl:if>
		<xsl:apply-templates select="."/>
	</xsl:for-each>
	<xsl:apply-templates select="세부사항"/>
	<xsl:for-each select="요약본문">
		<xsl:apply-templates select="."/>
	</xsl:for-each>
	<xsl:apply-templates select="키워드"/>
</xsl:template>

<!-- (과제코드, 고유번호?, 과제명+, 세부과제명*, 주관부처명?, 사업명, 발행일?) -->
<xsl:template match="일반정보">
	<xsl:for-each select="중점과제명">
		<br/><br/><br/><center><font class="Tt0"><xsl:value-of select="."/></font></center><br/><br/><br/><br/>
	</xsl:for-each>
	
	<xsl:if test="세부과제명">
			<xsl:for-each select="세부과제명">
				<center><font class="Tt1"><xsl:value-of select="."/></font></center><br/><br/><br/>
			</xsl:for-each>
	</xsl:if>

	<xsl:if test="발행일">
		<center><font class="Tt4"><xsl:value-of select="발행일"/></font></center><br/><br/>
	</xsl:if>

	<xsl:if test="주관부처명">
		<font class="Tt2">
			<center><pre> 주관기관  <xsl:value-of select="주관부처명"/> </pre></center><br/><br/>
		</font>
	</xsl:if>
	<!--
	<xsl:value-of select="과제코드"/>
	<xsl:value-of select="고유번호"/>
	<xsl:value-of select="과제명"/>
	<xsl:value-of select="세부과제명"/>
	<xsl:value-of select="주관부처명"/>
	<xsl:value-of select="사업명"/>
	<xsl:value-of select="발행일"/>
	-->
</xsl:template>


<!-- (과제기간, 연구비정보, 경제사회목적, 개발단계, 기술분류, 참여기업, 기술수명, 수행주체) -->
<xsl:template match="세부사항">
	<xsl:value-of select="과제기간/시작"/>
	<xsl:value-of select="과제기간/종료"/>
	<xsl:value-of select="연구비정보/정부"/>
	<xsl:value-of select="연구비정보/민간"/>
	<xsl:value-of select="경제사회목적"/>
	<xsl:value-of select="개발단계"/>
	<xsl:value-of select="기술분류"/>
	<xsl:value-of select="참여기업"/>
	<xsl:value-of select="기술수명"/>
	<xsl:value-of select="수행주제"/>
</xsl:template>

<!-- 키워드 : 별내용없음 -->
<xsl:template match="키워드">
</xsl:template>

<xsl:template match="본문">
	<xsl:apply-templates select="./*"/>
</xsl:template>

<xsl:template match="본문/제목">
	<xsl:choose>
		<xsl:when test = "@level = '0'">
			<font class="Ct0">
				<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
			</font>
		</xsl:when>
		<xsl:when test = "@level = '1'"><br/><br/><br/><br/>
			<center>
			<font class="Ct0">
				<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/><br/>
			</font>
			</center>
		</xsl:when>
		<xsl:when test = "@level = '2'"><br/><br/><br/>
			<font class="Ct1">
				<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/><br/>
			</font>
		</xsl:when>
		<xsl:when test = "@level = '3'"><br/><br/>
			<font class="Ct2">
				<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/><br/>
			</font>
		</xsl:when>
		<xsl:otherwise><br/>
			<font class="Ct3">
				<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/><br/><br/>
			</font>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="단락">
	<xsl:choose>
		<xsl:when test="수식">
			<xsl:apply-templates select="수식/img"/>		<!-- 탬플릿 없음 -->
		</xsl:when>
		<xsl:when test="그림그룹">
			<xsl:apply-templates select="그림그룹"/>
		</xsl:when>
		<xsl:when test="삽화">
			<xsl:apply-templates select="삽화"/>
		</xsl:when>
		<xsl:when test="표">
			<xsl:apply-templates select="표"/>
		</xsl:when>
		<xsl:when test="목록">
			<xsl:apply-templates select="목록"/>
		</xsl:when>
		<xsl:when test="parent::항목">
			<xsl:choose>
				<xsl:when test="preceding-sibling::단락[1]">
					<xsl:choose>
						<xsl:when test="position() = last()">
							<font class="Ct4"><xsl:value-of select="."/></font>
						</xsl:when>
						<xsl:otherwise>
							<font class="Ct4"><xsl:value-of select="."/></font>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="."/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="제목참조">
			<xsl:choose>
				<xsl:when test="제목참조/@rid">
					&nbsp;
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="제목참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="제목참조"/></font>
					</xsl:element>
				</xsl:when>
				<xsl:otherwise>
					&nbsp;<font size='1' color='red'><xsl:value-of select="제목참조"/></font>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="참고문헌참조">
			<xsl:choose>
				<xsl:when test="참고문헌참조/@rid">
					&nbsp;
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="참고문헌참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="참고문헌참조"/></font>
					</xsl:element>
				</xsl:when>
				<xsl:otherwise>
					&nbsp;<font size='1' color='red'><xsl:value-of select="참고문헌참조"/></font>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="그림참조">
			<xsl:choose>
				<xsl:when test="그림참조/@rid">
					&nbsp;
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="그림참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="그림참조"/></font>
					</xsl:element>
				</xsl:when>
				<xsl:otherwise>
					&nbsp;<font size='1' color='red'><xsl:value-of select="그림참조"/></font>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="표참조">
			<xsl:choose>
				<xsl:when test="표참조/@rid">
					&nbsp;
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="표참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="표참조"/></font>
					</xsl:element>
				</xsl:when>
				<xsl:otherwise>
					&nbsp;<font size='1' color='red'><xsl:value-of select="표참조"/></font>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="각주참조">
		<xsl:choose>
			<xsl:when test="각주참조/@rid">
				&nbsp;
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="각주참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="각주참조"/></font>
				</xsl:element>
			</xsl:when>
			<xsl:otherwise>
				&nbsp;<font size='1' color='red'><xsl:value-of select="각주참조"/></font>
			</xsl:otherwise>
		</xsl:choose>
		</xsl:when>
		<xsl:when test="주참조">
		<xsl:choose>
			<xsl:when test="주참조/@rid">
				&nbsp;
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="주참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="주참조"/></font>
				</xsl:element>
			</xsl:when>
			<xsl:otherwise>
				&nbsp;<font size='1' color='red'><xsl:value-of select="주참조"/></font>
			</xsl:otherwise>
		</xsl:choose>
		</xsl:when>
		<xsl:when test="삽화참조">
			<xsl:choose>
				<xsl:when test="삽화참조/@rid">
					&nbsp;
					<xsl:element name="a">
						<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="삽화참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="삽화참조"/></font>
					</xsl:element>
				</xsl:when>
				<xsl:otherwise>
					&nbsp;<font size='1' color='red'><xsl:value-of select="삽화참조"/></font>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:when test="수식참조">
		<xsl:choose>
			<xsl:when test="수식참조/@rid">
				&nbsp;
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="수식참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="수식참조"/></font>
				</xsl:element>
			</xsl:when>
			<xsl:otherwise>
				&nbsp;<font size='1' color='red'><xsl:value-of select="수식참조"/></font>
			</xsl:otherwise>
		</xsl:choose>
		</xsl:when>

		<xsl:when test="부참조">
		<xsl:choose>
			<xsl:when test="부참조/@rid">
				&nbsp;
				<xsl:element name="a">
					<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="부참조/@rid"/></xsl:attribute><font size='1' color='red'><xsl:value-of select="부참조"/></font>
				</xsl:element>
			</xsl:when>
			<xsl:otherwise>
				&nbsp;<font size='1' color='red'><xsl:value-of select="부참조"/></font>
			</xsl:otherwise>
		</xsl:choose>
		</xsl:when>

		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="parent::본문">
					<font class="Ct4"><xsl:value-of select="."/></font>
				</xsl:when>
				<xsl:when test="parent::부록">
					<font class="Ct4"><xsl:value-of select="."/></font>
				</xsl:when>
				<xsl:when test="parent::요약본문">
					<font class="Ct4"><xsl:value-of select="."/></font>
				</xsl:when>
				<xsl:when test="parent::셀">
					<center><font class="Ct4"><xsl:value-of select="."/></font></center>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="."/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
	<br/><br/>
</xsl:template>

<!-- ========================================================= -->
<!-- 단락끝																										 -->
<!-- ========================================================= -->

<xsl:template match="그림그룹">
	<xsl:choose>
		<xsl:when test="그림내용">
			<center>
				<img>
					<xsl:attribute name="id"><xsl:value-of select="그림내용/@id"/></xsl:attribute>
					<xsl:attribute name="src"><xsl:value-of select="unparsed-entity-uri(그림내용/@NAME)"/></xsl:attribute>
					<xsl:if test="그림내용/@SIZEX">
						<xsl:attribute name="width"><xsl:value-of select="그림내용/@SIZEX"/></xsl:attribute>
					</xsl:if>
					<xsl:if test="그림내용/@SIZEY">
						<xsl:attribute name="height"><xsl:value-of select="그림내용/@SIZEY"/></xsl:attribute>
					</xsl:if>
				</img>
			</center>
		</xsl:when>

		<xsl:when test="서브그림">
			<xsl:for-each select="서브그림">
				<center>
					<img>
						<xsl:attribute name="id"><xsl:value-of select="그림내용/@id"/></xsl:attribute>
						<xsl:attribute name="src"><xsl:value-of select="unparsed-entity-uri(그림내용/@NAME)"/></xsl:attribute>
						<xsl:if test="그림내용/@SIZEX">
							<xsl:attribute name="width"><xsl:value-of select="그림내용/@SIZEX"/></xsl:attribute>
						</xsl:if>
						<xsl:if test="그림내용/@SIZEY">
							<xsl:attribute name="height"><xsl:value-of select="그림내용/@SIZEY"/></xsl:attribute>
						</xsl:if>
					</img>
				</center>
				<center><font class="Ct4"><xsl:value-of select="제목"/></font></center>
			</xsl:for-each>
		</xsl:when>
	</xsl:choose>
	<center>
		<font class="Ct4"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="제목"/></font>
	</center>
</xsl:template>

<xsl:template match="삽화">
	<center>
		<img>
			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
			<xsl:attribute name="src"><xsl:value-of select="unparsed-entity-uri(@NAME)"/></xsl:attribute>
			<xsl:if test="@sizex">
				<xsl:attribute name="width"><xsl:value-of select="@sizex"/></xsl:attribute>
			</xsl:if>
			<xsl:if test="@sizey">
				<xsl:attribute name="height"><xsl:value-of select="@sizey"/></xsl:attribute>
			</xsl:if>
		</img>
	</center>
</xsl:template>

<!--//// 기존표 /////////////////////////////////////////////////////////////////////////////////////////////////-->
<xsl:template match="표">
	<xsl:if test="제목">
		<center>
			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><font class="Ct4"><xsl:value-of select="제목"/></font>
		</center>
	</xsl:if>

	<xsl:if test="표두문">
		<center><xsl:value-of select="표두문"/></center>
	</xsl:if>

	<xsl:choose>
		<xsl:when test="부표">
			<center><xsl:apply-templates select="부표"/></center>
		</xsl:when>

		<xsl:when test="표본문">
			<center><xsl:apply-templates select="표본문"/></center>
		</xsl:when>
	</xsl:choose>
</xsl:template>

<xsl:template match="부표">
	<xsl:if test="제목">
		<font class="Ct4"><xsl:value-of select="제목"/></font>
	</xsl:if>
	<xsl:apply-templates select="표본문"/>
</xsl:template>

<xsl:template match="표본문">
	<xsl:choose>
		<xsl:when test='행'>
			<table border="0">
				<xsl:for-each select="행">
					<tr>
						<xsl:if test="@ho.align">
							<xsl:attribute name="align"><xsl:value-of select="@ho.align"/></xsl:attribute>
						</xsl:if>
						<xsl:if test="@ve.align">
							<xsl:attribute name="valign"><xsl:value-of select="@ve.align"/></xsl:attribute>
						</xsl:if>
						<xsl:apply-templates select="."/>
					</tr>
				</xsl:for-each>
			</table>
		</xsl:when>
		<xsl:when test='img'>
			<xsl:apply-templates select='img'/>
		</xsl:when>
	</xsl:choose>
</xsl:template>

<xsl:template match="img">
	<center>
		<img>
			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
			<xsl:attribute name="src"><xsl:value-of select="unparsed-entity-uri(@NAME)"/></xsl:attribute>
			<xsl:if test="@sizex">
				<xsl:attribute name="width"><xsl:value-of select="@sizex"/></xsl:attribute>
			</xsl:if>
			<xsl:if test="@sizey">
				<xsl:attribute name="height"><xsl:value-of select="@sizey"/></xsl:attribute>
			</xsl:if>
		</img>
	</center>
</xsl:template>

<xsl:template match="목록">
	<xsl:apply-templates select="./*"/>
</xsl:template>


<!-- ========================================================= -->
<!-- 부록물																										 -->
<!-- ========================================================= -->
<xsl:template match="부록물">
	<br/><br/><center><font class="Ct1">부 록</font></center>
	<xsl:apply-templates select="부록"/>
</xsl:template>

<xsl:template match="부록">
	<xsl:apply-templates select="./*"/>
</xsl:template>

<xsl:template match="부록/제목">
	<xsl:choose>
		<xsl:when test = "@level = '1'">
			<font class="Ct2"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/></font>
		</xsl:when>
		<xsl:when test = "@level = '2'">
			<font class="Ct3"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/></font>
		</xsl:when>
		<xsl:when test = "@level = '3'">
			<font class="Ct4"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/></font>
		</xsl:when>
		<xsl:otherwise>
			<font class="Ct4"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute><xsl:value-of select="."/></font>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<!-- ========================================================= -->
<!-- 부속물																										 -->
<!-- ========================================================= -->
<xsl:template match="부속물">
	<xsl:apply-templates select="참고문헌"/>
</xsl:template>

<xsl:template match="참고문헌">
	<br/><br/><br/><center><font class="Ct1">참 고 문 헌</font></center><br/>
	<xsl:apply-templates select="./*"/>
</xsl:template>

<xsl:template match="참고문헌/분야">
	<font class="Ct4"><strong>분야 : <xsl:value-of select="."/></strong></font>
</xsl:template>

<xsl:template match="참고문헌/헤더">
</xsl:template>

<xsl:template match="참고문헌/저자명">
	<font class="Ct4"><xsl:value-of select="."/> &nbsp;,</font>
</xsl:template>

<xsl:template match="참고문헌/표제사항">
	<font class="Ct4"><strong>
		<xsl:attribute name="id"><xsl:value-of select="기사명/@id"/></xsl:attribute>
		<xsl:value-of select="기사명"/> &nbsp;,
		<xsl:if test="표제">
			<xsl:value-of select="표제"/> &nbsp;
		</xsl:if>
	</strong></font>
</xsl:template>

<xsl:template match="참고문헌/형태사항">
	<font class="Ct4">
			<xsl:if test="true()=Vol">
				<xsl:value-of select="Vol"/> &nbsp;,
			</xsl:if>
			<xsl:if test="true()=No">
				<xsl:value-of select="No"/> &nbsp;,
			</xsl:if>
			<xsl:if test="true()=Page">
				<xsl:value-of select="Page"/> &nbsp;,
			</xsl:if>
			<xsl:if test="true()=Part">
				<xsl:value-of select="Part"/> &nbsp;,
			</xsl:if>
	</font>
</xsl:template>

<xsl:template match="참고문헌/발행사항">
	<font class="Ct4">
		<xsl:if test="true()=발행기관">
			<xsl:value-of select="발행기관"/>&nbsp;,
		</xsl:if>
		<xsl:if test="true()=출판지">
			<xsl:value-of select="출판지"/>&nbsp;,
		</xsl:if>
		<xsl:if test="true()=출판사">
			<xsl:value-of select="출판사"/>&nbsp;,
		</xsl:if>
		<xsl:if test="true()=출판년">
			<xsl:value-of select="출판년"/>&nbsp;
		</xsl:if>
	</font>
	<p/>
</xsl:template>

<xsl:template match="참고문헌/URL">
	<font class="Ct4"><xsl:value-of select="."/></font>
	<p/>
</xsl:template>

<xsl:template match="참고문헌/기타사항">
	<xsl:choose>
		<xsl:when test="img">
			<xsl:apply-templates select="img"/>
		</xsl:when>
		<xsl:otherwise>
			<font class="Ct4"><xsl:value-of select="."/></font>
		</xsl:otherwise>
	</xsl:choose>
	<p/>
</xsl:template>

<!-- ========================================================= -->
<!-- 기타사항																									 -->
<!-- ========================================================= -->
<!-- (수행기관, 연구책임자, 연구원*) -->
<xsl:template match="연구원정보">
	<xsl:if test="수행기관">
			<table width="600" border="0">
				<tr>
				<td width="40%">&nbsp;</td>
				<td width="15%" class="Tt5" align="right">수 행 기 관 : </td>
			<td width="45%" class="Tt5"><xsl:value-of select="수행기관"/></td>
			</tr> 
		</table>
	</xsl:if>
	<xsl:if test="연구책임자">
			<table width="600" border="0">
				<tr>
				<td width="40%">&nbsp;</td>
				<td width="15%" class="Tt5" align="right">연구책임자 : </td>
			<td width="45%" class="Tt5"><xsl:apply-templates select="연구책임자"/></td>
			</tr> 
		</table>
	</xsl:if>
	<xsl:if test="연구원">
		<xsl:for-each select="연구원">
			<table width="600" border="0">
				<tr>
				<td width="40%">&nbsp;</td>
				<td width="15%" class="Tt5" align="right">참여연구원 : </td>
				<td width="45%" class="Tt5"><xsl:value-of select="."/></td>
				</tr> 
			</table>
		</xsl:for-each>
	</xsl:if>
</xsl:template>

<!-- (책임자명, 주민번호?, email?, 전화번호?) -->
<xsl:template match="연구책임자">
	<xsl:value-of select="성명"/>
	<xsl:if test="주민번호">
		<br/><xsl:value-of select="주민번호"/>
	</xsl:if>
	<xsl:if test="email">
		<br/><xsl:value-of select="email"/>
	</xsl:if>
	<xsl:if test="전화번호">
		<br/><xsl:value-of select="전화번호"/>
	</xsl:if>
</xsl:template>

<xsl:template match="요약본문">
	<xsl:apply-templates select="./*"/>
</xsl:template>

<xsl:template match="요약본문/제목">
	<xsl:choose>
		<xsl:when test="position() = '1' and ../@언어 = 'kr'">
			<br/><br/><br/><br/><center><strong><font class="Ct0">요 약 문</font></strong></center><br/><br/>
		</xsl:when>

		<xsl:when test="position() = '1' and ../@언어 = 'en'">
			<br/><br/><br/><br/><center><strong><font class="Ct0">Summary</font></strong></center><br/><br/>
		</xsl:when>
	</xsl:choose>

	<font class="Ct2"><strong><xsl:value-of select="."/></strong></font><br/><br/>
</xsl:template>

<xsl:template match="헤더">
	<font class="Ct4"><xsl:value-of select="."/></font>
</xsl:template>

<xsl:template match="항목">
	<xsl:choose>
		<xsl:when test="ancestor::셀[1]">
			<font class="Ct4"><xsl:text>● </xsl:text> <xsl:apply-templates select="단락"/></font>
		</xsl:when>
		<xsl:when test="position() = last()">
			<font class="Ct4"><xsl:text>● </xsl:text> <xsl:apply-templates select="단락"/></font>
		</xsl:when>
		<xsl:when test="position() = 1">
			<font class="Ct4"><xsl:text>● </xsl:text> <xsl:apply-templates select="단락"/></font>
		</xsl:when>
		<xsl:otherwise>
			<font class="Ct4"><xsl:text>● </xsl:text> <xsl:apply-templates select="단락"/></font>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="행">
	<xsl:for-each select="열">
		<td>
			<xsl:if test="@colno">
				<xsl:attribute name="colspan"><xsl:value-of select="@colno"/></xsl:attribute>
			</xsl:if>
			<xsl:if test="@rowno">
				<xsl:attribute name="rowspan"><xsl:value-of select="@rowno"/></xsl:attribute>
			</xsl:if>
			<xsl:if test="@ho.align">
				<xsl:attribute name="align"><xsl:value-of select="@ho.align"/></xsl:attribute>
			</xsl:if>
			<xsl:if test="@ve.align">
				<xsl:attribute name="valign"><xsl:value-of select="@ve.align"/></xsl:attribute>
			</xsl:if>
			<xsl:apply-templates select="셀"/>
		</td>
	</xsl:for-each>
</xsl:template>

<xsl:template match="셀">
	<xsl:apply-templates select="./*"/>
</xsl:template>

<!-- ###################################################################################################### -->
<!-- 여기까지 테스트 함...																																									-->
<!-- 작성자 : SON Korea 																																										-->
<!-- 작성일 : 2005-01-06 																																										-->
<!-- ###################################################################################################### -->



</xsl:stylesheet>

