Document.HeaderText throws error

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by NorthGates - NorthGates Systems
Version: 12.1.0311
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

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\">";
  1.  I load the file
  2. I strip the root tag to put in header
  3. 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: 

Comments (4)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I tried to repro this in our sample but nothing was happening.  Are you sure it's happening in the latest version?  If you check that and it still is, please make a new simple sample project showing the issue and email that to our support address, referencing this post.  Rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 11 years ago by NorthGates - NorthGates Systems
Avatar

I have version 4.0.289.0... It is because I load 3 xsd into a schemaset and add to XmlSchemaResolver.

All is well when I don't add those xsd.

[Modified 11 years ago]

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I would suggest first trying it in the latest version to see if it is a bug that has been fixed.  If you still see it in the latest version then please make a new simple sample project that shows it, and email it to our support address, referencing this post, and we'll have a look.  Be sure to rename any .zip file extension you send so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 11 years ago by NorthGates - NorthGates Systems
Avatar

Thanks but I cannot upgrade at this time. I will try to resolve my xsd issues or use a different approach.

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.