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

Passing DTD as systemID into StreamSource

Subject: Passing DTD as systemID into StreamSource
From: "Pramodh Peddi" <peddip@xxxxxxxxxxxxxxxx>
Date: Thu, 6 Nov 2003 20:17:13 -0500
streamsource systemid
Hi,
I am transforming an xml source which has a DTD reference inside it (passing
as systemID). The wierd thing is, the DTD is referenced with just a filename
(which is very unusual and stupid!, but thats cutomer's feed and we do not
have control in it). And fortunately that file is in a http accessible
location. So, I am doing this:
(I am using Java1.4's API for Transformation)
transformer.transform(new StreamSource(new StringReader(metadata), dtdURL),
new StreamResult(new OutputStreamWriter(outputStream, "UTF-8")));

I am just passing the dtdURL, asking it to validate using the given dtdURL.
The dtdURL is "http://servername:80/dir/SonyDAM.dtd". The funky thing it is
doing is, it is resolving the name to be
"http://servername:80/dir/SonyDam.dtd". I did not understand why it is doing
that. And when we rename the SonyDAM.dtd to SonyDam.dtd, it worked. Can any
one tell why it is doing that?

If what I am doing is wrong, is there any other way I can do this? What is
the usual and best way to pass in a dtd url, though the xml source has dtd
reference - asking it to use the dtd url which we give while parsing, but
not the dtd which is there in the xml source (because, in my case, the dtd
reference is just a filename).

One more question reg'g dtd: If we have
<!DOCTYPE SONY_PRODUCT_METADATA SYSTEM "Metadata.dtd">

in the xml source, where should the Metadata.dtd be placed when the
transformation is done inside an application server? Where does it first
look into to find the dtds?

I would appreciate any suggestions and help.

Thanks,

Pramodh.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
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.