Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » maxLength not permitted in string
maxLength not permitted in string [message #46932] Thu, 03 June 2004 13:37 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #47192 is a reply to message #46966] Fri, 04 June 2004 07:59 Go to previous message
Eclipse UserFriend
Originally posted by: jerome.negre+news.fr.adp.com

Ed,

Thanks for your quick reply.

> Please open a bugzilla and I'll commit the fix.

Bug 65672 is yours.

Regards,
Jérôme
Re: maxLength not permitted in string [message #588058 is a reply to message #46932] Thu, 03 June 2004 15:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Re: maxLength not permitted in string [message #588152 is a reply to message #46966] Fri, 04 June 2004 07:59 Go to previous message
Eclipse UserFriend
Originally posted by: jerome.negre+news.fr.adp.com

Ed,

Thanks for your quick reply.

> Please open a bugzilla and I'll commit the fix.

Bug 65672 is yours.

Regards,
Jérôme
Previous Topic:XSDSimpleTypeDefinition - facets, syntheticFacets, and facetContents
Next Topic:Inherited attributes
Goto Forum:
  


Current Time: Thu Dec 26 23:56:58 GMT 2024

Powered by FUDForum. Page generated in 0.04375 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top