File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes JDOM -- addProcessingInstruction doesn't work correctly with IE6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JDOM -- addProcessingInstruction doesn Watch "JDOM -- addProcessingInstruction doesn New topic
Author

JDOM -- addProcessingInstruction doesn't work correctly with IE6

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
I've noticed that when you add a processing instruction that points to an XSL stylesheet the way most JDOM books recommend, you end up with the processing instruction at the bottom of the JDOM-created XML file.
The basic high-level code skeleton looks like this:
makeRootElt("root");
makeJDOMDoc();
// add processing instruction to document level
addProcessingInstruction(xslSheetName);
For some reason IE 6 can't handle having the xsl processing instruction at the bottom and renders the XML File in raw mode (just the XML tree without the XSL stylesheet).
It's not until I move the xsl processing instruction underneath the main ?xml = 1.0 ... instruction at the top before it works.
I've found several posts of this problem but, so far, no solution that works for me...
Has anybody run into this problem?
I can't seem to juggle the code around so the processing instruction is created in the necessary place.
Thanks for any replies.
-- Mike
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
I just wrote a JDOM code yesterday, saw your question this morning. I added ProcessingInstructions to the code and it shows up on the right place. Take a look:
Q. I want to create a new XML file by using JDOM. Can you give a simple example? (With PI)
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
You're right, it worked!!!
Thank you very, very much.
I sent the author of the Java/XML book your code which will fix his code listing as well.

- Mike
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
The smiley faces in my posting above were meant to be *just* smiling faces. I didn't realize they stuck their tounges out until after I saw my own posting.
Sorry about that ... <s>
-- Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDOM -- addProcessingInstruction doesn't work correctly with IE6