Regarding XSLT and XML

Hi Everybody,

Is this possible to add a link to XSL file in an XML file using some API?

my application generates an XML file and I have an XSL file for that.

is it possible to add this tag to the XML file:

<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

or there is a way to use that XSL file.

Please advise.

Thanks in advance.

[391 byte] By [Dheeraj_Gabaa] at [2007-11-27 3:49:39]
# 1
You can add that entry using several APIs. It's called a "processing instruction", so just look in the API that you want to use and see if there are methods to produce processing instructions.
DrClapa at 2007-7-12 8:53:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thanks for replying.

I have already done that. Yes, the Document interface has method to create processing instruction.

e.g.

ProcessingInstruction x = document.createProcessingInstruction("xml:stylesheet", "type='text/xsl' href='path'");

document.appendChild(x);

Anyways, Thanks a lot.

Dheeraj_Gabaa at 2007-7-12 8:53:32 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...