그것은 자바 스크립트 변수를 사용하여다른 파일의 javascript 변수를 사용하여 xsl 변수를 만드는 방법은 무엇입니까?
<xsl:variable name="x"><xsl:value-of select="country" /></xsl:variable>
를 사용하여 XSL 변수를 만들 수 있습니까?
변수 "country"는 xslt에 포함되지 않은 다른 javascript 파일에서 만들어집니다. 아약스를 사용하여 사용자 위치의 국가를 얻으려고합니다.
-------------- 자바 스크립트 파일 --------------
$(document).ready(function()
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$.getJSON('http://ws.geonames.org/countryCode', {
lat: position.coords.latitude,
lng: position.coords.longitude,
type: 'JSON'
}, function(result) {
country = result.countryCode;
});
});
};
더 좋은 방법이 있다면 , 회신을 부탁드립니다. 미리 감사드립니다.
그래서 국가를 XSL에 전달 하시겠습니까? 또는 XSL에서 검색 할 수 있습니까? – JLRishe
javascript의 JSON 값을 사용하여 xsl로 전달한 후 xsl로 전달하고 싶습니다. – emochoco