Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: xhtml.xsd error?

From: "Michael Kay" <mike@--------.--->
To: =?iso-8859-1?Q?'Lu=EDs_Fernando_Heckler'?= <lfheckler@--.---.-->
Date: 8/8/2006 6:17:00 PM
Firstly, XML Schema regular expressions are defined in the XML Schema =
spec,
not the Python spec.

Secondly, I think you've misread the spec. But I'm on vacation, so I'm =
not
going to pursue it right now.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Lu=EDs Fernando Heckler [mailto:lfheckler@i...] 
> Sent: 08 August 2006 14:11
> To: Michael Kay
> Cc: xmlschema-dev@w...
> Subject: Re: xhtml.xsd error?
> 
> Thanks Michael !
> 
> All right, this make sense, but the original Regular 
> Expression "[-+]?(\d+|\d+(\.\d+)?%)" doesn't match values 
> like "100.5%".
> 
> At http://docs.python.org/lib/re-syntax.html we can read:
> "|A|B|, where A and B can be arbitrary REs, creates a regular 
> expression that will match either A or B. An arbitrary number 
> of REs can be separated by the "|" in this way. This can be 
> used inside groups (see
> below) as well. As the target string is scanned, REs separated by "|" 
> are tried from left to right. When one pattern completely 
> matches, that branch is accepted. This means that once |A| 
> matches, |B| will not be tested further, even if it would 
> produce a longer overall match. In other words, the "|" 
> operator is never greedy."
> 
> So, the original expression match the substring "100" first and stop.
> 
> An alternative could be: "[-+]?(\d+(\.\d+)?%|\d+)"
> This recognize:
> 
> 100
> 100%
> 100.0%
> +100
> +100%
> +100.0%
> -100
> -100%
> -100.0%
> 
> But also recognize strings like "1000000000.3332%" ... this 
> is correct, but weird.
> 
> 
> Lu=EDs Fernando Heckler
> 
> 
> 
> Michael Kay escreveu:
> > This picture allows a decimal point only if there is a "%", 
> which seems
> > reasonable, because you can't have a fractional number of pixels.
> >
> > Michael Kay
> > http://www.saxonica.com/
> >
> >  
> >
> >   
> >> -----Original Message-----
> >> From: xmlschema-dev-request@w... 
> >> [mailto:xmlschema-dev-request@w...] On Behalf Of Luis 
> >> Fernando Heckler
> >> Sent: 02 August 2006 20:01
> >> To: xmlschema-dev@w...
> >> Subject: xhtml.xsd error?
> >>
> >>
> >> Hi,
> >>
> >> I'm using the w3c xhtml.xsd to validate my xhtml document, 
> >> but I found something wrong:
> >>
> >> In the simpleType definition named Length (line 203), used to 
> >> validate de type of attributes width and heigth of table 
> >> element for example, we have a pattern to validate the type, 
> >> but this pattern doesn't match witch all the expected 
> formats (AFAIK).
> >>
> >> http://www.w3.org/TR/xhtml-modularization/abstraction.html#dt_
> >> Length  say's:
> >> "Length - The value may be either in pixels or a percentage 
> >> of the available horizontal or vertical space. Thus, the 
> >> value "50%" means half of the available space."
> >>
> >> The documentation comment in the xsd say's:
> >> "nn for pixels or nn% for percentage length"
> >>
> >> So, I thing that expected values are:
> >> 100
> >> 100.0
> >> 100%
> >> 100.0%
> >> +100
> >> +100.0
> >> +100%
> >> +100.0%
> >> -100
> >> -100.0
> >> -100%
> >> -100.0%
> >>
> >> But the original pattern "[-+]?(\d+|\d+(\.\d+)?%)" don't 
> >> match all this length formats.
> >>
> >> I change to "[-+]?\d+(\.\d+)?%?"
> >>
> >> This is a error in original w3c xhtml.xsd or I'm wrong about 
> >> the expected length formats?
> >>
> >> Best wishes
> >> Luis Fernando Heckler
> >>
> >>
> >>
> >>
> >>
> >>     
> >
> >
> >
> >
> >   


From noah_mendelsohn@u... Tue Aug 08 18:59:13 2006
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1GAWnI-0008FF-Vq; Tue, 0


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent