You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Ugo Cei <ug...@gmail.com> on 2006/06/20 16:13:06 UTC

Absolutizing URIs

Hi folks,

I have a question for you: what is the best way to absolutize  
relative URIs coming from an Atom document, assuming that I have  
parsed the document using Parser.INSTANCE.parse(inputStream, baseURI) ?

	TIA,


		Ugo


-- 
Ugo Cei
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/



Re: Absolutizing URIs

Posted by James M Snell <ja...@gmail.com>.
Atom is silent on the issue, however, I think you'll find that feed
consumers and publishers are quite clear on it :-) ... IMHO, Abdera
should preserve the xml:base and provide utility methods that may be
used to resolve the URIs in content, but shouldn't go beyond that.
Implementors can do what they want.

- James

Stephen Duncan wrote:
> Quite.  Was it intended by the Atom spec that relative URI's within
> HTML content were supposed to be handled?
> 
> -Stephen
> 
> On 6/26/06, James M Snell <ja...@gmail.com> wrote:
>> Relative URIs in content are preserved but there is currently no API for
>> resolving those URIs.  With XHTML/XML content, it's not that difficult
>> of a problem to solve.  It gets complicated when the content is escaped
>> HTML.
>>
>>
>> - James
>>
>> Stephen Duncan wrote:
>> > What about within content?  For instance, in Tim Bray's feed:
>> > http://www.tbray.org/ongoing/ongoing.atom there's summary & content
>> > elements with the following in it: <a
>> > href='/ongoing/When/200x/2006/06/15/Switch-From-Mac'>  Could Abdera
>> > help resolve these href's?
>> >
>> > -Stephen
>> >
>> > On 6/20/06, James M Snell <ja...@gmail.com> wrote:
>> >> All of the elements that allow relative uri's have a getResolved...
>> >> form.  For example, if you want to get the resolved value of a Link's
>> >> href attribute, you would call:
>> >>
>> >>   URI uri = entry.getAlternateLink().getResolvedHref();
>> >>
>> >> The will resolve the value against the current in-scope Base URI.
>> >>
>> >> - James
>> >>
>> >> Ugo Cei wrote:
>> >> > Hi folks,
>> >> >
>> >> > I have a question for you: what is the best way to absolutize
>> relative
>> >> > URIs coming from an Atom document, assuming that I have parsed the
>> >> > document using Parser.INSTANCE.parse(inputStream, baseURI) ?
>> >> >
>> >> >     TIA,
>> >> >
>> >> >
>> >> >         Ugo
>> >> >
>> >> >
>> >> > --Ugo Cei
>> >> > Blog: http://agylen.com/
>> >> > Open Source Zone: http://oszone.org/
>> >> > Evil or Not?: http://evilornot.info/
>> >> > Company: http://www.sourcesense.com/
>> >> >
>> >> >
>> >> >
>> >>
>> >
>> >
>>
> 
> 

Re: Absolutizing URIs

Posted by Stephen Duncan <st...@gmail.com>.
Quite.  Was it intended by the Atom spec that relative URI's within
HTML content were supposed to be handled?

-Stephen

On 6/26/06, James M Snell <ja...@gmail.com> wrote:
> Relative URIs in content are preserved but there is currently no API for
> resolving those URIs.  With XHTML/XML content, it's not that difficult
> of a problem to solve.  It gets complicated when the content is escaped
> HTML.
>
>
> - James
>
> Stephen Duncan wrote:
> > What about within content?  For instance, in Tim Bray's feed:
> > http://www.tbray.org/ongoing/ongoing.atom there's summary & content
> > elements with the following in it: <a
> > href='/ongoing/When/200x/2006/06/15/Switch-From-Mac'>  Could Abdera
> > help resolve these href's?
> >
> > -Stephen
> >
> > On 6/20/06, James M Snell <ja...@gmail.com> wrote:
> >> All of the elements that allow relative uri's have a getResolved...
> >> form.  For example, if you want to get the resolved value of a Link's
> >> href attribute, you would call:
> >>
> >>   URI uri = entry.getAlternateLink().getResolvedHref();
> >>
> >> The will resolve the value against the current in-scope Base URI.
> >>
> >> - James
> >>
> >> Ugo Cei wrote:
> >> > Hi folks,
> >> >
> >> > I have a question for you: what is the best way to absolutize relative
> >> > URIs coming from an Atom document, assuming that I have parsed the
> >> > document using Parser.INSTANCE.parse(inputStream, baseURI) ?
> >> >
> >> >     TIA,
> >> >
> >> >
> >> >         Ugo
> >> >
> >> >
> >> > --Ugo Cei
> >> > Blog: http://agylen.com/
> >> > Open Source Zone: http://oszone.org/
> >> > Evil or Not?: http://evilornot.info/
> >> > Company: http://www.sourcesense.com/
> >> >
> >> >
> >> >
> >>
> >
> >
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Absolutizing URIs

Posted by James M Snell <ja...@gmail.com>.
Relative URIs in content are preserved but there is currently no API for
resolving those URIs.  With XHTML/XML content, it's not that difficult
of a problem to solve.  It gets complicated when the content is escaped
HTML.


- James

Stephen Duncan wrote:
> What about within content?  For instance, in Tim Bray's feed:
> http://www.tbray.org/ongoing/ongoing.atom there's summary & content
> elements with the following in it: <a
> href='/ongoing/When/200x/2006/06/15/Switch-From-Mac'>  Could Abdera
> help resolve these href's?
> 
> -Stephen
> 
> On 6/20/06, James M Snell <ja...@gmail.com> wrote:
>> All of the elements that allow relative uri's have a getResolved...
>> form.  For example, if you want to get the resolved value of a Link's
>> href attribute, you would call:
>>
>>   URI uri = entry.getAlternateLink().getResolvedHref();
>>
>> The will resolve the value against the current in-scope Base URI.
>>
>> - James
>>
>> Ugo Cei wrote:
>> > Hi folks,
>> >
>> > I have a question for you: what is the best way to absolutize relative
>> > URIs coming from an Atom document, assuming that I have parsed the
>> > document using Parser.INSTANCE.parse(inputStream, baseURI) ?
>> >
>> >     TIA,
>> >
>> >
>> >         Ugo
>> >
>> >
>> > --Ugo Cei
>> > Blog: http://agylen.com/
>> > Open Source Zone: http://oszone.org/
>> > Evil or Not?: http://evilornot.info/
>> > Company: http://www.sourcesense.com/
>> >
>> >
>> >
>>
> 
> 

Re: Absolutizing URIs

Posted by Stephen Duncan <st...@gmail.com>.
What about within content?  For instance, in Tim Bray's feed:
http://www.tbray.org/ongoing/ongoing.atom there's summary & content
elements with the following in it: <a
href='/ongoing/When/200x/2006/06/15/Switch-From-Mac'>  Could Abdera
help resolve these href's?

-Stephen

On 6/20/06, James M Snell <ja...@gmail.com> wrote:
> All of the elements that allow relative uri's have a getResolved...
> form.  For example, if you want to get the resolved value of a Link's
> href attribute, you would call:
>
>   URI uri = entry.getAlternateLink().getResolvedHref();
>
> The will resolve the value against the current in-scope Base URI.
>
> - James
>
> Ugo Cei wrote:
> > Hi folks,
> >
> > I have a question for you: what is the best way to absolutize relative
> > URIs coming from an Atom document, assuming that I have parsed the
> > document using Parser.INSTANCE.parse(inputStream, baseURI) ?
> >
> >     TIA,
> >
> >
> >         Ugo
> >
> >
> > --Ugo Cei
> > Blog: http://agylen.com/
> > Open Source Zone: http://oszone.org/
> > Evil or Not?: http://evilornot.info/
> > Company: http://www.sourcesense.com/
> >
> >
> >
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Absolutizing URIs

Posted by James M Snell <ja...@gmail.com>.
All of the elements that allow relative uri's have a getResolved...
form.  For example, if you want to get the resolved value of a Link's
href attribute, you would call:

  URI uri = entry.getAlternateLink().getResolvedHref();

The will resolve the value against the current in-scope Base URI.

- James

Ugo Cei wrote:
> Hi folks,
> 
> I have a question for you: what is the best way to absolutize relative
> URIs coming from an Atom document, assuming that I have parsed the
> document using Parser.INSTANCE.parse(inputStream, baseURI) ?
> 
>     TIA,
> 
> 
>         Ugo
> 
> 
> --Ugo Cei
> Blog: http://agylen.com/
> Open Source Zone: http://oszone.org/
> Evil or Not?: http://evilornot.info/
> Company: http://www.sourcesense.com/
> 
> 
>