XLIFF 2.0 notes not coming into Passolo

I had this problem with XLIFF 1.2. When I try to implement the same or similar fix it isn't working. Here is what my en XLIFF looks like:

<?xml version="1.0" ?>
<xliff srcLang="en-US" trgLang="en-US" version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0">
<file id="en-US.xlf">
<unit id="i18n.infra.config.tools.uiLabel.mim">
<notes>
<note appliesTo="source">Name of MIM tool</note>
</notes>
<segment>
<source>MIM</source>
<target>MIM</target>
</segment>
</unit>

Here is my line from XFG

<?xml version="1.0" encoding="UTF-16"?>
<CXMLRules>
<RuleList>
<CXMLRule m_strName="XLIFF Project" m_bResolveExternal="False">
<RootElements>
<RootElement Name="xliff"/>
</RootElements>
<ResTypes/>
<RuleData>
<CXMLGroup ElementName="file" IDAttributeName="Id" HandlingOfGroups="1"/>
<CXMLData ElementName="unit/segment/source" IDAttributeName="id" TElementName="target" IsTElement="True" HandlingOfWhiteSpaces="0" HandlingOfEmbeddedElements="0" AppendElementNameToID="False" UseSegmenter="False">
<Attributes>
<CXMLAttribute AttributeName="parent::*/descendant::alt-trans/source | parent::*/descendant::alt-trans/target,multiple" CopyAttributeName="False" AttributeAction="0"/>
<CXMLAttribute AttributeName="parent::*[attribute::translate='no']/attribute::translate" CopyAttributeName="False" AttributeAction="1"/>
<CXMLAttribute AttributeName="parent::*[attribute::translate='yes']/attribute::translate" CopyAttributeName="False" AttributeAction="2"/>
<CXMLAttribute AttributeName="ancestor::group/context-group/context[attribute::context-type='IGNORE_IT'][text()='YES']" CopyAttributeName="False" AttributeAction="3"/>
<CXMLAttribute AttributeName="ancestor::group/context-group/context[attribute::context-type='IGNORE_IT'][text()='NO']" CopyAttributeName="False" AttributeAction="4"/>
<CXMLAttribute AttributeName="parent::*/pdns:notes/pdns:note/attribute::applies-to | parent::*/pdns:notes/pdns:note,valueid" CopyAttributeName="False" AttributeAction="0"/>

I had to change CMLData ElementName to "Unit/segment/source" to get the strings to come into Passolo. 

I there any good documentation that describes the XML tags and options? The Passolo doc is pretty thin. I have two projects now that have different formats and would like to better understand what these lines are doing and how I can use them to my advantage. Neither project has used a tool like Passolo. So we are evaluating to see if it will work for our validation efforts. 

 

Parents
  • In such cases is better to remove the namespace "xmlns="urn:oasis:names:tc:xliff:document:2.0"" from the file and then try to fix the rule. Once those are added you can look into adding the Namespace pdns.

    Note that for your file the notes element is not parent to the source element so you have to go two levels up.

    You can use ancestor::unit for this then you just add the path to the note element, and the end you can add the PDNS as well and end result is:

    parent::pdns:unit/descendant::pdns:notes/pdns:note

    This seems to work fine on my tests but please validate it for your files.

    As for XML tags and options those are implemented using XML XPATH - you can try to search for XPATH parent or ancestor to see more details.

  • I have tried what I think you are saying, but I am still not seeing anything in Passolo. I will admit I am new to XML and creating these parsing rules. Here is what I changed:

    <CXMLAttribute AttributeName="ancestor::unit[attribute::context-type='IGNORE_IT'][text()='YES']" CopyAttributeName="False" AttributeAction="3"/>
    <CXMLAttribute AttributeName="ancestor::unit[attribute::context-type='IGNORE_IT'][text()='NO']" CopyAttributeName="False" AttributeAction="4"/>
    <CXMLAttribute AttributeName="parent::pdns:unit/descendant::pdns:notes/pdns:note/attribute::applies-to | parent::pdns:unit/descendant::pdns:notes/pdns:note,valueid" CopyAttributeName="False" AttributeAction="0"/>

    I am happy to send you the files and talk offline too. 

    Thanks for your quick responses.

  • My mistake, I've copied the wrong rule. The correct one is using ancestor - as you need to jump two levels up - and parent is only one level up.

    ancestor::pdns:unit/descendant::pdns:notes/pdns:note

    This rule basically select the UNIT ancestor starting from Source element and then selects the NOTES element from it then the NOTE

  • Can you send me a sample project? I have tried a few different ways and verifed that my changes are be pulled into Passolo, but in the configuration viewer I am still not seeing the fields I want being selected. I think I finally am getting Ancestor/Parent/Decendant, but don't know why it isn't working. I also removed the XMLS from the source file too. So now I have added these three lines:

    <CXMLAttribute AttributeName="ancestor::group/notes/note[attribute::context-type='IGNORE_IT'][text()='YES']" CopyAttributeName="False" AttributeAction="3"/>
    <CXMLAttribute AttributeName="ancestor::group/notes/note[attribute::context-type='IGNORE_IT'][text()='NO']" CopyAttributeName="False" AttributeAction="4"/>

    Don't know if these even need to be there, but they are present in the project that is working.

    <CXMLAttribute AttributeName="ancestor*::/descendant::pdns:notes/pdns:note/attribute::appliesto | ancestor*::/descendant::pdns:notes/pdns:note,valueid" CopyAttributeName="False" AttributeAction="0"/>

    I changed to ancestor*, but tried with the explicit ancestor::pdns:unit/...

    Thanks

Reply
  • Can you send me a sample project? I have tried a few different ways and verifed that my changes are be pulled into Passolo, but in the configuration viewer I am still not seeing the fields I want being selected. I think I finally am getting Ancestor/Parent/Decendant, but don't know why it isn't working. I also removed the XMLS from the source file too. So now I have added these three lines:

    <CXMLAttribute AttributeName="ancestor::group/notes/note[attribute::context-type='IGNORE_IT'][text()='YES']" CopyAttributeName="False" AttributeAction="3"/>
    <CXMLAttribute AttributeName="ancestor::group/notes/note[attribute::context-type='IGNORE_IT'][text()='NO']" CopyAttributeName="False" AttributeAction="4"/>

    Don't know if these even need to be there, but they are present in the project that is working.

    <CXMLAttribute AttributeName="ancestor*::/descendant::pdns:notes/pdns:note/attribute::appliesto | ancestor*::/descendant::pdns:notes/pdns:note,valueid" CopyAttributeName="False" AttributeAction="0"/>

    I changed to ancestor*, but tried with the explicit ancestor::pdns:unit/...

    Thanks

Children