Reputation: 2247
I created a task with questions defined in our QBO3 DEV environment. After exporting from DEV to UAT, the same task throws an error when rendering:
Message : The '' character, hexadecimal value 0x0A, cannot be included in a name.
This is unclear; I don't know how to proceed.
The full stack trace is:
Type : System.Xml.XmlException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The '' character, hexadecimal value 0x0A, cannot be included in a name.
Source : System.Xml
Help link :
LineNumber : 0
LinePosition : 0
SourceUri :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void ThrowInvalidName(System.String, Int32, Int32)
HResult : -2146232000
Stack Trace : at System.Xml.ValidateNames.ThrowInvalidName(String s, Int32 offsetStartChar, Int32 offsetBadChar)
at System.Xml.ValidateNames.ParseQNameThrow(String s, String& prefix, String& localName)
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ParseTagName(String tagName, Int32 idxPrefixMappings, String& prefix, String& localName, String& ns)
at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttributeComputed(String tagName, Int32 prefixMappingsIndex)
at <xsl:template name="Behaviors">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 Behaviors, String Value)
at <xsl:template name="ControlGroup">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 FormElement, IList`1 Root, IList`1 IFQ, IList`1 XmlData)
at <xsl:template name="compiler:generated"> (19)(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator FormValidator, String ReadOnly, IList`1 ParentID, IList`1 Title, IList`1 CurrentXML, IList`1 FormElement, IList`1 ImportFormQuestions)
at <xsl:template name="RenderPanel">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 ImportFormQuestions, IList`1 FormElement, IList`1 CurrentXML, IList`1 Title, IList`1 ParentID, String ReadOnly)
at <xsl:template name="RenderPanels">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 ImportFormQuestions, String ParentID, String ReadOnly)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results)
at qbo.DecisionWeb.ImportForm.RenderEdit(HttpContext context) in C:\trunk\qbo.3\qbo.Core\Web Tier\qbo.DecisionWeb\Decision\ImportForm.ashx.cs:line 219
at qbo.DecisionWeb.ImportForm.ProcessRequest(HttpContext context) in C:\trunk\qbo.3\qbo.Core\Web Tier\qbo.DecisionWeb\Decision\ImportForm.ashx.cs:line 63
Upvotes: 0
Views: 32
Reputation: 2247
The root cause was leading line feeds (ASCII character 10) in the Behaviors column of custom defined questions.
This occurs when QBO3 exported XML is copy and pasted from a browser's formatted XML, rather than the raw XML.
Note in the image above, the browser formats the node for easy reading, by rendering the text on the following line. Copying the data from this view copies the "extra" line feed.
Instead of copying data from this view, right-click and choose the browser's Save As option.
Such issues can be fixed in bulk with the following query:
UPDATE ImportFormQuestion
SET Behaviors = SUBSTRING(Behaviors, 2, 1000)
FROM ImportFormQuestion
WHERE ASCII(SUBSTRING(Behaviors, 1,1)) = 10
Upvotes: 0