I am using Addon.Web and trying to implement HeaderText and FooterText to prevent users from modifying the namespaces in the root tag.
When I place the below in HeaderText, i get an error but no problem with the footer..myDoc.FooterText="</myTag>";
myDoc.HeaderText="<myTag xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns=\"http://www.mysite.ca/schemas/xsd/2.0\" xmlns:gp=\"http://www.mysite.ca/schemas/xsd/2.0/gp\">";
- I load the file
- I strip the root tag to put in header
- I strip end root tag for footer
Here is the error:
System.ArgumentOutOfRangeException was unhandled
HResult=-2146233086
Message=StartIndex cannot be less than zero.
Parameter name: startIndex
Source=mscorlib
ParamName=startIndex
StackTrace:
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at ActiproSoftware.SyntaxEditor.Addons.Xml.XmlSyntaxLanguage.ActiproSoftware.SyntaxEditor.ISemanticParserServiceProcessor.Process(SemanticParserServiceRequest request)
at ActiproSoftware.SyntaxEditor.SemanticParserService.a(SemanticParserServiceRequest A_0)
at ActiproSoftware.SyntaxEditor.SemanticParserService.c()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: