Google 번역 서비스에 따라 준비된 strings.xml 파일로 작업하고 있습니다. 번역해야하는 문자열 부분을 xliff로 묶어야합니다. 이 같은 g 태그 : 나는 이름이 "game_starts_now"을 검색하여 첫 번째 값을 추적하는 경우 <xliff:g>some text</xliff:g>
예를 들어AS3 XML 자식 텍스트가있는 내부 텍스트
, 내 strings.xml의 파일은
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:xliff="rn:oasis:names:tc:xliff:document:1.2">
<string name="game_starts_now">Game Starts Now</string>
<string name="game_starts_in">Game Starts In <xliff:g id="seconds" example="20">{0}</xliff:g> seconds</string>
</resources>
, 그것은 예상대로 추적합니다,하지만 난 경우 "game_starts_in"을 추적하여 존재하는 전체 XML 노드를 제공합니다.
예 :
trace((xml.string.(@name == "game_starts_now"))); // Game Starts Now
trace((xml.string.(@name == "game_starts_in"))); // [output is next 4 lines]
// <string name="game_starts_in" xmlns:xliff="rn:oasis:names:tc:xliff:document:1.2">
// Game Starts In
// <xliff:g id="seconds" example="20">{0}</xliff:g>
// </string>
자식 노드없이 <string>
의 전체 내부 텍스트를 얻을 수있는 방법이 있나요? 나는 2 추적 출력을 다음 텍스트를 가지고 싶습니다
Game Starts In {0} seconds
'trace ((xml.string. (name == "game_starts_in")). text())'시도해 보시고,'Game Starts Inseconds'를 받으실 것입니다. – akmozo