Solved

XSLT namesapce declarations inserted as attributes in transformation result

Posted on 2007-03-22
1
226 Views
Last Modified: 2013-11-18
XSLT file looks like:

<xsl:stylesheet version="1.0"
                                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                        xmlns:ms="urn:schemas-microsoft-com:xslt"
                        xmlns:vb="urn:the-xml-files:xslt-vb">

<xsl:output method="html" omit-xml-declaration="yes" indent="yes" />

<xsl:template match="test">
<div>
   test
</div>
      
</xsl:template>
</xsl:stylesheet>

XML file:

<?xml version="1.0" encoding="UTF-8"?>
<test>
</test>


xml/xsl loading with MSXML
Dim objXML 'As MSXML2.DOMDocument
            Set objXML = Server.CreateObject( "MSXML2.DOMDocument.4.0" )
            With objXML
                .async = False                        'We do not want asynchronous downloads
                .validateOnParse = true        'don't want to validate against a schema
                .preserveWhiteSpace = True 'preserve white space
                .resolveExternals = False       'do not resolve external DTDs, etc
            End With
XMLDocument.transformNode(XSLDocument)

After transformation  i've got this:

<div xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:vb="urn:the-xml-files:xslt-vb">
   test
</div>

Question: how to omit xmlns:vb and xmlns:ms inserting as attributes.

Thanks
0
Comment
Question by:Bill_Harrison
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
jkmyoung earned 500 total points
ID: 18773329
Use exclude-result-prefixes, eg

<xsl:stylesheet version="1.0"
                                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                        xmlns:ms="urn:schemas-microsoft-com:xslt"
                        xmlns:vb="urn:the-xml-files:xslt-vb"
exclude-result-prefixes="ms vb">
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question