XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2016)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
N K N KSubject: not able to set namespace defenition
Author: N K N K
Date: 03 Nov 2009 12:41 AM
Style sheet template as follows ,

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


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"


xmlns:com="com.ekaplus.commons.document"


xmlns:sql="java:/net.sf.saxon.sql.SQLElementFactory"

xmlns:rfc="urn:sap-com:document:sap:rfc:functions"
xmlns:not="http://www.ekaplus.com/NotifyEvent/"


xmlns:java="http://saxon.sf.net/java-type"
xmlns:saxon="http://saxon.sf.net/" extension-element-prefixes="saxon"

exclude-result-prefixes="java,com" version="1.0">




<xsl:template name="main" match="/">

<xsl:variable name="err_doc">

<xsl:element name="GenericDocument"
namespace="com.ekaplus.commons.document">
<xsl:attribute name="document_Id">
<xsl:value-of select="'ERROR_DOC'"/>
</xsl:attribute>

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


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


<xsl:element name="PropertyData"
namespace="com.ekaplus.commons.document">
<xsl:element name="PropertyData"
namespace="com.ekaplus.commons.document">
<xsl:attribute name="pkey">
<xsl:value-of select="'Status'"/>
</xsl:attribute>
<xsl:attribute name="pvalue">
<xsl:value-of select="'FAILED'"/>
</xsl:attribute>



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

</xsl:element>
</xsl:element>
</xsl:element>

</xsl:variable>

<xsl:copy-of select="$err_doc"/>




</xsl:template>

<xsl:template name="applyTemplateForError">



<xsl:variable name="ret">

<xsl:if test="rfc:Z_BAPI_BANK_CUSTOMER_VENDOR/INPUT_BUPA/NAME_1
= ''">

<xsl:element name="PropertyData"
namespace="com.ekaplus.commons.document">
<xsl:attribute name="pkey">
<xsl:value-of select="'Message'"/>
</xsl:attribute>
<xsl:attribute name="pvalue">
<xsl:value-of select="'ERR_CP_001'"/>
</xsl:attribute>
<xsl:element name="PropertyData"
namespace="com.ekaplus.commons.document">
<xsl:attribute name="pkey">
<xsl:value-of select="'MessageDescr'"/>
</xsl:attribute>
<xsl:attribute name="pvalue">
<xsl:value-of select="'NAME_1 is missing in
source document'"/>
</xsl:attribute>
</xsl:element>
</xsl:element>


</xsl:if>


</xsl:variable>
<xsl:copy-of select="$ret"/>

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

result as follows

<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>

I use style studio 2007 XML proferssional version release 2
Any input on this?

Regards
Brijesh N K

Posttop
(Deleted User) Subject: not able to set namespace defenition
Author: (Deleted User)
Date: 03 Nov 2009 09:50 AM
Hi Brijesh,
how are you displaying the result? For instance, if you are using Firefox, the stylesheet it uses for displaying XML data will strip any namespace declaration.
From what I see, running your stylesheet with Saxon under Stylus Studio 2007 will generate the proper namespace definition.

Hope this helps,
Alberto

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.