|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Adding PI in XML Document
Hi All,
How to add stylesheet processing intstruction in a xml document which is
generated by DOM.
Here is the code am trying
String data = "type=\"text/xsl\" href=\"cdcatalog.xsl\"";
ProcessingInstruction pi =
doc.createProcessingInstruction("xml-stylesheet",data);
doc.appendChild( pi );
But when I write to a file after finishing no pi appeares in xml document.
When I tried with following code..
String data = "type=\"text/xsl\" href=\"cdcatalog.xsl\"";
ProcessingInstruction pi =
doc.createProcessingInstruction("xml-stylesheet",data);
root.insertBefore((Node)pi,root.getFirstChild());
Then I found the following in xml document
<?xml version="1.0" ?>
<root>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
.....
</root>
But I want to generate like
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<root>
.....
</root>
TIA,
Samba
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








