← Prev in month
← Prev in thread
Frag ID example
Hi Bryan, all,
To follow up on the topic of making the Fragment Identifier section better with examples, would those two and the accompanying text
be helpful?
[[
Example 1: Relative reference to a note.
In the following example, a comment annotation points to a <note> element in the same unit. The expression "#n=n1" is relative to
its location so only the note selector is needed.
<?xml version="1.0"?>
<xliff xmlns='urn:oasis:names:tc:xliff:document:2.0' version='2.0'
srcLang='en' trgLang='fr'>
<file id='f1'>
<unit id="1">
<notes>
<note id="n1">Maybe "vie" should be capitalized, not sure.</note>
</notes>
<segment state='translated'>
<source>It's life!</source>
<target>C'est la <mrk id='m1' type='comment' ref="#n=n1">vie</mrk> !</target>
</segment>
</unit>
</file>
</xliff>
Example 2: Reference to a custom extension.
In the following example, a custom inline annotation refers to an element in the custom namespace identified by the IRI
"example.com/myNamespace" and located at the <file> level. The expression "#f=f1/my=set1" means: the element in the namespace
associated with the prefix "my", with an id or xml:id attribute set to "set1", within the <file> with id="f1".
The prefix "my" must be registered. Note that while that it makes the code more clear to use the same string "my" for the namespace
prefix declared in the <my:issues> element, both strings do not have to be the same.
<?xml version="1.0"?>
<xliff xmlns='urn:oasis:names:tc:xliff:document:2.0' version='2.0'
srcLang='en' trgLang='fr'>
<file id='f1'>
<my:issues xml:id="set1" xmlns:my="example.com/myNamespace">
<my:issue type="misspelling" info="'c'es' is unknown. Could be 'c'est'"/>
<my:issue type="typographical" info="Sentence without capitalization"/>
</my:issues>
<unit id="1">
<segment state='translated'>
<source>It's life!</source>
<target><mrk id='m1' type='my:issues' ref="#f=f1/my=set1">c'es</mrk> la vie !</target>
</segment>
</unit>
</file>
</xliff>
]]
← Prev in month
← Prev in thread