Solved

XSLT namesapce declarations inserted as attributes in transformation result

Posted on 2007-03-22
1
221 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
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now