[
Lists Home |
Date Index |
Thread Index
]
- To: xml dev <xml-dev@lists.xml.org>
- Subject: how to resolve a url within the xml document during parsing? (Sax/Java)
- From: Anil Philip <goodnewsforyou@yahoo.com>
- Date: Sat, 31 Dec 2005 19:52:05 -0800 (PST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=wCfKTq0VABM7qnNltOhh133dCnng4HuUWVgSLZZ+WP5qRuB+RLn2cRav8eAQGl8PfdrNeUh9ZbtiLIWUU06GZSN3ePQXyIMhKLTLR74xmK8fcwaBcHteYDZnLd5qjo451c5/ONLWVtMQQQcLdyomGYHhipVG4KwpQ0YMf6698+w= ;
- In-reply-to: <20051227174756.GB12324@w3.org>
During parsing (SAX/Java),
1) can I access the url of the xml file being parsed
from within the parser? (I could perhaps add a member
and instantiate the XMLReader with it also but
wondered if it was already available.)
2) If my xml file peace.xml is at server foo.com in
the directory
wwwroot/foo.com/anilp, then if it contains a base url
in
the format:
<origin xml:base="http:/./peace_files"
href="joy.spx"> </origin>
During parsing, can we know the url of the document
(joy.spx)
and translate to the absolute url?
I tried using the URL constructor to do thus within
the parser - for example
new
URL("http://foo.com/anilp/peace.xml","./peace_files")
However the URL printed is unexpectedly:
http://foo.com/peace_files
Question: how can I get the base url for the joy.spx
file?
which is http://foo.com/anilp/peace_files/
Any help appreciated and Happy New Year!
thanks,
Anil
__________________________________
Yahoo! for Good - Make a difference this year.
http://brand.yahoo.com/cybergivingweek2005/
|