[jdom-interest] Adding reference to xsl stylesheet to xml document

Scott Ellis scotey at pacbell.net
Mon Nov 15 10:54:12 PST 2004

Hey, just glad I could answer a question instead of asking one:

  HashMap piMap = new HashMap( 2 );
  piMap.put( "type", "text/xsl" );
  piMap.put( "href", "stylesheet.xsl" );
  ProcessingInstruction pi = new ProcessingInstruction( "xml-stylesheet",
piMap );

  doc.getContent().add( 0, pi );


----- Original Message ----- 
From: "Asleson, Ryan" <asleson at biworldwide.com>
To: <jdom-interest at jdom.org>
Sent: Monday, November 15, 2004 7:40 AM
Subject: [jdom-interest] Adding reference to xsl stylesheet to xml document

> Hello,
> This is probably a FAQ as I saw it mentioned a few times when searching
> archives but never saw an answer posted.
> I have an org.jdom.Document.  I want to add this to the top of the xml
> document, right under the <?xml version= .... line:
> <?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
> How do I do this?  Is there a method on the org.jdom.Document class or do
> do it some other way?
> Thank you very much!
> This e-mail message is being sent solely for use by the intended
recipient(s) and may contain confidential information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not the
intended recipient, please contact the sender by phone or reply by e-mail,
delete the original message and destroy all copies. Thank you.
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list