XslTransform not excluding default namespace despite exclude-result-prefixes attribute?

I'm writing an xslt in vs.net 2003 and in order to get intellisense on
the html content I added the default namespace declaration
xmlns="http://schemas.microsoft.com/intellisense/ie5".  However, even
though I also have exclude-result-prefixes="#default" declared the
default namespace is still outputted on the resulting document.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet 
	version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns="http://schemas.microsoft.com/intellisense/ie5"
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
	exclude-result-prefixes="#default msxsl">
	
	<xsl:output method="html" indent="yes" />
		
	<xsl:template match="/">
		
		<div>
		</div>
	</xsl:template>
</xsl:stylesheet>

And this still gives resulting html:

<div xmlns="http://schemas.microsoft.com/intellisense/ie5">
</div>

I tried adding the xsl:exclude-result-prefixes attribute to the <div>
element and it had no effect.

Am I doing something wrong?  How can I get rid of the ns declaration
on the resulting document?  The source document has no namespace
declarations.

Thanks,

Sam


0
7/20/2006 1:56:23 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
710 Views

Similar Articles

[PageSpeed] 40


Samuel R. Neff wrote:

> I'm writing an xslt in vs.net 2003 and in order to get intellisense on
> the html content I added the default namespace declaration
> xmlns="http://schemas.microsoft.com/intellisense/ie5".  However, even
> though I also have exclude-result-prefixes="#default" declared the
> default namespace is still outputted on the resulting document.
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet 

> 	xmlns="http://schemas.microsoft.com/intellisense/ie5"
> 	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> 	exclude-result-prefixes="#default msxsl">
> 	
> 	<xsl:output method="html" indent="yes" />
> 		
> 	<xsl:template match="/">
> 		
> 		<div>

This means that div result element for instance is in that namespace 
with URI http://schemas.microsoft.com/intellisense/ie5 and has to be output

> <div xmlns="http://schemas.microsoft.com/intellisense/ie5">
> </div>

that way, whether you use exlucde-result-prefixes or not.

Exclude-result-prefixes does not strip any result elements or attributes 
of their namespace, it only helps to avoid namespace declarations in the 
output for namespaces not used with result elements or attributes (but 
rather in XPath expressions or match patterns).



-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
7/20/2006 2:10:42 PM
So if exclude-result-prefixes won't strip out the ns what will?

Thanks,

Sam


On Thu, 20 Jul 2006 16:10:42 +0200, Martin Honnen <mahotrash@yahoo.de>
wrote:

>
>Exclude-result-prefixes does not strip any result elements or attributes 
>of their namespace, it only helps to avoid namespace declarations in the 
>output for namespaces not used with result elements or attributes (but 
>rather in XPath expressions or match patterns).

0
7/20/2006 2:33:26 PM

Samuel R. Neff wrote:

> So if exclude-result-prefixes won't strip out the ns what will?

If you don't want an element to have a namespace then don't use one on it.
If you need it for your tool then with XSLT I only see a way if you run 
a second transformation which strips that namespace from elements e.g.
   <xsl:template
     xmlns:ie="http://schemas.microsoft.com/intellisense/ie5"
     match="ie:*">
     <xsl:element name="{local-name()}" namespace="">
       <xsl:apply-templates select="@* | node()" />
     </xsl:element>
   </xsl:template>

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
7/20/2006 3:10:34 PM
Thanks.

On Thu, 20 Jul 2006 17:10:34 +0200, Martin Honnen <mahotrash@yahoo.de>
wrote:

>
>
>Samuel R. Neff wrote:
>
>> So if exclude-result-prefixes won't strip out the ns what will?
>
>If you don't want an element to have a namespace then don't use one on it.
>If you need it for your tool then with XSLT I only see a way if you run 
>a second transformation which strips that namespace from elements e.g.
>   <xsl:template
>     xmlns:ie="http://schemas.microsoft.com/intellisense/ie5"
>     match="ie:*">
>     <xsl:element name="{local-name()}" namespace="">
>       <xsl:apply-templates select="@* | node()" />
>     </xsl:element>
>   </xsl:template>

0
7/20/2006 3:25:16 PM
Reply:

Similar Artilces:

How to XslTransform.Transform to new web page from code behind?
I'm working with a typed dataset and want to implement a print button that prints my formatted data without the company logo and other stuff on the form. I've created an XSLT file to transform the XML version of the dataset into HTML and would like to display it in a new browser window leaving the original window up and/or maybe even just send it out to the default printer or bring up the print dialog for printing out the web page. I have successfully saved the html file, but I'm not sure how to send to a new browser window instead of a file. Please help, code below: XmlData...

Default Reports!
We cannot access the default Reports in CRM. Please could anyone advise? Can Administrator access the reports? What happens - any errors? "Christine" wrote: > We cannot access the default Reports in CRM. Please could anyone advise? Could it be you change your organization name in the database? We also had the problem no reports where shown because of this change. For more info on how you can keep your organizational name changed and have the reports shown: http://mscrm.blogsource.com/post.mhtml?post_id=254674 > We cannot access the default Reports in CRM. Please coul...

Track Change Orders checkbox defaults (PA)
To use the "Track Change Orders" features in contracts and projects you need to check a checkbox in the Change Order setup area of a contract and of a project. Templates for contracts and projects do not appear to contain any default settings for that checkbox (or other change order settings). How can I default all of our new contracts to automatically set "Track Change Orders" as checked? -- Jim Rowley Business Analyst II ...

Default #5
Even though I have made Outlook Today my default page, Outlook opens/starts withs Inbox as the default page ? "Tools->Options->Other->Advanced Options->Startup in this folder:" - Pick one from the browse list. I don't think I saw Outlook Today. "Sera" wrote: > > Even though I have made Outlook Today my default page, Outlook opens/starts > withs Inbox as the default page ? Thanks, but I have allready done that. My Outlook is set uo to start with Outlook Today as the default page, but it uses Inbox as the default page. "Deb & ...

qry return no results in given field
I have a query that contains a union query and 2 other subqueries "A" and "B". A field that is contained in "A" subquery is returned blank in my query. In a separate query this same field is returned properly. This separate query also contains a union query (same as above) and 2 other queries (one of them is same as above "A" and "C" different from above). What would prevent this field from displaying its values in 1 query and not another ? Like I said, the values for the field are part of the subquery "A" and should be dis...

XslTransform
Hello everyone. I am trying to generate a document using a XML document and a XSLT stylesheet. There are unicode elements in the XSL style-sheet (Japanese) as seen below: <xsl:template match="delegate"> <xsl:call-template name="type"> <xsl:with-param name="type">�f���Q�[�g</xsl:with-param> </xsl:call-template> </xsl:template> Is there a way of doing the transformation correctly in the presence of the Unicode data?. ie. how do I tell the <XslTransform in...

Outlook Plugin Default View
I'm using the Outlook plugin for CRM 4.0. We have our default view for Accounts set to "My Active Accounts", but this is not time effective for me since I do not have any accounts and have to change views every time I navigate to accounts. Is there a way for a user to change default views for themselves only? I know this is possible company wide, but have not checked with the rest of my colleagues to see if this would be beneficial. I would really like to know if it's possible, even if they want to change the global default. I use the Outlook plugin only, no longer going...

Result Sheet in a School
Hi everybody, I want to make a result sheet for the school class; i am facing problem in logical formulas like how to assess position, how to assess GPA etc. Can any one help? Best Regards Basharat Basharat - Microsoft has some instructions for an "electronic gradebook" at http://office.microsoft.com/en-us/excel/HA100690701033.aspx - Mike Middleton http://www.DecisionToolworks.com Decision Analysis Add-ins for Excel "Basharat" <Basharat@discussions.microsoft.com> wrote in message news:D3D16E7A-1338-482F-845A-10C46814E61C@microsoft.com... > Hi everybod...

Setting Defaults for new customers?
Is there any easy way to set the defaults for a new customer? that way certain fields like sales tax are set or is there a way that you can make the item SALES TAX point to a default? JB Sales Tax can be done by walk-in customer tax setting "ParkRanger" <bfgpaintball.com> wrote in message news:%23sNBkLIaEHA.2488@tk2msftngp13.phx.gbl... > Is there any easy way to set the defaults for a new customer? > that way certain fields like sales tax are set > > or is there a way that you can make the item SALES TAX point to a default? > > JB > > M A C ...

Prevent Outlook from being default?
Hi All, I have a notebook computer that has a PocketPC synching to it. On this notebook, I installed Outlook to get to my corporate server for synching contacts, notes, etc. I use OE for all my email on this notebook, and after every sync Outlook takes over the default email program role. Is there a way to prevent Outlook from trying to become the default email program? Thanks in advance for any help! Jerry Jerry Dubuke <jdubuke@not.gpdservices.com> wrote: > Is there a way to prevent Outlook from trying to become the default > email program? Which version of Outlook? it is o...

Word 07
I would like to change my default for Word 2007 to Verdana, however, after I follow the steps as presented in "Help" to change the default, I find that when I open a new (blank) Word document it has always reverted to Calibri 12. What is the proper way to set a new default in Word so that I do not have to keep resetting the font for every document Thank you! ZinZen Open a blank document, go to the Format Font dialog box (that's achieved by pressing the miniscule arrow in the bottom right-hand corner of the Font Group on the Home Ribbon - you may need an elect...

Remove Default Picture Bullets
I want to delete several picture bullets I added to the Picture Bullets in Bullets and Numbering. How do I do that? Help Troy Chollar has a tutorial here which may help http://pptblog.tlccreative.com/index.php?s=picture+bullets&sentence=AND It didn't work for me probably because the bullets were added using a different method but it will probably work for you. I used Delete the source file for the picture bullet. Open the bullets > Picture Bullets dialog > Yellow X indicates unavailable Double click it and eventually it will give up and offer the option to ...

Add charachters in the Matrix attributes
Hello, When using New Item Wizard for Matrix items, it's using by default numbers (01, 02, and 03) for the items, is there any way to use characters instead; i.e. (re, s, w) …. What are the limitations? does it need development, or is there add on component can be used Ideas please. Salam Mohamed, You can accomplished this by following procedure: 1. Create Item Matrix and just create the Dimensions not any attribue it will be balnk this you can do so manually or by using item wizard. 2. Now A blank Item Matrix is created now you can click on item matrix and then click on its prop...

hyperlink default settings
Hi all When I type a hyperlink address into a cell the default setting is font size 10/underline etc. How can I change this? I am using OfficeXP (Excel2002?) Sorry if this has been asked before. MTIA Elwyn Try changing the Hyperlink style to the size font you want. Format|Style|choose hyperlink|click modify (Styles are a workbook level setting--you'll have to do this for each workbook you want.) elwyn wrote: > > Hi all > > When I type a hyperlink address into a cell the default setting is font size > 10/underline etc. How can I change this? I am using OfficeXP...

Worker's comp needs the ability like SUTA to exclude/include TSAs
Many clients request the ability to calculate Worker's Compensation wages to exclude all TSA's and then include particular TSA's. I would like to see the code changed and the window changed to be similar to the SUTA calculations and screens. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click &quo...

Lookups Enhancement GP 2010
Has anyone been able to get this new feature to work? I am looking to sort the Items Lookup window by Short Description and the save that as the Default View. I select "Set as Default View" but no checkmark appears next to it and the view is not saved. What am I missing? Thanks! Try these steps. 1. Create a SmartList favorite. 2. Do your item lookup and select Favorites then your SmartList favorite. 3. Save as default view. 4. Close the window and open it again. -- Charles Allen, MVP "Adriane" wrote: > Has anyone been able to get this ne...

Default Global Address list
Hi, I have just created some more address lists and would like these to be shown in outlook and not the Default Global Address list. How do I do it? Thanks this is a good resource for this. It is more than you need since you aren't creating multiple domain-based Address Books but it gives you the procedures for what rights to assign to what address books to get defaults changed etc http://support.microsoft.com/default.aspx?scid=kb;en-us;822940 "peter" <peter@discussions.microsoft.com> wrote in message news:0279B9BB-CD8D-4925-A3C6-0806821132EE@microsoft.com... > Hi...

How to get underlying Xslt content from XslTransform object
How do you get the underlying Xslt stylesheet content from an XslTransform object that has been created and loaded with a stylesheet file or some text? Assume a method will create an XslTransform object, load it with a stylesheet file or some text, and return this object. public XslTransform Create() { XslTransform xslt = new XslTransform(); xslt.Load("style.xsl"); //or load with some built-in stylesheet text return xslt; } In the calling method, how do you see the content of the underlying transform (the content of the file style.xsl or whatever text that was loaded to the object...

default FROM field
i am trying ot set a default name into the From field when replying to an e-mail, one person has done thi but i am not sure how they did it. help please ...

Sort Default
I have a very small and slightly annoying prob..... When I go to do a Sort ---- sometimes the Header Row box is marked but most of the time the No Header Row box is marked. What makes it go back and forth??? AND Is there a way to make Header Row the default????? I know in the grand scheme of things this is trivial....but I do this many times a day and would like for the default to always be Header. You guys and gals here are so knowledgable....I KNOW somebody can fill me in on this!! Thanks in advance!!!!!!!!!! This discussion group Rocks! If the header row sorta looks lik...

Changing Default Directory
How do you change the default directory for the library in WMP11. I am trying to clean out my main HDD and have the directory pointing to one of my other drives. This would allow me to keep the movies I have, off my boot drive, but still be able to view my movies and music through my PS3 and Xbox360. Any help would be appreciated! Add the new music/movies directory to WMP's list of monitored folders (press F3 in WMP). Then, while WMP is still running, use Windows Explorer to move the music/movie files to their new directories. WMP should notice the move and will update t...

Default Negative Number format across versions
Hi all The regional settings on both of two machines at home are set the same: negative numbers displayed in brackets (UK English region) On one machine (XL97, Windows 98) I select Number Format and negatives are prompted in brackets. If I transfer the workbook to the other machine (XL97, Win95) the negative numbers in workbook are preceded by minus-sign. If I select Number Format in this workbook the negative numbers prompted in the dialog box are also preceded with minus sign. I used to be content to live with this, but the problem is multiplying. Now we have had Citrix installed at the ...

XslCompiledTransform behaves differently than XslTransform
Hello. I'm in the midst of moving a web application from ASP.NET 1.1 to ASP.NET 2.0 (framework 3.0), and as part of this move, I am told by Visual Studio that the XslTransform object is now deprecated, and I should use XslCompiledTransform. For the most part changing to this object works fine, however I have noticed in some cases a difference of behavior that breaks the proper running of my app. I am using XSL templates to transform XML into HTML to be outputted to the browser, and in some of my templates I have HTML "script" tags, like so: <script ...></script> U...

unhide a forms attributes
I right clicked on one of my forms which I created in Microsoft Access and checked the "hide attribute box". I didn't know this would cause the form to disappear from my list and I would like to undo what I did, but I don't know how to go about doing it--can anyone help me? In Access 2003, go to Options, on the View tab, turn on the checkbox for Hidden objects and save. Now right click on the closed form in the database window, and in the dialog that opens, turn off the checkbox for attributes hidden Jeanette Cunningham "QtrCentury" <QtrCentury@discussio...

Exclude not placed in service assets.
Dear all, I need to exclude some assets from dep. not placed in service, I need to dep 79 asset and the remaining 32 I won`t .Is there is any option or shall I dep. all and restore place in service date for the needed. Select 'No Depreciation' as the Depreciation Method in the Asset Book. Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com get your GPtip42today at www.gp2themax.blogspot.com Thanks frank "Frank Hamelly, MCP-GP, MCT, MVP" wrote: > Select 'No Depreciation' as the Depreciation Method in the Asset ...