XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
ajay shahSubject: Hiding declarations in XSLT
Author: ajay shah
Date: 18 Apr 2006 01:04 PM
Using: Stylus Studio 6 Enterprise Edition
xslt processor: Saxon 6.5.3

I am trying to hide certain elements in the output but am unable to do so:

<!-- Start: stylesheet.xsl --->
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:a="http://www.someurl.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

<xsl:output method="xml"/>


<!-- End: stylesheet.xsl -->

<!-- Output Obtained --->
<?xml version='1.0' ?>

<elementRoot xmlns:a="http://www.someurl.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

<!--output Desired -->


i.e I do not want the xml declaration to show up in the output

<?xml version='1.0' ?> should not be included.

Also the elementRoot should not contain any namespace attributes.

Any suggestions on how I would make this happen ?


Minollo I.Subject: Hiding declarations in XSLT
Author: Minollo I.
Date: 18 Apr 2006 01:18 PM
To remove namespace declarations from the output, you can use the attribute "exclude-result-prefixes" in the <xsl:stylesheet...> element; like:
<xsl:stylesheet .... exclude-result-prefixes="xsi a">

To remove the XML PI from the output, you can add omit-xml-declaration="yes" in your <xsl:output> element:
<xsl:output omit-xml-declaration="yes"/>

Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.