Re: [xsl] namespace-alias question

Subject: Re: [xsl] namespace-alias question
From: omprakash.v@xxxxxxxxxxxxx
Date: Tue, 18 Jan 2005 17:19:18 +0530
Hi,
    Thanks for the help. I could get started with the transformation. But
the stylesheet outputted still has only the alias I gave and not 'xsl'.
I think the namespace-alias hasn't worked.

I gave the alias:

<xsl:namespace-alias stylesheet-prefix="x" result-prefix="xsl"/>

and I got:

<?xml version = '1.0' encoding = 'UTF-8'?>
<x:stylesheet version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:x="http://www.w3.org/1999/XSL/Transform";>
   <x:template xmlns:x="http://www.w3.org"; match="person">
      <x:param name="root">/person</x:param> ...

Also, it works only with oracle xml parser v2 and not with xalan.

And with oraclexmlparserv2, the xsl outut contains non-printable characters
like as follows:

 </xsl:template>

<several small  rectangular boxes here>
</x:stylesheet>



Also for any tags I create using xsl:element, it is outputting the
namespace along with the tag. Also, the schema namespace I have declared in
the source xsl is also passed to the output which I dont want.

I suppose ways exist to suppress these extra namespaces getting generated.
I would appreciate a solution for the non-printable characters and the
namespace-alias problem.

I have to mention Iam using an unknown version of xalan. The oracle parser
appears to be current.

Regards,
Omprakash.V



                                                                                                                   
                    David                                                                                          
                    Carlisle             To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    <davidc@xxxxx        cc:     (bcc: omprakash.v/Polaris)                                        
                    o.uk>                Subject:     Re: [xsl] namespace-alias question                           
                                                                                                                   
                    01/17/2005                                                                                     
                    08:10 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   





  <x:text disable-output-escaping="yes">

You don't want to use disable-output-escaping here (you almost never
want to use that).

  Here Iam using x to prefix my stylesheet while using xsl to prefix the
  stylesheet being outputted


No, you have that backwards.



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:x
="http://tempuri";
xmlns:xsd="http://www.omprakashv.org"; version="1.0">

Here you have defined the prefix xsl  to be
http://www.w3.org/1999/XSL/Transform
so you must use xsl: as the prefix for all teh instructions that you
want to execute such as this xsl:stylesheet element and also
namespace-alias.
You want to say that the x: prefix is an alias for XSLT so that should
be


<xsl:namespace-alias stylesheet-prefix="x" result-prefix="xsl"/>


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread