Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:15:46+00:00 2026-05-16T15:15:46+00:00

How can I omit all XML-Namespaces from the xslt in the html-output? My XSL

  • 0

How can I omit all XML-Namespaces from the xslt in the html-output?

My XSL starts with:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">

and my code to transform the XML is as follows

StringBuilder sb = new StringBuilder(600);
XslCompiledTransform xslTrans = new XslCompiledTransform();

xslTrans.Load(XslDoc);//loads the XSL

XmlWriterSettings writerSettings = new XmlWriterSettings();
writerSettings.OmitXmlDeclaration = true;
writerSettings.ConformanceLevel = ConformanceLevel.Auto;
writerSettings.NamespaceHandling = NamespaceHandling.OmitDuplicates;


using (XmlWriter stringWriter = XmlWriter.Create(sb, writerSettings))
{
    xslTrans.Transform(XmlDoc, xslArguments, stringWriter);
}
return sb.ToString();

But in the generated html output appear the namespaces as follows:

<div class="newsFeed" xmlnsxs="http://www.w3.org/2001/XMLSchema" xmlnsfn="http://www.w3.org/2005/xpath-functions" >

How can I omit all namespaces in the generated output?
It was cool, if I could do this by modifying the XSL, so user can change their XSL to embed their namespaces but default it would be clean HTML-Code without xmlns.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:15:47+00:00Added an answer on May 16, 2026 at 3:15 pm

    You’re probably looking for the exclude-result-prefixes attribute on your xsl:stylesheet element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some XML files of this form: <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=biomirror.xsl?>
How can I insert the youtubeId parameter in the following code : <?xml version=1.0
Is there any way to refactor this code so that it can omit unnecessary
How can I omit Zeros in my data? For example using the MIN function?
I want to use using statement purely for scope management. Can I omit holding
I'm reading some data from an XML format and putting it in my classes
Looking to use XSLT to transform my XML. The sample XML is as follows:
I have this regex that allow all php files : ^.*\.([Pp][Hh][Pp]) how can I
To see all the php files that contain abc I can use this simple
I have following CSV data: 10,11,12.34 I can parse this using CSV from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.