validation

Where to place xs:unique constraint in XSD?

≯℡__Kan透↙ 提交于 2021-02-05 07:56:46
问题 I am using XSD for XML validation. I want to add unique values constraint for the input elements. I have XML format like this: <?xml version="1.0" encoding="UTF-8"?> <test> <definitions> <input>Page</input> </definitions> <definitions> <input>Page</input> </definitions> </test> My XSD: <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="test"> <xs:complexType> <xs:sequence> <xs:element name="definitions"

Regular Expression for field must contain at least 2 non-space alphanumeric characters

一个人想着一个人 提交于 2021-02-05 07:56:06
问题 Rule: field must contain at least 2 non-space alphanumeric characters. please any one can guide us how to write the regular expression thanks in advance.... 回答1: Match one alphanumeric character followed by zero or more characters followed by another alphanumeric character: \w.*\w If the validation automatically adds ^ and $, you have to match the characters before and after also: .*\w.*\w.* The \w code matches A-Z, a-z, 0-9 and _. If you have a different definition for aplhanumeric

How to access the failed xsd 1.1 assert rule during validation?

核能气质少年 提交于 2021-02-05 07:25:27
问题 I hope I am not asking a stupid question but I was unable to find an answer myself yet. Situation: I have a xml file which has to be validated against an XSD 1.1 (with a lot of asserts). For the validation I use this xerces version: org.opengis.cite.xerces:xercesImpl-xsd11:2.12-beta-r1667115 . As it has been stated quite a few times on Stackoverflow, this seems to be the only working version for XSD 1.1. And yes, it works perfectly. After the validation, I need to know every single violation

How to keep macro running when there are protected sheets?

烈酒焚心 提交于 2021-02-05 07:16:56
问题 I have protected sheets 4 with a password because there are some cells that users aren't allowed to input in those cells in sheet 4. The password is 1234. But, I want to run my macro, and if there is an error, the cell will be highlight automatically. My macro doesn't run and error, because the cell that I want to highlight is in protected sheet. How to make the sheet 4 stay protected and make my macro keep running when I click the validation button? Private Sub commandbutton1_click()

Qt QLineEdit Input Validation

*爱你&永不变心* 提交于 2021-02-05 06:52:30
问题 How would one set an input validator on a QLineEdit such that it restricts it to a valid IP address? i.e. x.x.x.x where x must be between 0 and 255.and x can not be empty 回答1: You are looking for QRegExp and QValidator, to validate an IPv4 use this expresion: \b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-‌​9]|[01]?[0-9][0-9]?)‌​\.(25[0-5]|2[0-4][0-‌​9]|[01]?[0-9][0-9]?)‌​\.(25[0-5]|2[0-4][0-‌​9]|[01]?[0-9][0-9]?)‌​\b Example: QRegExp ipREX("\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]

Is there a way to apply regex modifiers for HTML5 input's pattern-attribute?

喜夏-厌秋 提交于 2021-02-05 05:56:12
问题 There is this snippet from the HTML specification, but either I do not understand the specification or it does not exactly say anything too informative regarding the regex-modifiers. 回答1: You should check this HTML5 pattern attribute documentation: If an input element has a pattern attribute specified, and the attribute's value, when compiled as a JavaScript regular expression with the global , ignoreCase , and multiline flags disabled (see ECMA262 Edition 5, sections 15.10.7.2 through 15.10

Phone number validation with plus sign optional

别说谁变了你拦得住时间么 提交于 2021-02-04 21:56:13
问题 How can i validate a phone number with plus sign optional only at the beginning and after that any number of digits with number only. I tried this:- /^\+(?:[\d]*)$/ How will be the modification 回答1: /^\+?(?:[\d]*)$/ The questionmark tells that the plus sign can be there or not. However, your expression can be optimized quite a bit: /^\+?\d+$/ I changed the * to a + as the expression would match just a plus sign. \d* suggests that it should match 0 or more digits. Here's a demo on Regexr. 来源:

Checking existence of email address

北慕城南 提交于 2021-02-04 21:18:05
问题 I'm developing a web application with Chat Support, and so far, I've been using JQuery validation to check whether the input text is a well formatted email address. But that doesn't seem to fulfill its purpose. For example: Entering a working and legitimate email address such as myname@gmail.com Entering a fake/random email address such as abcd@something.com Both are accepted into the field as valid. So is there any way to detect whether the specified email address exists or not in real-life,

VueJS Using Prop Type Validation With NULL and 'undefined' Values?

佐手、 提交于 2021-02-04 15:48:46
问题 Even though VueJS 2 official documentation about prop validation is stating (as a code example's comment line): // Basic type check ( null and undefined values will pass any type validation) I'm getting the following error with this code reproduction — why is that? [Vue warn]: Invalid prop: type check failed for prop "value". Expected String, Number, Boolean, got Null <template> <div> <h1>{{ title }}:</h1> <MyInput :value="null" /> </div> </template> <script> Vue.component('MyInput', Vue

How can I include an ampersand (&) character in an XML document?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-04 12:51:10
问题 How can I put an & symbol in an attribute of an XML tag while keeping the XML valid? <?xml version="1.0" ?> <a text="b&c"/> When I use W3School's validator, I get the error: EntityRef: expecting ' ; ' 回答1: Use a character reference to represent it: & See the specification: The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed