OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Fragment ID examples and their implementation via XSLT tools


Yves and all,

 

Yves raised the question of how easy/difficult/possible/impossible would it be for an XSLT-based tool to implement the current Fragment ID design. And Yves provided three examples (listed below).

 

My current XSLT tools are strictly extractor agents and merger agents. So the best implementation I could provide would be for my tool to validate in examples 1 and 2  that the Frag ID the syntax is correct and resolvable. If so, faithfully process the file (which would not act any further on the Frag ID). If not, refuse to process the XLIFF (and as a bonus, report the error).

 

And example 3 would have no impact on my current XSLT-based tools.

 

For the sake of testing implement-ability of example 3, I could create a simple XSLT that acts as a merger where the task is to read the XLIFF file, and create the external report that Yves specified.

 

Here’s my question. If I do these three use cases, will that be robust enough to answer the question Yves raised? If not, what are some further use cases people can imagine to satisfy the question?

 

Thanks,

 

Bryan

 

[[

 

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>

 

]]

 

 

[[

 

Example 3: Reference from an external document.

 

In this example, a tool has processed an XLIFF document to generate a list of all target segments that have the same source text but have different translations. The result is an XML document holding references to the segments where the inconsistency has been found.

 

For instance the IRI "document.xlf#/f=fileOne/u=m12/s0" points to the segment id="s0", in the unit id="m12", in the file id="fileOne" of the XLIFF document named "document.xlf".

 

Report document:

 

<?xml version="1.0"?>

<consistencyCheck perFile="false">

<sameSourceDifferentTargets>

  <target ref="document.xlf#/f=fileOne/u=m12/s0"/>

  <target ref="document.xlf#/f=fileOne/u=m203/s3">

</ sameSourceDifferentTargets>

<sameSourceDifferentTargets>

  <target ref="document.xlf#/f=fileOne/u=m123/s1"/>

  <target ref="document.xlf#/f=fileTwo/u=ui3453/seg_65">

</ sameSourceDifferentTargets>

</consistencyCheck>

 

XLIFF document (document.xlf):

 

<?xml version="1.0"?>

<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0"

 srcLang="en" trgLang="fr">

<file id="fileOne">

  <unit id="m12">

   <segment id="s0" state="translated">

    <source>Searching...</source>

    <target>Rechercher...</target>

   </segment>

  </unit>  <unit id="m123">

   <segment id="s1" state="translated">

    <source>Opening the XLIFF file...</source>

    <target>Ouverture du fichier XLIFF...</target>

   </segment>

  </unit>

  <unit id="m203">

   <segment id="s2" state="translated">

    <source>Searching...</source>

    <target>Recherche en cours...</target>

   </segment>

  </unit>

</file>

<file id="fileTwo">

  <unit id="ui3453">

   <segment id="seg_65" state="translated">

    <source>Opening the XLIFF file...</source>

    <target>Ouverture du document XLIFF...</target>

   </segment>

  </unit>

</file>

</xliff>

 

 

]]

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]