469,097 Members | 1,600 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

Outputting "<?" with XSLT

Hi,

I'm applying a XSL transformation to a XML document. I would like to
know if it's possible to include <?..?> in the output header.

Example:

=====
a.xml:
=====

<root>
<elem1/>
</root>

======
a.xslt:
======

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" media-type="application/xml"/>

<xsl:template match="/">
<TEST>
</xsl:template>
</xsl:stylesheet>

======
Result:
======

<?xml version = '1.0'?>
<TEST>

====================
I would like to have:
====================

<?xml version = '1.0'?>
<?xml-stylesheet type="text/xsl" href="......"?>
<TEST>
How can I manage this?
Hope I made myself clear enough.

Thanks in advance,
Sérgio Nunes
Jul 20 '05 #1
2 1383
S??rgio Nunes wrote:
Hi,

I'm applying a XSL transformation to a XML document. I would like to
know if it's possible to include <?..?> in the output header.


The element is xsl:processing-instruction.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2


S??rgio Nunes wrote:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" media-type="application/xml"/>

<xsl:template match="/"> <xsl:processing-instruction name="xml-stylesheet">type="text/xsl"
href="..."</xsl:processing-instruction> <TEST>
</xsl:template>
</xsl:stylesheet>

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


See
http://www.w3.org/TR/xslt#section-Cr...g-Instructions

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Eric A. Forgy | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
7 posts views Thread by Diandian Zhang | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.