XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Namespaces, Name With Spaces, and Attribute Values
Subject: How do I ignore elements or attributes in a particular namespace?
Date: 2003-10-22 13:25:09
From: Salvatore Mangano

The following is certainly a better way to filter out a namespace while copying.


-Sal Mangano


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="a" xmlns:b="b" exclude-result-prefixes="b">


<xsl:output method="xml" indent="yes"/>


<xsl:template match="@* | a:*">
<xsl:copy>
<xsl:apply-templates select="@* | a:*"/>
</xsl:copy>
</xsl:template>


<xsl:template match="@b:*" priority="10"/>


</xsl:stylesheet>


No Previous Message Previous Message   Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938