Subject: [xsl] Matching namespaces - one works, one doesn't ? From: "Kerry, Richard" <richard.kerry@xxxxxxxxxxx> Date: Thu, 29 Nov 2007 11:22:39 -0000 |
Can anyone point me at what I might be doing wrong. I am using an identity template with matches to copy this some xml but remove certain attributes. I'm having trouble dealing with a couple of attributes that have namespaces. My source xml includes an element as follows : <slots xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generic_snmp_slots.xsd"> Using this XSL template : <xsl:template match="@*[local-name()='noNamespaceSchemaLocation']" /> successfully removes the xsi:noNamespaceSchemaLocation attribute. Ie the result is <slots xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> However, if I have <xsl:template match="@*[local-name()='xsi']" /> It has no effect on the xmlns:xsi attribute, which remains in the output. I've also tried <xsl:template match="@xsi" /> Also with no effect. Looking at the Namespaces page on D Pawson's XSL FAQ I tried adding xmlns:mytest="http://www.test.org" To the xsl:stylesheet element and using <xsl:template match="@mytest:xsi" /> As the match. This also has no effect, the xmlns:xsi attribute remains in the output. I may well be failing to understand something about namespaces. Is the xmlns namespace perhaps handled differently ? Can anyone tell me what I'm doing wrong or advise a solution ? Richard Kerry Colledia Control Engineer Siemens IT Solutions and Services Ltd Room 457 Design Building, BBC Television Centre, Wood Lane, London, W12 7RJ T: +44 (0)20 82259063 F: +44 (0)20 8576 8182 M: +44 (0)7921 244993 Email: richard.kerry@xxxxxxxxxxx <blocked::mailto:richard.kerry@xxxxxxxxxxx> Website: www.siemens.co.uk/it-solutions <blocked::outbind://47/www.siemens.co.uk/it-solutions> This e-mail contains confidential information and is for the exclusive use of the addressee/s. If you are not the addressee, then any distribution, copying or use of this e-mail is prohibited. If received in error, please advise the sender and delete it immediately. We accept no liability for any loss or damage suffered by any person arising from use of this e-mail. Siemens IT Solutions and Services Limited Registered No: 1203466 England Registered Office: Faraday House, Sir William Siemens Square, Frimley, Camberley, GU16 8QD
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] include error, Scott Trenda | Thread | RE: [xsl] Matching namespaces - one, Michael Kay |
RE: [xsl] Problem with version of X, Owen Rees | Date | RE: [xsl] Matching namespaces - one, Michael Kay |
Month |