David, thanks for the response ,
below is output document after transformation ,
you can see that com prefix is added(<com:GenericDocument) , but defenition is missing , but style sheet has defenition  as
output document:
<com:GenericDocument document_Id="ERROR_DOC" description="Error document after validation" name="Error response document" created_date="2009-10-26"><com:PropertyData><com:PropertyData pkey="Status" pvalue="FAILED"><com:PropertyData pkey="Message" pvalue="ERR_CP_001"><com:PropertyData pkey="MessageDescr" pvalue="NAME_1 is missing in source document"/></com:PropertyData></com:PropertyData></com:PropertyData></com:GenericDocument>
Brijesh N K

On Tue, Nov 3, 2009 at 12:43 PM, David Carlisle <davidc@nag.co.uk> wrote:

> When I print the content of err_doc variable , I get the documetn without
> namespace declaration(though namespace prefix(com) is added without
> declarion) , as follows

unless you use disable-output-escaping or character maps you should
never get output that is not namespace well formed unless there is a bug
 what do you mean by "print" is the com prefix already in scope in the
output document for example?

you still appear to be using saxon:assign and  very verbose style which
makes it very hard to read the stylesheet.

       <xsl:variable name="err_doc">

- Show quoted text -
           <xsl:element name="GenericDocument"
               <xsl:attribute name="document_Id">
                   <xsl:value-of select="'ERROR_DOC'"/>

               <xsl:attribute name="description">
                   <xsl:value-of select="'Error document after

               <xsl:attribute name="name">
                   <xsl:value-of select="'Error response document'"/>
               <xsl:attribute name="created_date">
                   <xsl:value-of select="'2009-10-26'"/>

               <xsl:element name="PropertyData"
                   <xsl:element name="PropertyData"
                       <xsl:attribute name="pkey">
                           <xsl:value-of select="'Status'"/>
                       <xsl:attribute name="pvalue">
                           <xsl:value-of select="'FAILED'"/>

                       <xsl:call-template name="applyTemplateForError"/>


could be

       <xsl:variable name="err_doc" xmlns="com.ekaplus.commons.document">

- Show quoted text -
           <GenericDocument  document_Id="ERROR_DOC
                             description="Error document after validation"
                             name="Error response document"/
                    <PropertyData pkey="Status" pvalue="FAILED">
                       <xsl:call-template name="applyTemplateForError"/>

which is rather easier to read/debug.

> I am afraid , this is more of xslt specific question than saxon , i
> apologise for that

xsl-list is better for general xsl-questions.


The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.

Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
saxon-help mailing list archived at http://saxon.markmail.org/