[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: AW: exclude result prefixes doesn't stop prefix fr

Subject: Re: AW: exclude result prefixes doesn't stop prefix from showingup.
From: "Mark R. Diggory" <mdiggory@xxxxxxxxxxxxxxxxx>
Date: Fri, 22 Aug 2003 11:40:54 -0400
exclude results prefixes
Yes, that "double use" of the namespace was a bit of a hack, see my comments back to Michael concerning the default namespace.

And, I did review the following FAQ for matching nodes in the default namespace.

http://www.dpawson.co.uk/xsl/sect2/N5536.html#d5145e970

I thought I could use this with the <xsl:namespace-alias ... tag. but again this does something I don't want and actually generates the results document with the ddi: prefix on all my added elements

<?xml version="1.0" encoding="utf-8"?>
<codeBook xmlns="http://www.icpsr.umich.edu/DDI">
    <ddi:docDscr xmlns:ddi="http://www.icpsr.umich.edu/DDI">
        <ddi:citation>
            ...
        </ddi:citation>
    </ddi:docDscr>
    <stdyDscr>
        <citation>
            <titlStmt>
                <titl>Foo bar</titl>
            </titlStmt>
        </citation>
    </stdyDscr>
</codeBook>

thanks,
Mark

Markus Abt wrote:

Hi Mark,

you have two namespace nodes with the URI "http://www.icpsr.umich.edu/DDI".
The element <docDscr> uses "http://www.icpsr.umich.edu/DDI". You can't
control which namespace nodes for "http://www.icpsr.umich.edu/DDI"
go to the output (only the correctness of the output is guaranteed).

Look at http://www.dpawson.co.uk/xsl/sect2/N5536.html#d5145e334:
"However, Saxon outputs both: it retains any namespace node for a namespace
that is actually in use. There is nothing in the spec to prohibit this, in fact there is
nothing to stop arbitrary namespace declarations being invented at the serialization stage."


Regards, Markus __________________________ Markus Abt Comet Computer GmbH http://www.comet.de


---------- Von: Mark R. Diggory Gesendet: Freitag, 22. August 2003 00:09 An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Betreff: exclude result prefixes doesn't stop prefix from showing up.

I have a stylesheet that copies an xml document with a default namespace while it also is adding some content to it:

*The stylesheet*

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

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

<xsl:template match="ddi:codeBook">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<docDscr>
<citation>
<titlStmt>
<titl>
<xsl:value-of select="ddi:stdyDscr/ddi:citation/ddi:titlStmt/ddi:titl"/>
</titl>
</titlStmt>
</citation>
</docDscr>
<xsl:apply-templates select="*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>


*The xml document*

<?xml version="1.0" encoding="utf-8"?>
<codeBook xmlns="http://www.icpsr.umich.edu/DDI" >
	<stdyDscr> ....


*the resulting xml document*



<?xml version="1.0" encoding="utf-8"?> <codeBook xmlns="http://www.icpsr.umich.edu/DDI"> <docDscr xmlns:ddi="http://www.icpsr.umich.edu/DDI"> <citation> ... </citation> </docDscr> <stdyDscr> <citation> <titlStmt> <titl>Foo bar</titl> </titlStmt> </citation> </stdyDscr> </codeBook>

My problem is that I'm getting an extra xmlns:ddi="http://www.icpsr.umich.edu/DDI" in the docDscr element even though I'm suppressing it in the excludes. Is there any way I can stop this from happening?

-Mark Diggory
Harvard MIT Data Center



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.