xsl-list
[Top] [All Lists]

RE: [xsl] Stopping any processing instruction output

2007-02-03 11:44:16
I am doing some transformation in PHP5, but only pieces.  The 
end result is containing the xml version processing 
instruction, which would prefer it did not.

First thing to understand is that the XML declaration is not a processing
instruction (if you get the terminology right, Google is more likely to find
the answer for you...)


  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
standalone="yes"/>


Try adding omit-xml-declaration="yes" to xsl:output.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <div 
xmlns="http://www.miltonstreet.com/events.xsd"; 
id="titlebar">Home</div>

How do I get ride of the processing instruction on the 
output?  Also, is there any way to get ride of the xmlns 
attribute on the div?

If you don't want the div element to be in the namespace
http://www.miltonstreet.com/events.xsd, then you must change the code that
puts it in that namespace (the namespace declaration will then disappear).
The way to do this depends on whether the div element was constructed as a
literal result element, by using xsl:element, or by using
xsl:copy/xsl:copy-of.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--