Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xs:maxLength and xs:minLength are not working when using xs:restrictions #19

Open
sukhpalsingh opened this issue Jun 7, 2014 · 1 comment

Comments

@sukhpalsingh
Copy link

I was using this library and it looks like xs:maxLength and xs:minLength restrictions are not yet implemented. I would like to contribute to this project to add these restrictions and some other common restrictions too.

Can you please tell me where will be best place to add such restrictions validation in the library so that text editor will have maximum length restriction and other common restrictions that are used in xml schema.

@bbpennel
Copy link
Member

bbpennel commented Jun 7, 2014

Another person was looking at implementing some restrictions, including maxLength, but I'm not sure how far superinconnu got with it. You can see the issue here and my thoughts about how I would implement it:

#14

The second part of my answer in that post only really applies to the graphical editor. Implementing the restrictions in the text editor (preferably as highlighted or marked errors rather than interfering with user input) would require some investigation into the ajax ace editor. I haven't looked into this before, but my guess is it would involve either extending the XML highlighter or using the syntax validation mechanisms mentioned here:

https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode
https://github.com/ajaxorg/ace/wiki/Syntax-validation

Although there may be simpler ways to do what you need. Most of the direct interactions with the ace editor happen in this file currently:

https://github.com/UNC-Libraries/jquery.xmleditor/blob/master/src/text_editor.js

Thanks for your interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants