Hi all,
I have got a question about XML file types and how to properly import them into Studio. My colleague asked me to help her prepare an XML file with lots of XML tags, but I tried several times now and cannot get these tags to disappear. So I am sure I am missing something. :-)
I have tried to prepare these files following the steps in Paul Filkin's blog about importing XML files into Studio (https://multifarious.filkin.com/2014/06/01/custom-xml/) but I have trouble identifying the exact tags in the text and which one is an attribute and which one an element. Following Paul's steps, I don't think any tags have been replaced by normal Studio tags, so I am really wondering how to proceed now. :-)
Some examples of tags that occur in this text are:
Text to be translated z\u2019n text to be translated.\u201d<\/strong><\/em><\/p>\n<h2>Text to be translated<\/h2>\n<p>Text to be translated\u00a0www.url.nl.<\/p>","field":"","settings":[]},{"url":"","size":"","width":"","height":"","extension":"","field":7,"settings":[]}],"fieldcounts":{"":1,"7":1},"_isContentBlocks":true}}
Text to be translated z\u2019n text to be translated.\u201d<\/strong><\/em><\/p>\\n<h2>Text to be translated<\/h2>\\n<p>Text to be translated\u00a0www.url.nl.<\/p>\",\"field\":\"\",\"settings\":[]},{\"url\":\"\",\"size\":\"\",\"width\":\"\",\"height\":\"\",\"extension\":\"\",\"field\":7,\"settings\":[]}]},\"settings\":[],\"parent\":0,\"title\":\"\"}]","linear":[{"value":"<p>Text to be translated\u00a0text to be translated.
"[{\"layout\":1,\"content\":{\"main\":[{\"value\":\"<p>Text to be translated\u00a0Midden Nederland Hallen.
"[{\"layout\":1,\"content\":{\"main\":[{\"rows\":[{\"image\":{\"url\":\"uploads\/uploads\/2017_07\/mg-2320-verkleind.jpg\",\"size\":\"786915\",\"width\":\"1596\",\"height\":\"1065\",\"extension\":\"jpg\",\"fieldId\":\"contentblocks-field-2\"},\"video\":{\"value\":\"cTacM-EifHw\",\"fieldId\":\"contentblocks-field-3\"}}],\"field\":19,\"settings\":{\"video_title\":\"Text to be translated\",\"video_text\":\"Text to be translated.\",\"button_link\":\"12\",\"button_title\":\"Contact\"}}]},\"settings\":[],\"parent\":0,\"title\":\"\"},{\"layout\":2,\"content\":{\"main\":[{\"value\":\"Text to be translated\",\"level\":\"h2\",\"field\":1,\"settings\":[]},{\"value\":\"<p><span><span>Text to be translated
Text to be translated\u00a0<span>text to be translated.<\/span><\/span><\/span><\/p>\",\"field\":6,\"settings\":[]},{\"files\":[{\"url\":\"\/uploads\/files\/routebeschrijving.pdf\",\"title\":\"Routebeschrijving\",\"size\":\"169606\",\"upload_date\":\"1484577034\",\"extension\":\"pdf\"}],\"field\":16,\"settings\":[]}]},\"settings\":[],\"parent\":0,\"title\":\"\"},{\"layout\":2,\"content\":{\"main\":[{\"value\":\"Text to be translated\",\"level\":\"h2\",\"field\":1,\"settings\":[]},{\"value\":\"<p><span>Text to be translated\u00a0Text to be translated.\u00a0<\/span><span style=\\\"line-height:
1.5em;\\\">Text to be translated\u00a0<\/span><span style=\\\"line-height:
As you can see, there are quite a lot of tags that I would like to get rid of, so the translator can easily work on this file. The tags that determine the font and colour of the text should be easily removable, by selecting CDATA sections in the Embedded Content. However, that neither seemed to work for me.
In summary, I did the following:
- Create a new file type following Paul Filkin's blog. As a rule file I chose one of the XML files for this translation, since these have all tags etc. in the file that I want to use in my new file type.
- Define the parser rules. Although I just get rule results that do not seem to correspond to the tags in the text. See the screenshot below:
Here, I have trouble defining which rules should be translated and which ones should be set to attribute and element. I think only the //* should be defined as XPath right?
3. For file detection, I used the already filled out function "resource", which is different from Paul's "rootelement", but shouldn't be a problem I would say.
4. Now the new file type is finished, I created a new Embedded Content Processor, also following Paul's steps, and mine was also based on HTML5. But how to decide which to base your ECP on? Because for my file, it might be best to use another one.
My apologies for this very long post and question, but hopefully I gave all information necessary so someone can help me to import this kind of files into Studio 2017 easier.
Thanks so much!