[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to resolve a url within the xml document during parsing? (Sax/Java)

  • To: xml dev <xml-dev@l...>
  • Subject: how to resolve a url within the xml document during parsing? (Sax/Java)
  • From: Anil Philip <goodnewsforyou@y...>
  • 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@w...>

sax url
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
the format:

<origin xml:base="http:/./peace_files"
href="joy.spx">  </origin> 
During parsing, can we know the url of the document
and translate to the absolute url? 

I tried using the URL constructor to do thus within
the parser - for example


However the URL printed is unexpectedly:

Question: how can I get the base url for the joy.spx
which is http://foo.com/anilp/peace_files/

Any help appreciated and Happy New Year!

Yahoo! for Good - Make a difference this year. 


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.