xsl-list
[Top] [All Lists]

RE: xmlns="" ??

2004-04-30 05:55:16

Hi

I'm not sure about his, but is there some quick way of excluding a namespace
from output?

The code below has two issues:
        1. with exclude-result-prefixes, it nevertheless outputs namespace
declarations for 'LOCAL'.
                The '5.6.3 namespace fixup' thing?
        2. content Not in the default namespace is still output.
                I've played around with various approaches but haven't hit
on anything other than yet another identity transform that'll weed out the
temporary stuff...

any suggestions appreciated.

john

----------------------------------------------------------------------------
------

output: with "   exclude-result-prefixes="#all">"

<?xml version="1.0" encoding="UTF-8"?>
<html>
   <body>
        <a href="." LOCAL:wotsit="not_for_output"
xmlns:LOCAL="http://localhost/test";>link</a>
        <LOCAL:thing xmlns:LOCAL="http://localhost/test";>
                this shouldn't be output
        </LOCAL:thing>
   </body>
</html>

----------------------------------------------------------------------------
------

output: without "   exclude-result-prefixes="#all">"

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:LOCAL="http://localhost/test";
xmlns:xhtml="http://www.w3.org/1999/xhtml";>
   <body>
        <a href="." LOCAL:wotsit="not_for_output">link</a>
        <LOCAL:thing>
                this shouldn't be output
        </LOCAL:thing>
   </body>
</html>
----------------------------------------------------------------------------
------

<xsl:stylesheet version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
   xmlns:LOCAL="http://localhost/test";
   xmlns="http://www.w3.org/1999/xhtml";
   exclude-result-prefixes="#all">

   <xsl:output method="xhtml" indent="yes"/>
   <xsl:template match="/">
      <xsl:variable name="fragment">
         <html>
            <body>
               <a href="." LOCAL:wotsit="not_for_output">link</a>
               <LOCAL:thing>this shouldn't be output</LOCAL:thing>
            </body>
         </html>
      </xsl:variable>

      <xsl:message>
         <!-- want to see 'LOCAL:' here -->
         <xsl:copy-of select="$fragment"/>
      </xsl:message>

      <!-- don't want to output 'LOCAL:' -->
      <xsl:copy-of select="$fragment"/>

   </xsl:template>
</xsl:stylesheet>

----------------------------------------------------------------------------
------


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>