RE: [xsl] adding namespaces to result nodes

Subject: RE: [xsl] adding namespaces to result nodes
From: omprakash.v@xxxxxxxxxxxxx
Date: Fri, 8 Apr 2005 16:44:44 +0530
Hi Mike,
         Iam taking the text of an element in the input file and making it
into an element. The element in question is named 'slideshow' and it
doesn't have a prefix. You say
"the processor may put the element in the default namespace, or it may
invent a prefix"
Does this mean the processor Iam using (xalan) is adding the prefix whereas
another processor may not.

Iam not tied to any processor and I may opt for another processor if this
is the case other things permitting.

Also you suggested a workaround using xsl:copy-of in your earlier mail.
Will this prevent the prefixes from getting added.

Also, I would like to know how to add another namespace say for eg the
schema namespace to an element created in the default namespace.

Cheers,
Omprakash.V















                                                                                                                   
                    "Michael Kay"                                                                                  
                    <mike@saxonic        To:     <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>                                 
                    a.com>               cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:     RE: [xsl] adding namespaces to result nodes                  
                    04/08/2005                                                                                     
                    04:22 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   




> <xsl:element name="{$elemname}" namespace="{$nsname}">
>
>
> As you can see the inverse transformed output has prefixes where my
> original had none. Also, the prefixes are numbered like ns0,
> ns1 etc. which
> I don't think is not correct.

You haven't said what the value of $elemname is. If it includes a prefix,
then most XSLT 1.0 processors will attempt to use that prefix, thought they
aren't obliged to do so. If it doesn't include a prefix, then the processor
may put the element in the default namespace, or it may invent a prefix.

Michael Kay
http://www.saxonica.com/






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