Xml validation with schema.xsd file

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Jean Versailles
Avatar
Hi,

Is there a way i can validate a xml document in SyntaxEditor with a xml shema file to produce a wavy line indicators to the xml tokens that are not support or mark the errors with a wavy line.

Wavy Line.

Thank You,
jen0s.

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jen,

Actually our Language Designer sample does this sort of thing. It's not built directly into SyntaxEditor yet (maybe for 4.0) but you essentially create an XmlValidatingReader and then when errors show up, you interpret the message and can assign wavy line span indicators to show the error.


Actipro Software Support

Posted 13 years ago by Jean Versailles
Avatar
do you have any examples on the this subject that might help me out.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes in our sample project, look at LanguageDesignerForm. It does this and creates span indicators after validating against our XSD.

To test it, open the Language Designer from the launcher window. The open any sample language definition in the top box. Then add a valid random XML tag at the top but not a tag that is valid per the XSD.

Here's a sample where I add a Test tag:

<SyntaxLanguage Key="C#" LanguageDefinitionVersion="3.0" Secure="True" WordContainsAdditionalCharacters="@_" xmlns="http://ActiproSoftware/SyntaxEditor/3.0/LanguageDefinition">
    <Test />
    <!-- String Properties -->
When you hit the validate button, you'll see a span indicator wavy-underline the error.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.