maxLength not permitted in string [message #46932] |
Thu, 03 June 2004 13:37 |
Eclipse User |
|
|
|
Originally posted by: jerome.negre+news.fr.adp.com
Hi,
I've got a strange behavior when I have a group containing an element
whose type is a restricition of a simpleType defined in an included
schema. If the simpleType is defined in the same schema, or if I replace
the group by a complexType, everything's ok.
The error message I got is: The maxLength facet is not permitted in a type
based on 'http://www.w3.org/2001/XMLSchema#string'.
Here's a simple test case:
--8<--- Main schema: myschema.xsd --------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
targetNamespace="http://eu.adp.com"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:this="http://eu.adp.com">
<include schemaLocation="util.xsd"/>
<simpleType name="internalType">
<restriction base="string">
<pattern value="[A-Z]*"/>
</restriction>
</simpleType>
<group name="MyGroup">
<sequence>
<!-- OK -->
<element name="myInternalElement" nillable="true">
<simpleType>
<restriction base="this:internalType">
<maxLength value="5"/>
</restriction>
</simpleType>
</element>
<!-- DOES NOT WORK -->
<element name="myExternalElement" nillable="true">
<simpleType>
<restriction base="this:externalType">
<maxLength value="5"/>
</restriction>
</simpleType>
</element>
</sequence>
</group>
<complexType name="MyComplexType">
<sequence>
<!-- OK -->
<element name="myInternalElement" nillable="true">
<simpleType>
<restriction base="this:internalType">
<maxLength value="5"/>
</restriction>
</simpleType>
</element>
<!-- OK -->
<element name="myExternalElement" nillable="true">
<simpleType>
<restriction base="this:externalType">
<maxLength value="5"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
</schema>
--8<--- End of myschema.xsd --------------------------------------
--8<--- Included schema: util.xsd --------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
targetNamespace="http://eu.adp.com"
xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType name="externalType">
<restriction base="string">
<pattern value="[A-Z]*"/>
</restriction>
</simpleType>
</schema>
--8<--- End of util.xsd ------------------------------------------
I have this result both with XSD 1.1.1.1 and I20040308.
Does anyone have a clue on what I might be doing wrong, or should I open a
bug in Bugzilla?
Thanks in advance,
Jérôme
|
|
|
Re: maxLength not permitted in string [message #46966 is a reply to message #46932] |
Thu, 03 June 2004 15:53 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Jérôme,
Yes, there is a bug here (because for the "nested in a model group definition"
case the nested contents aren't being re-analyzed after the include is resolved).
Please open a bugzilla and I'll commit the fix. Thanks for the simple test case!
Jérôme Nègre wrote:
> Hi,
>
> I've got a strange behavior when I have a group containing an element
> whose type is a restricition of a simpleType defined in an included
> schema. If the simpleType is defined in the same schema, or if I replace
> the group by a complexType, everything's ok.
>
> The error message I got is: The maxLength facet is not permitted in a type
> based on 'http://www.w3.org/2001/XMLSchema#string'.
>
> Here's a simple test case:
>
> --8<--- Main schema: myschema.xsd --------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <schema
> targetNamespace="http://eu.adp.com"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:this="http://eu.adp.com">
>
> <include schemaLocation="util.xsd"/>
>
> <simpleType name="internalType">
> <restriction base="string">
> <pattern value="[A-Z]*"/>
> </restriction>
> </simpleType>
>
> <group name="MyGroup">
> <sequence>
> <!-- OK -->
> <element name="myInternalElement" nillable="true">
> <simpleType>
> <restriction base="this:internalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> <!-- DOES NOT WORK -->
> <element name="myExternalElement" nillable="true">
> <simpleType>
> <restriction base="this:externalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> </sequence>
> </group>
>
> <complexType name="MyComplexType">
> <sequence>
> <!-- OK -->
> <element name="myInternalElement" nillable="true">
> <simpleType>
> <restriction base="this:internalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> <!-- OK -->
> <element name="myExternalElement" nillable="true">
> <simpleType>
> <restriction base="this:externalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> </sequence>
> </complexType>
>
> </schema>
> --8<--- End of myschema.xsd --------------------------------------
>
> --8<--- Included schema: util.xsd --------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <schema
> targetNamespace="http://eu.adp.com"
> xmlns="http://www.w3.org/2001/XMLSchema">
>
> <simpleType name="externalType">
> <restriction base="string">
> <pattern value="[A-Z]*"/>
> </restriction>
> </simpleType>
>
> </schema>
> --8<--- End of util.xsd ------------------------------------------
>
> I have this result both with XSD 1.1.1.1 and I20040308.
>
> Does anyone have a clue on what I might be doing wrong, or should I open a
> bug in Bugzilla?
>
> Thanks in advance,
> Jérôme
|
|
|
|
Re: maxLength not permitted in string [message #588058 is a reply to message #46932] |
Thu, 03 June 2004 15:53 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Jérôme,
Yes, there is a bug here (because for the "nested in a model group definition"
case the nested contents aren't being re-analyzed after the include is resolved).
Please open a bugzilla and I'll commit the fix. Thanks for the simple test case!
Jérôme Nègre wrote:
> Hi,
>
> I've got a strange behavior when I have a group containing an element
> whose type is a restricition of a simpleType defined in an included
> schema. If the simpleType is defined in the same schema, or if I replace
> the group by a complexType, everything's ok.
>
> The error message I got is: The maxLength facet is not permitted in a type
> based on 'http://www.w3.org/2001/XMLSchema#string'.
>
> Here's a simple test case:
>
> --8<--- Main schema: myschema.xsd --------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <schema
> targetNamespace="http://eu.adp.com"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:this="http://eu.adp.com">
>
> <include schemaLocation="util.xsd"/>
>
> <simpleType name="internalType">
> <restriction base="string">
> <pattern value="[A-Z]*"/>
> </restriction>
> </simpleType>
>
> <group name="MyGroup">
> <sequence>
> <!-- OK -->
> <element name="myInternalElement" nillable="true">
> <simpleType>
> <restriction base="this:internalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> <!-- DOES NOT WORK -->
> <element name="myExternalElement" nillable="true">
> <simpleType>
> <restriction base="this:externalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> </sequence>
> </group>
>
> <complexType name="MyComplexType">
> <sequence>
> <!-- OK -->
> <element name="myInternalElement" nillable="true">
> <simpleType>
> <restriction base="this:internalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> <!-- OK -->
> <element name="myExternalElement" nillable="true">
> <simpleType>
> <restriction base="this:externalType">
> <maxLength value="5"/>
> </restriction>
> </simpleType>
> </element>
> </sequence>
> </complexType>
>
> </schema>
> --8<--- End of myschema.xsd --------------------------------------
>
> --8<--- Included schema: util.xsd --------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <schema
> targetNamespace="http://eu.adp.com"
> xmlns="http://www.w3.org/2001/XMLSchema">
>
> <simpleType name="externalType">
> <restriction base="string">
> <pattern value="[A-Z]*"/>
> </restriction>
> </simpleType>
>
> </schema>
> --8<--- End of util.xsd ------------------------------------------
>
> I have this result both with XSD 1.1.1.1 and I20040308.
>
> Does anyone have a clue on what I might be doing wrong, or should I open a
> bug in Bugzilla?
>
> Thanks in advance,
> Jérôme
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04375 seconds