상황는 다음과 같이 나는 또한 속성을 가지고java를 사용하여 .xsl 파일에서 .properties 파일을 읽는 방법?</p> <pre><code>DETAIL=This is format detail HEADER=This is format header </code></pre> <p><strong>문제</strong>이 : 내가하려고
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" x
mlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Hello</title>
</head>
<body >
<div align="center">
<table border="1">
<tr>
<td >
<h1 >
<span>@[email protected]</span>
</h1>
<div>
<p>
@[email protected]
</p>
</div>
</tr>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
는 저장 키 - 값 쌍을 다음과 같은 스타일/템플릿을 제기했다 xsl
을 html
파일로 변환하기 위해 자바 프로그램을 작성하십시오. 그래서 나는 .xsl
(@로 묶인) 키의 값을 언급 된 값으로 대체하려고합니다 .properties file
에서. 내 제약 조건은 .xsl
파일을 수정할 수 없다. TransformerFactory
을 시도했지만 아무도이 문제를 해결할 수 없습니까?
당신은 위의 XSLT 문서를 처리하는 XSLT (2.0)를 사용하고 글로벌 매개 변수'로 참조'@은'@ PROPERTY_NAME 중 하나를 대체 할 수있는 '와'< xsl : value-of select = "$ PROPERTY_NAME"/>'이면 새 XSLT를 실행하고 속성 파일에있는 모든 속성을 매개 변수로 변환에 전달할 수 있습니다. 그러나 질문 샘플에서 이름은 일치하지 않습니다 (예 :'@ HEADER @ '대'FORMAT_HEADER'). –