how to extract a value out of string, and apply restriction

I need to extract WIDTH: & put a restriction over it for maximum length, using XSD
Can you help me out?

Hi,

extracting WIDTH with XQuery can be done like this:
substring-before(substring-after(input()/table/@style,“WIDTH: “),”;”)

restricting WIDTH to a certain maximum in the schema is not straight-forward because XML schema has only limited support for sub-value restrictions (only the pattern facet, which would allow you to e.g. restrict WIDTH to three digits, or to a three digit value having 1,2,3 as first digit etc. - based on regular expressions
If you do not want to go down this path, you have to use a trigger to check the value

Best regards

harald

Hi Dr.Harald,

 Thanks for the reply.

 The solution that you have suggested can be worked on, in case of XSLT. Basically, I was looking for a XSD. If you could help me in that.

Thanks & Regards,
Neha

Hi Neha,

please have a look at th second part of my reply which relates to XSD:
restricting WIDTH to a certain maximum in the schema is not straight-forward because XML schema has only limited support for sub-value restrictions (only the pattern facet, which would allow you to e.g. restrict WIDTH to three digits, or to a three digit value having 1,2,3 as first digit etc. - based on regular expressions
If you do not want to go down this path, you have to use a trigger to check the value

Best regards

harald