I have a component which was created with schema A, and contained an element in the <Content> block. Later, this component got updated, through the API, to the Image schema.

Upon publication, anything using this component fails with an error related to an unexpected namespace. After investigation, it turns out that although everything in the components looks right in the GUI, the XML of the component still contains what was in the <Content> block before the update.

Basically, it seems that Tridion merged the XML of the 2 versions instead of replacing it with the new (empty) content.

I tried to correct it using the Business connector API , and the C# TOM API, but although no error is reported while "updating" the component, the problem still persists. When opening the component through the GUI, changing the name (for instance) and saving, I got an error message saying Error: unexpected DTD:.

Any idea how to solve this? Manually deleting this components and creating copy and changing the references, is not really a solution here, for various practical reasons.

Edit: As for the C# code, I unfortunately don't have the code anymore, but we tried many different possibilities, with a lot of console output to be sure that we were sending the right XML. It involved various combinations of update(), setting the content to the XML as it should be, setting the content to null, and a save() in the end. I'll try to get the source back.

As for the SOAP API call to the business connector, here it is:

<?xml version='1.0' encoding='utf-8'?>
<tcmapi:Message xmlns:tcmapi = "http://www.tridion.com/ContentManager/5.0/TCMAPI" version = "5.0" from = "robot" failOnError = "false">
    <tcmapi:Request ID = "REQ1" preserve = "false">
        <tcmapi:SaveItem itemURI = "tcm:12-1057420" contextURI = "tcm:0-0-0" doneEditing = "true" itemType = "Component">
            <tcm:Component ID = "tcm:12-1057420" IsEditable = "false" xmlns:tcm = "http://www.tridion.com/ContentManager/5.0" xmlns:xlink = "http://www.w3.org/1999/xlink">
                    <tcm:Publication xlink:type = "simple" xlink:title = "Internet Content Parent" xlink:href = "tcm:0-12-1"/>
                    <tcm:OrganizationalItem xlink:type = "simple" xlink:title = "Main Images [530,200,100]" xlink:href = "tcm:12-108162-2"/>
                        <tcm:Path>\Internet Content Parent\Building Blocks Management\General Content\[redacted]\Main Images [530,200,100]</tcm:Path>
                        <tcm:OwningPublication xlink:type = "simple" xlink:title = "Internet Content Parent" xlink:href = "tcm:0-12-1"/>
                        <tcm:Creator xlink:type = "simple" xlink:title = "[redacted]" xlink:href = "tcm:0-3751-65552"/>
                        <tcm:Revisor xlink:type = "simple" xlink:title = "[redacted]" xlink:href = "tcm:0-3751-65552"/>
                        <tcm:ItemLock Title = "No lock" Type = "0"></tcm:ItemLock>
                    <tcm:PublishInfo xmlns:tcm = "http://www.tridion.com/ContentManager/5.0" xmlns:xlink = "http://www.w3.org/1999/xlink">
                        <tcm:ProcessInstance xlink:type = "simple" xlink:title = "" xlink:href = "tcm:0-0-0"/>
                        <tcm:ActivityInstance xlink:type = "simple" xlink:title = "" xlink:href = "tcm:0-0-0" Description = ""/>
                        <tcm:Assignee xlink:type = "simple" xlink:title = "" xlink:href = "tcm:0-0-0"/>
                        <tcm:Performer xlink:type = "simple" xlink:title = "" xlink:href = "tcm:0-0-0"/>
                    <tcm:AllowedActions xmlns:tcm = "http://www.tridion.com/ContentManager/5.0">
                        <tcm:Actions Allow = "125321" Deny = "614" Managed = "0"/>
                    <tcm:Schema xlink:type = "simple" xlink:title = "dtd_picture" xlink:href = "tcm:12-49-8"/>
                        <Metadata xmlns = "urn:DTD49">
                    <tcm:ApprovalStatus xlink:type = "simple" xlink:title = "Undefined" xlink:href = "tcm:0-0-0"/>
                    <tcm:MultimediaType xlink:href = "tcm:0-2-65544" xlink:title = "Jpeg image"/>

The XML of the "updated" component is:

  <tcm:Schema xlink:type="simple "xlink:title="dtd_picture "xlink:href="tcm:12-49-8"IsMandatory="false" />
        <operatingSystem>Not Applicable</operatingSystem>
        <descriptionShort> Description. </descriptionShort>
        <descriptionLong />
        <precaution />
        <softwareLicenseAgreement />
        <history />
        <environment />
        <setup />
  <tcm:ApprovalStatus xlink:type="simple" xlink:title="Undefined" xlink:href="tcm:0-0-0" />
  <tcm:MultimediaType xlink:type="simple" xlink:title="Jpeg image" xlink:href="tcm:0-2-65544" />

The whole <Download> block has nothing to do here.

  • Can you post the code you're using to update the component(s) through the API? Commented Feb 24, 2014 at 11:39
  • @NVanderEnde: I updated the question.
    – m4573r
    Commented Feb 24, 2014 at 12:16
  • If you want to remove the entire "Download" section, and we're only talking about this one Component, you should be able to just edit the Source tab in the GUI and delete the whole section. Make sure you leave the <tcm:Content/> element in there, though. Commented Feb 24, 2014 at 13:12
  • @PeterKjaer: since it's just an image component, there is no "source" tab in the gui :/
    – m4573r
    Commented Feb 24, 2014 at 13:46

2 Answers 2


Take a look at the code in Dom's Component Synchronizer here for some ideas on how to fix the XML: https://code.google.com/p/tridion-2011-power-tools/wiki/ComponentSynchronizer

You can also try installing the legacy Component Synchronizer Powertool and see if that fixes the XML. You can find it here: http://sdltridionworld.com/community/extension_overview/powertools.aspx

If those tools can't tackle it, then your XML is FUBAR, or it's some silly small thing that the machine can't figure out. Try this to find the culprit: in your new schema temporarily make all fields unmandatory. Try to save your messed component. Then start taking content items out one by one and try to save until you find the field that's troublesome.

If writing Core Service code to manipulate the XML, make sure you enable all the ReadOptions via LoadFlags so you can see the entire XML. More info here and then the Tridion CS API: How to Get Keyword from Metadata or Item XML Using Core Service

  • The component synchronizer didn't work, and no luck with the rest either :/
    – m4573r
    Commented Feb 25, 2014 at 14:57
  • What do you mean "no luck with the rest"? Can you create a component using the Tridion GUI against the same schema with the exactly the same data as the erroneous compoonent? If so, did you try doing a diff of the XMLs? And if you did that, please point out to us what that diff was. Commented Feb 25, 2014 at 15:22
  • I can create a component with the same schema (which is just the classical image one, with no mandatory field but the title), but not with the same data than the problematic component, since well, this data is part of another schema. The culprit here is the whole "update the schema of the component" through the api, which is apparently not properly supported entirely.
    – m4573r
    Commented Feb 26, 2014 at 1:12

In the "old" days when I used to update components using the TOM API I would use the UpdateXML() call to update the entire Tridion XML of the item in question. My guess is you got into this mess by switching only the schema (thus leaving the content intact) and ended up with an invalid combination of both (this is most likely the reason why the WebGUI doesn't allow you to change the schema of an existing component!).

Perhaps you can give this a try?

Dim comp : Set comp = TDSE.GetObject("tcmuri-of-component", 2)
comp.UpdateXML("intended target xml for component")

Note that the language is VBScript (you'll need slightly different syntax for JScript). The XML to put in would be as you posted but with an empty or absent <tcm:Content> node...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.