Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XSLT namesapce declarations inserted as attributes in transformation result

Posted on 2007-03-22
1
Medium Priority
?
228 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 2000 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

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.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

721 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