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:Context>
<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:Context>
<tcm:Info>
<tcm:LocationInfo>
<tcm:WebDAVURL>/webdav/Internet%20Content%20Parent/Building%20Blocks%20Management/General%20Content/[redacted]/Main%20Images%20%5B530%2C200%2C100%5D/Imagejpg</tcm:WebDAVURL>
<tcm:Path>\Internet Content Parent\Building Blocks Management\General Content\[redacted]\Main Images [530,200,100]</tcm:Path>
</tcm:LocationInfo>
<tcm:BluePrintInfo>
<tcm:OwningPublication xlink:type = "simple" xlink:title = "Internet Content Parent" xlink:href = "tcm:0-12-1"/>
<tcm:IsShared>false</tcm:IsShared>
<tcm:IsLocalized>false</tcm:IsLocalized>
</tcm:BluePrintInfo>
<tcm:VersionInfo>
<tcm:Version>5</tcm:Version>
<tcm:Revision>0</tcm:Revision>
<tcm:CreationDate>2013-05-16T13:54:20</tcm:CreationDate>
<tcm:RevisionDate>2013-07-03T10:22:51</tcm:RevisionDate>
<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:VersionInfo>
<tcm:PublishInfo xmlns:tcm = "http://www.tridion.com/ContentManager/5.0" xmlns:xlink = "http://www.w3.org/1999/xlink">
<tcm:IsPublished>false</tcm:IsPublished>
</tcm:PublishInfo>
<tcm:WorkflowInfo>
<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:CreationDate></tcm:CreationDate>
<tcm:StartDate></tcm:StartDate>
<tcm:FinishDate></tcm:FinishDate>
<tcm:PreviousMessage></tcm:PreviousMessage>
</tcm:WorkflowInfo>
<tcm:AllowedActions xmlns:tcm = "http://www.tridion.com/ContentManager/5.0">
<tcm:Actions Allow = "125321" Deny = "614" Managed = "0"/>
</tcm:AllowedActions>
</tcm:Info>
<tcm:Data>
<tcm:Title>Image</tcm:Title>
<tcm:Type>Multimedia</tcm:Type>
<tcm:Schema xlink:type = "simple" xlink:title = "dtd_picture" xlink:href = "tcm:12-49-8"/>
<tcm:Content></tcm:Content>
<tcm:Metadata>
<Metadata xmlns = "urn:DTD49">
<date_publish>2013-05-28T10:00:00</date_publish>
<MM_Height>265</MM_Height>
<MM_Width>530</MM_Width>
<MM_Alt>WX520</MM_Alt>
<popupScreen>800x600px</popupScreen>
<popupScrollbars>No</popupScrollbars>
<popupToolbars>No</popupToolbars>
</Metadata>
</tcm:Metadata>
<tcm:ApprovalStatus xlink:type = "simple" xlink:title = "Undefined" xlink:href = "tcm:0-0-0"/>
<tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema>
<tcm:UploadedMultimediaFilename>D:\[redacted]\binaries\12-1057420</tcm:UploadedMultimediaFilename>
<tcm:MultimediaFilename>C:\[redacted]\Image.jpg</tcm:MultimediaFilename>
<tcm:MultimediaFileSize>49870</tcm:MultimediaFileSize>
<tcm:IsExternalMultimediaFile>false</tcm:IsExternalMultimediaFile>
<tcm:MultimediaType xlink:href = "tcm:0-2-65544" xlink:title = "Jpeg image"/>
</tcm:Data>
</tcm:Component>
</tcmapi:SaveItem>
</tcmapi:Request>
</tcmapi:Message>
The XML of the "updated" component is:
<tcm:Data>
<tcm:Title>Image</tcm:Title>
<tcm:Type>Multimedia</tcm:Type>
<tcm:Schema xlink:type="simple "xlink:title="dtd_picture "xlink:href="tcm:12-49-8"IsMandatory="false" />
<tcm:Content>
<Download>
<title>Title</title>
<operatingSystem>Not Applicable</operatingSystem>
<language>EN</language>
<language>FR</language>
<language>ES</language>
<language>IT</language>
<language>DE</language>
<language>RU</language>
<language>JA</language>
<language>ZH</language>
<descriptionShort> Description. </descriptionShort>
<descriptionLong />
<precaution />
<softwareLicenseAgreement />
<history />
<environment />
<setup />
</Download>
</tcm:Content>
<tcm:Metadata>
<Metadata>
<date_publish>2013-05-28T10:00:00</date_publish>
<MM_Height>265</MM_Height>
<MM_Width>530</MM_Width>
<MM_Alt>WX520</MM_Alt>
<popupScreen>800x600px</popupScreen>
<popupScrollbars>No</popupScrollbars>
<popupToolbars>No</popupToolbars>
</Metadata>
</tcm:Metadata>
<tcm:ApprovalStatus xlink:type="simple" xlink:title="Undefined" xlink:href="tcm:0-0-0" />
<tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema>
<tcm:MultimediaType xlink:type="simple" xlink:title="Jpeg image" xlink:href="tcm:0-2-65544" />
<tcm:MultimediaFilename>C:\[redacted]\Image.jpg</tcm:MultimediaFilename>
<tcm:MultimediaFileSize>49870</tcm:MultimediaFileSize>
<tcm:IsExternalMultimediaFile>false</tcm:IsExternalMultimediaFile>
The whole <Download>
block has nothing to do here.