On 10/17/07, Shahar Evron <[EMAIL PROTECTED]> wrote:
> Hi Michael,
>
> Generally speaking you are right - a URI without a scheme is invalid,
> but I don't think this is a good enough reason not to represent partial
> URLs in an object.

The added complexity of allowing virtually any input is going to come
back to haunt you.

> It will make it easier for users, for example, to parse HTML files which
> might contain full or partial URLs, and extract them, without checking
> whether they are complete or not. Then you could use this partial URI to
> extract parts of it - like the path, fragment or query string.

$page = HtmlDocument::parse($str);
$context = $page->getContextUri();
foreach ($page->getLinks() as $href) {
    $link = new Zend_Uri($context, $href);
}

If $href is a full URI it ignores $context.

Java may have some bloated libraries but Sun's URL class seems well
designed to me.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/

Reply via email to