How to continue processing xml file instructions in SDL Tridion?

I am trying to add processing instructions to my XML file in the original view of the xml component. For example:

<?altova_sps C:\Users\src\sps\2012\spsfile.sps?> <my_element xmlns="uuid:8d903098-e607-4d96-90a7-14d2d188dab7"> ... </my_element> 

After I click “Save”, the Tridion CME automatically deletes the processing instruction. Is there any way to change this behavior?

(I want to add a processing instruction so that I can open the XML file using XMLSpy in Authentic View using WebDAV)

+7
source share
2 answers

I studied this a bit, and I'm not sure if this can be done from within the CMS. However, you can probably achieve this by creating an HTTPModule or proxy or some form that converts requests and responses made to the / webdav CME directory.

Conceptually, when XMLSpy makes a request, the new module will pre-defer the required instruction in XML based on the element that is the Component and the Schema on which it is based. Then, when you save (POST) the data back, you will need to disable it again. This would leave the XML structure in the format required by the SDL Tridion.

Hope that helps

Chris

+3
source

I am posting this as an idea - although I cannot get it to do what you want. I wrote an EventHandler to process the XML received by XMLSpy (and all clients, including CME, at this point).

 using System; using System.Text; using System.Xml; using Tridion.ContentManager.Extensibility.Events; using Tridion.ContentManager.Extensibility; using Tridion.ContentManager.ContentManagement; using System.IO; namespace UrbanCherry.Net.SDLTridion.EventHandlers { [TcmExtension("AppendAuthenticHeaders")] public class AppendAuthenticHeaders : TcmExtension { public AppendAuthenticHeaders() { Subscribe(); } public void Subscribe() { EventSystem.Subscribe<Component, LoadEventArgs>(AppendAuthenticHeader, EventPhases.Processed); } private void AppendAuthenticHeader(Component source, LoadEventArgs args, EventPhases phase) { if (source.ComponentType != ComponentType.Multimedia) { XmlDocument newXml = new XmlDocument(); newXml.LoadXml("<?altova_sps C:\\Users\\src\\sps\\2012\\spsfile.sps?>" + source.Content.OuterXml); source.Content = newXml.DocumentElement; } } } } 

I tried to manipulate the output (by replacing the string) and it appears in XMLSpy via WebDAV. The problem is that adding a processing command goes beyond the scope of the DocumentElement, so it never turns into new XML.

So, I know that this does not solve your problem - but maybe someone else knows about an event that will allow you to add instructions when XML is loaded through the WebDAV cartridge in a similar way.

Hope someone else can help you close this - I will dig a little more if I have time

+2
source

All Articles