[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: remove blank xmlns
Hi Paul, > I am using asp to append to an existing xml file. I have set > resolveExternals = False . This seems to work fine as far as leaving > my xsl and schema references in place. My problem is that when > resolveExternals = False, a blank namespace call is inserted. How > can I stop this from showing up? or remove it from asp? Here is an > example of what is happening: It looks as though the ASP is appending elements in no namespace rather than appending them in the x-schema:sortProjects-schema.xml namespace that the elements in your original source document are in. The best solution would be to adjust the ASP code so that it adds the elements in the correct namespace. You need to create all the elements with something like: document.createNode(1, 'project', 'x-schema:sortProjects-schema.xml'); If you can't change the ASP code, then you could use a transformation in a stylesheet that creates equivalent elements in the 'x-schema:sortProjects-schema.xml' namespace whenever it comes across one in no namespace (and copies anything already in the 'x-schema:sortProjects-schema.xml' namespace directly). This stylesheet looks something like: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="ns" select="'http:x-schema:sortProjects-schema.xml'" /> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> <xsl:template match="*[not(namespace-uri())]"> <xsl:element name="{local-name()}" namespace="{$ns}"> <xsl:apply-templates select="@*|node()" /> </xsl:element> </xsl:template> </xsl:stylesheet> I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|