You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Virmani Singh <vs...@novocorp.com> on 2001/01/10 15:50:36 UTC

How to dynamically create an XSL link?

I am using xerces to create XML file from a database. I need to add an XSL
link in this XMl file. How do I do it dynamically? Is there a method to do
do?

Any idea? Thanks in advance.

Virmani Singh
Engineer
NOVO
Relationship Architects for e-Business

Phone 646.336.3207  Fax 646.336.3333
vsingh@novocorp.com
www.novocorp.com


RE: How to dynamically create an XSL link?

Posted by Virmani Singh <vs...@novocorp.com>.
Thanks Jay, it works beautifully!!!

-----Original Message-----
From: Jay Cain [mailto:jay@cett.msstate.edu]
Sent: Thursday, January 11, 2001 2:39 PM
To: xerces-j-dev@xml.apache.org
Subject: RE: How to dynamically create an XSL link?


You can do this by creating the appropriate processing instruction and
inserting it before the document element. Here's an example snipet:

  ProcessingInstruction pi = document.createProcessingInstruction(
      "xml-stylesheet",
      "href='mylook.xsl' type='text/xsl'"
  );
  document.insertBefore(pi, document.getDocumentElement());

- - - - -
Jay Cain
Center for Educational and Training Technology
Mississippi State University

> -----Original Message-----
> From: Virmani Singh [mailto:vsingh@novocorp.com]
> Sent: Wednesday, January 10, 2001 8:51 AM
> To: Xerces-J-Dev (E-mail)
> Subject: How to dynamically create an XSL link?
>
>
> I am using xerces to create XML file from a database. I need to add an XSL
> link in this XMl file. How do I do it dynamically? Is there a method to do
> do?
>
> Any idea? Thanks in advance.
>
> Virmani Singh
> Engineer
> NOVO
> Relationship Architects for e-Business
>
> Phone 646.336.3207  Fax 646.336.3333
> vsingh@novocorp.com
> www.novocorp.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org



RE: How to dynamically create an XSL link?

Posted by Jay Cain <ja...@cett.msstate.edu>.
You can do this by creating the appropriate processing instruction and
inserting it before the document element. Here's an example snipet:

  ProcessingInstruction pi = document.createProcessingInstruction(
      "xml-stylesheet",
      "href='mylook.xsl' type='text/xsl'"
  );
  document.insertBefore(pi, document.getDocumentElement());

- - - - -
Jay Cain
Center for Educational and Training Technology
Mississippi State University

> -----Original Message-----
> From: Virmani Singh [mailto:vsingh@novocorp.com]
> Sent: Wednesday, January 10, 2001 8:51 AM
> To: Xerces-J-Dev (E-mail)
> Subject: How to dynamically create an XSL link?
>
>
> I am using xerces to create XML file from a database. I need to add an XSL
> link in this XMl file. How do I do it dynamically? Is there a method to do
> do?
>
> Any idea? Thanks in advance.
>
> Virmani Singh
> Engineer
> NOVO
> Relationship Architects for e-Business
>
> Phone 646.336.3207  Fax 646.336.3333
> vsingh@novocorp.com
> www.novocorp.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org