Subject: Re: [xsl] exclude result prefixes doesn't stop prefix from showing up. From: "Mark R. Diggory" <mdiggory@xxxxxxxxxxxxxxxxx> Date: Fri, 22 Aug 2003 13:18:36 -0400 |
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.icpsr.umich.edu/DDI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="codeBook"> <xsl:copy> <xsl:apply-templates select="@*"/> <docDscr> ... <titl> <xsl:value-of select="stdyDscr/citation/titlStmt/titl"/> </titl> ... </docDscr> <xsl:apply-templates select="*"/> </xsl:copy> </xsl:template>
... </xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?> <codeBook xmlns="http://www.icpsr.umich.edu/DDI" > <stdyDscr> <citation> <titlStmt> <titl>foo</titl> </titleStmt> </citation> </stdyDscr> </codeBook>
I thought to myself, there should be some way I can match the default namespace in the source document?
there is nothing special about the default namespace just think of it as having prefix "" with a special syntax trick that if teh prefix is "" you don't use a colon.
Xpath is essentially blind to the prefixes used in the source, it doesn't matter if it is <x:foo> or <b:foo> or <foo> so long as in each case it is foo in the same namespace you always use the same Xpath to select the element.
David
________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] exclude result prefixes d, David Carlisle | Thread | RE: [xsl] exclude result prefixes d, Michael Kay |
Re: [xsl] exclude result prefixes d, Mark R. Diggory | Date | Re: AW: [xsl] exclude result prefix, Mark R. Diggory |
Month |