2

Publish Settings - Publishing Failed

publishing error: An error occurred while generating the semantic schema for Schema 'xxx' (tcm:xx-xxx-8).

Root element is missing.

TemplateBuilder error:

Debugging was started in process 'TcmTemplateDebugHost' with id 2908
PublishMappings: Added JSON Binary '/Preview/us/system/mappings/vocabularies.json' related to Component 'Core' (tcm:xx-xxxz) with variant ID 'vocabularies'
An error occurred while generating the semantic schema for Schema 'xxx' (tcm:xx-xxxx-8-v0).
   at Sdl.Web.Tridion.Templates.PublishMappings.GetSemanticSchema(Schema schema)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Sdl.Web.Tridion.Templates.PublishMappings.PublishSemanticSchemas(StructureGroup structureGroup, Component relatedComponent)
   at Sdl.Web.Tridion.Templates.PublishMappings.Transform(Engine engine, Package package)
   at Tridion.ContentManager.Templating.Assembly.AssemblyMediator.Transform(Engine engine, Template template, Package package)
   at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.RunTemplate(Engine engine, Package package, String templateUri, String className)
   at Tridion.Templating.CSharpTemplate.CSharpSourceTemplate.Transform(Engine __engine, Package __package)
   at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.Transform(Engine engine, Template template, Package package)
   at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
   at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
   at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package)
   at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
   at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
   at Tridion.ContentManager.Templating.Engine.TransformPackage(Template template, Package package)
   at Tridion.ContentManager.Templating.Engine.TransformItem(Template template, IdentifiableObject itemToRender)
   at Tridion.ContentManager.Templating.Debugging.DebuggingEngine.Run()
   at Tridion.ContentManager.Templating.Debugging.DebugSession.Run()
---Caused by:
Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlReader.MoveToContent()
   at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
   at Sdl.Web.Tridion.Templates.PublishMappings.GetSemanticTypes(Schema schema)
   at Sdl.Web.Tridion.Templates.PublishMappings.GetSemanticSchema(Schema schema)

why root element is missing from this XML?

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="uuid:a1553e13-3f82-4e62-ae15-99986b90fcc6" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance" elementFormDefault="qualified" targetNamespace="uuid:a1553e13-3f82-4e62-ae15-99986b90fcc6">
      <xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance"></xsd:import>
      <xsd:annotation>
        <xsd:appinfo>
          <tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
            <tcm:Label ElementName="aToZListingType" Metadata="false">Listing Type for the A-Z component (Products/Solutions/InfoCenter) </tcm:Label>
          </tcm:Labels>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:element name="atozListing">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="aToZListingType" minOccurs="1" maxOccurs="1">
              <xsd:annotation>
                <xsd:appinfo>
                  <tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
                    <configuration xmlns="http://www.sdltridion.com/2011/SiteEdit">
                      <field>
                        <editable>false</editable>
                      </field>
                    </configuration>
                  </tcm:ExtensionXml>
                  <tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">1</tcm:Size>
                  <tcm:listtype xmlns:tcm="http://www.tridion.com/ContentManager/5.0">select</tcm:listtype>
                </xsd:appinfo>
              </xsd:annotation>
              <xsd:simpleType>
                <xsd:restriction base="xsd:normalizedString">
                  <xsd:enumeration value="viewAllProducts"></xsd:enumeration>
                  <xsd:enumeration value="viewAllSolutions"></xsd:enumeration>
                  <xsd:enumeration value="viewAllInfo"></xsd:enumeration>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  • hi Nick, XML is copied above, root element is missing? – Lucas Liu Mar 27 at 23:39
3

Issue is resolved after removing the app_id "http://www.sdl.com/tridion/SemanticMapping/typeof"

Use provided Powershell commandlet to remove the app_id, for example: remove-tcmapplicationData -TcmApplicationIds http://www.sdl.com/tridion/SemanticMapping/typeof

| improve this answer | |
2

I’ve had a problem in the past with Tridion putting ‘-v0’ on the end of tcmIds when the item it checked-out (even if it’s an old schema with a long version history). I suspect that this is a bug in the product.

Can you make sure that the schema is checked in and try again?

This may be a red herring, but I lost hours to it, so thought it was worth mentioning.

| improve this answer | |
  • thanks Jonathan, the schema is checked in. and i also deleted -v0 version. issue not solved. – Lucas Liu Mar 28 at 13:55
2

Note that those Stack Traces provide a lot of valuable information to analyze where the problem lies. See also https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/b/blog-posts/posts/digital-forensics-based-on-a-stack-trace

In this particular case, the exception occurs when parsing XML in Sdl.Web.Tridion.Templates.PublishMappings.GetSemanticTypes(Schema schema)

The implementation of that method can be found here: https://github.com/sdl/dxa-content-management/blob/release/1.7/Sdl.Web.Tridion.Templates/Templates/PublishMappings.cs

Note that the XML being parsed in that method is not the Schema XSD, but the content of DXA Application Data used to specify the Semantic Type(s) of a Schema (Application ID: http://www.sdl.com/tridion/SemanticMapping/typeof)

This (optional) App Data is expected to be XML, but looking at the exception message, it seems to be an empty string or plain text.

Not sure how you got to such malformed DXA App Data and whether you expect it to be present in the first place. If not, you could purge the App Data using Remove-TcmApplicationData. See https://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-FBFAD6E3-19D4-4A86-AC6C-A21006C94084

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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