You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by starlightpurple <st...@yahoo.com> on 2004/04/30 06:46:23 UTC

restrictions

Hi,

Is it possible to obtain the restriction data for an
element?

For example, I have the following definition in my
schema:

<xs:element name="description">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

If the description is over 50 characters long, I would
like to truncate the text to the value defined by the
maxLength restriction. My requirements are to just
truncate the text, instead of having the xml document
fail the validation process.  So, is there a way to
obtain the 50 from the schema?

Thanks,

Maren



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: restrictions

Posted by starlightpurple <st...@yahoo.com>.
Hi,

I found the SchemaType.getFacet(
SchemaType.type.FACET_MAX_LENGTH ) method which will
do the trick.

Sorry for the noise.

- Maren

--- starlightpurple <st...@yahoo.com> wrote:
> Hi,
> 
> Is it possible to obtain the restriction data for an
> element?
> 
> For example, I have the following definition in my
> schema:
> 
> <xs:element name="description">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:minLength value="0"/>
> <xs:maxLength value="50"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> 
> If the description is over 50 characters long, I
> would
> like to truncate the text to the value defined by
> the
> maxLength restriction. My requirements are to just
> truncate the text, instead of having the xml
> document
> fail the validation process.  So, is there a way to
> obtain the 50 from the schema?
> 
> Thanks,
> 
> Maren
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
> -
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:  
> xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL:
> http://xml.apache.org/xmlbeans/
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: restrictions

Posted by starlightpurple <st...@yahoo.com>.
Hi,

I found the SchemaType.getFacet(
SchemaType.type.FACET_MAX_LENGTH ) method which will
do the trick.

Sorry for the noise.

- Maren

--- starlightpurple <st...@yahoo.com> wrote:
> Hi,
> 
> Is it possible to obtain the restriction data for an
> element?
> 
> For example, I have the following definition in my
> schema:
> 
> <xs:element name="description">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:minLength value="0"/>
> <xs:maxLength value="50"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> 
> If the description is over 50 characters long, I
> would
> like to truncate the text to the value defined by
> the
> maxLength restriction. My requirements are to just
> truncate the text, instead of having the xml
> document
> fail the validation process.  So, is there a way to
> obtain the 50 from the schema?
> 
> Thanks,
> 
> Maren
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
> -
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:  
> xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL:
> http://xml.apache.org/xmlbeans/
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/