CDATA and HTML embedded content - need help with settings

Former Member
Former Member

Hello all,

I've been struggling with a settings file for an XML for the last 3 days.

I'm currently using Studio 2014 SP2 (I can also use Studio 2017 if that would be better, I'm just more familiar with 2014).

Windows 7 based PC.

The XML file has been created from FIRST_Spirit.

CDATA is NOT to be translated (it contains a string of alpha-numeric which should not be visible in the bilingual file).

There is HTML embedded content - currently, this is minimal, so I can live without these tags if necessary.

XML content:

 

I've got CMS_Values that should not be translated: "stImParams" - that part I can get to work right. But I cannot get the CDATA to NOT appear in the bilingual. I've used both settings types in Studio 2014.

Does anyone have any suggestions?

Thanks in advance, Mindy

  • Hi ,

    It would have been good to have a small text file to make sure of the advice, but can't you just make the content of the rootelement non-translatable? That seems to be the only element holding CDATA.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Former Member
    0 Former Member in reply to Paul
    Ok, that makes sense the more that I look at it. Thanks, Paul.
  • Former Member
    0 Former Member in reply to Paul
    I've been able to get the settings file to be correct. After I pseudo-translate, and save target as, I now have a completely different structure in the target XML:

    <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">
    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE" />
    </PAGENODE>
    - <CMS_VALUE name="ptTitle">
    - <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">
    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">Déposer étrangères</PAGE>
    </PAGENODE>
    </CMS_VALUE>
    - <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">
    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE" />
    </PAGENODE>
    - <CMS_VALUE name="ptMetaDescription">
    - <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">
    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">Données artificiel antioxygènes université</PAGE>

    What piece am I missing?
    Best, Mindy
  • What exactly do you mean? That the attributes are in different order? If thsi is what you mean, than don't worry about it - the attributes order is irrelevant in XML. And there is NO WAY to control their order... because from the XML perspective it's irrelevant.
  • Former Member
    0 Former Member in reply to Evzen Polenka

    Thanks for the reply Evzen, but now I have additional Page Node entries.

    For example: My source document shows

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>

    <!DOCTYPE FIRSTspirit_XML_EXPORT SYSTEM "TranslationXml.dtd">

    <FIRSTspirit_XML_EXPORT sourceLanguage="EN" version="5.2.1403.76473"><![CDATA[

    Server: wcms.xxx.info:443

    Version: 5.2.1403.76473

    Project: xxx.us 2017 (ID:839292)

    Root: '01_corporate_home' (ID:987129)

    Revision: 133106 (Feb 26, 2018 4:49:01 PM)

    Exported: Feb 26, 2018 5:53:46 PM

    Configuration:

    Source language: English (EN)

    Only referenced pages: no

    Ignored template ids: [none]

    Ignored sitestore variables: [none]

    ]]>

    <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">

    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">

    <CMS_VALUE name="ptTitle">My Americas</CMS_VALUE>

    After the CDATA, I have one entry/row for PAGENODE, then one entry/row for PAGE revision, then to CMS_VALUE. I didn't even translate the file, I opened the bilingual and did Save Target as and I'm now with this (top part ok, but all text after CDATA is now full of additional tags):

    <?xml version="1.0" encoding="utf-8" standalone="no"?>

    <!DOCTYPE FIRSTspirit_XML_EXPORT SYSTEM "TranslationXml.dtd">

    <FIRSTspirit_XML_EXPORT sourceLanguage="EN" version="5.2.1403.76473"><![CDATA[

    Server: wcms.xxx.info:443

    Version: 5.2.1403.76473

    Project: xxx.us 2017 (ID:839292)

    Root: '01_corporate_home' (ID:987129)

    Revision: 133106 (Feb 26, 2018 4:49:01 PM)

    Exported: Feb 26, 2018 5:53:46 PM

    Configuration:

    Source language: English (EN)

    Only referenced pages: no

    Ignored template ids: [none]

    Ignored sitestore variables: [none]

    ]]>

    <PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">

    <PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">

    </PAGE></PAGENODE>

    <CMS_VALUE name="ptTitle"><PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE"><PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">My Americas</PAGE></PAGENODE></CMS_VALUE><PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE"><PAGE revision="126445" uid="01_corporate_home_1" uidType="PAGESTORE">

    </PAGE></PAGENODE><CMS_VALUE name="ptMetaDescription"><PAGENODE revision="98311" uid="01_corporate_home" uidType="PAGESTORE">

    There are now closing PAGENODE, PAGE tags, and my CMS_VALUE has now been populated with many of these PAGE/PAGENODE tags.

    Suggestions?

  • Yes... please send us a test source file, your settings file, and your translated sdlxliff. You can send this to pfilkin@sdl.com

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Hi ,

    Just wanted to close this one off as we seem to have resolved it by looking at the rules that were really needed and then creating the XML file with these rules only. As opposed to importing all the elements and then trying to adapt them all to get what was needed. The problem with working this way is it's easy to have overlapping requirements and in fact Studio did complain with errors that invalid XML might get generated. So keeping it simple was the answer.

    Also worth noting that it isn't possible (as far as I'm aware) to identify elements containing CDATA using XPath. This is only a mechanism for supporting a dump of anything including characters that would be illegal in XML normally and can't be traced using XPath. So we found a way to identify these unwanted CDATA sections using the content of the attribute value as this seemed to include the word 'link' somewhere in the value whenever CDATA sections were included.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub