Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: Anil Philip <goodnewsforyou@-----.--->
To: xml dev <xml-dev@-----.---.--->
Date: 1/1/2006 3:52:00 AM
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent