'Verify the data in this URL is well-formed, and override if not.'

def Validate(self, base_url, allow_fragment):

    assert (type(base_url) == types.StringType)
    if (not self.loc):
        output.Warn('Empty    URL')
        return False
    if allow_fragment:
        self.loc = urlparse.urljoin(base_url, self.loc)
    if (not self.loc.startswith(base_url)):
        output.Warn(('Discarded    URL    for    not    starting    with    the    base_url:    %s' % self.loc))
        self.loc = None
        return False
    if self.lastmod:
        match = False
        self.lastmod = self.lastmod.upper()
        for pattern in LASTMOD_PATTERNS:
            match = pattern.match(self.lastmod)
            if match:
                break
        if (not match):
            output.Warn(('Lastmod    "%s"    does    not    appear    to    be    in    ISO8601    format    on    URL:    %s' % (self.lastmod, self.loc)))
            self.lastmod = None
    if self.changefreq:
        match = False
        self.changefreq = self.changefreq.lower()
        for pattern in CHANGEFREQ_PATTERNS:
            if (self.changefreq == pattern):
                match = True
                break
        if (not match):
            output.Warn(('Changefreq    "%s"    is    not    a    valid    change    frequency    on    URL    :    %s' % (self.changefreq, self.loc)))
            self.changefreq = None
    if self.priority:
        priority = (-1.0)
        try:
            priority = float(self.priority)
        except ValueError:
            pass
        if ((priority < 0.0) or (priority > 1.0)):
            output.Warn(('Priority    "%s"    is    not    a    number    between    0    and    1    inclusive    on    URL:    %s' % (self.priority, self.loc)))
            self.priority = None
    return True
