[jdom-interest] Adding PI's to Document in prologue just after XML declartion

Yusuf Goolamabbas yusufg at outblaze.com
Sun Dec 3 20:57:28 PST 2000


Hi, I have a Document object which represents the following XML
structure

<?xml version="1.0" ?>
<root>
</root>

Now, I would like to insert a PI just after the XML
prologue. Something like this

<?xml version="1.0" ?>
<?xml-stylesheet href="foo.xsl" type="text/xsl"?>
<root>
</root>

However, Document.addContent(ProcessingInstruction PI) as well as
Document.setProcessingInstructions(java.util.List) add the PI in the
following way

<?xml version="1.0" ?>
<root>
</root>
<?xml-stylesheet href="foo.xsl" type="text/xsl"?>

I can modify the code to return the root Element and then add the PI
first and then set the root Element. Is there anyother way to add PI's
in the prologue just after the XML declartion

Regards, Yusuf

-- 
Yusuf Goolamabbas
yusufg at outblaze.com



More information about the jdom-interest mailing list