OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Entity resolution vs. URI resolution

[ Lists Home | Date Index | Thread Index ]

At 1:58 PM -0500 1/24/02, Norman Walsh wrote:


>| offers exactly the functionality you're looking for:
>|
>| public URL(URL context,
>|             String spec)
>|      throws MalformedURLException
>
>Uhm. I'm confused. That'll return the stream, but I actually want the
>URI to be passed through *the resolver* (for example XML Catalogs[1])
>not blindly slurped across the net.
>

No, that doesn't create a stream. It just constructs a new URL 
object. If you want to get a stream (You don't have to) then you 
would call openStream() on the new object.

YOu should also check out the new java.net.URI class in Java 1.4:

http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html

The following methods are particularly interesting:

public URI resolve(URI uri)
public URI resolve(String uri)

These return the absolute form of the uri argument using the current 
URI object as the context. Isn't this what you want?
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS