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

"/" inside the pattern disables the "Submit" button #20

Open
antonielly opened this issue Oct 29, 2015 · 2 comments
Open

"/" inside the pattern disables the "Submit" button #20

antonielly opened this issue Oct 29, 2015 · 2 comments

Comments

@antonielly
Copy link

The generator available at
https://xsd-forms.herokuapp.com/
creates a form whose "Submit" button does not work when the "pattern" of a string-derived element contains "/".

Minimal working examples:

a) The defect appears:

<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns:this="http://example.com/"
    targetNamespace="http://example.com/"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <simpleType name="NonNegativeFraction">
        <restriction base="string">
            <pattern value="[0-9]+/[0-9]+"/>
        </restriction>
    </simpleType>

    <element name="nonNegativeFraction" type="this:NonNegativeFraction"/>
</schema>

b) The defect does not appear (i.e. it works correctly, as it should):

<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns:this="http://example.com/"
    targetNamespace="http://example.com/"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <simpleType name="NonNegativeFraction">
        <restriction base="string">
            <pattern value="[0-9]+[/][0-9]+"/>
        </restriction>
    </simpleType>

    <element name="nonNegativeFraction" type="this:NonNegativeFraction"/>
</schema>

Both examples comply with the XSD structural rules according to tools such as Oxygen XML Editor.

Tested with Mozilla Firefox 41.0.2 on Microsoft Windows 7.

@davidmoten
Copy link
Owner

Thanks for the report. I'll have a look.

@davidmoten
Copy link
Owner

shouldn't be too hard to fix. I'll just have to escape certain characters in the generated javascript.

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