XSL + Namespace JavaBean

Hi,
Can any one help me how to create an object for my Java class that which i included in my xsl file.
Note: We can add our java file in namespace such as
xmlns:myjava = "G://Tomcat5.0/webapps/test/WEB-INF/classes/bean"
I had given the setter and getter method as static in my bean Class so that i can easily call my method from xsl file. But it doesnot support mulitiple threading. So like to reamove the statiic from setter and gettermehtod of my bean class. and i have to access it in my XSL. by creating an object. So that i can able to access therough obj.getMethod(). Please help me.
Is it possible to create object in XML file for any Java Class.

Not sure what you are trying to do. Maybe extend xslt? Probably a better place to find answers is www.mulberrytech.com and their mailing list , [email protected]

Similar Messages

  • XSL namespace

    Hi,
    I want to add xmlns:xsi="http://www.sap.com" to a root element in XSL mapping.we can add the namepsacee directly in the element tag but i want to pass the xmlns:xsi and the URL in the xsl code
    for exmaple
    <root xmlns:xsi="http://www.sap.com">
    <seg1>
    <seg2>            
    </seg3>
    </root>
    Thanks in advance for you help.
    Regards
    Sarkar.

    Hi santosh ,
    thanks for your reply. your code is adding me only the namespace. I am looking the output as below.
    <root xsi:schemaLocation="http://www.sap.com" xmlns:xsi="http://www.w3.org" xmlns="http://www.sdn.sap.com" att="1.1">
    <seg1> </seg1>
    <segn> </segn>
    </root>
    with the namespace parameter I can get this xmlns="http://www.sdn.sap.com", along with that I also want to add other two names as shown above and most importantly the segment data should be populate as is.
    please let me know if you have any pointers.
    Regards
    Sarkar

  • How does XSQL xsl namespace resolution work

    I don't believe I'm getting correct results
    from the xsql helloworld.xsql demo
    I get a result but it is not formatted.
    I think it has to do with:
    <xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql">
    Where does the URN get resolved and what does it resolve to? MS IE5 just shows a bunch of XML rather than a nicely formatted:
    "Hello World"
    which makes me believe that the XSL transform is not happening.

    Oh, so it is appropriate behavior... Thanks Steve
    I still need to better understand xmlns and what the
    xmlns:xsl="urn:oracle-xsql"
    does and how I can examine it and other namespaces (ie look at the source) and understand how to apply it and create my own URN (do I need to do this?). I'm not finding any real clear documentation on xmlns that serves as a tutorial (e.g. this urn "source" looks like this, and these statements do that, and when you specify this namespace, these things happen).
    Specifically, where does urn:oracle-xsql point? To a network resource? To a local file? To a resource that is "embedded" in XSLT? How do I examine and interpret that resource?

  • XPath expression to element with xsl: namespace

    Hi,
    I have a problem selecting a node in an XSL document. What I'm trying to do is to load an XSL file and change the 'select' attribute of <xsl:for-each select='//whatever'>
    I tried it something like this:
    Node articleSelect = XPathAPI.selectSingleNode(xslDOM, "//for-each");
    articleSelect.getAttributes().getNamedItem("select").setNodeValue("//article[@ArticleNr='" + articleNumber + "']");However, articleSelect is always null so the second line throws an exception. I also tried "//xsl:for-each" and "//xsl:for-each[@select='//whatever']" and whatnot as the XPath expression, but still no luck... :(
    Any thoughts or ideas will be greatly appreciated :)
    Greetings,
    Erik

    Erik, your code is working fine but you must ensure that the document builder used to create xslDOM has nameSpaceAware = true!
    May I suggest this rewriting - not necessary - but more clear I think:
    Element articleSelect = (Element) XPathAPI.selectSingleNode(xslDOM, "//xsl:for-each");
    articleSelect.setAttribute("select", "//article[@ArticleNr='" + articleNumber + "']");

  • XPath expression to element with xsl: namespace  - Take 2

    I posted the below question earlier today. Unfortunately, it seemed to have disappeared from the forum although it still is in my watches list ~:-/
    Anyways, here it goes:
    Hi,
    I have a problem selecting a node in an XSL document. What I'm trying to do is to load an XSL file and change the 'select' attribute of <xsl:for-each select='//whatever'>
    I tried it something like this:
    Node articleSelect = XPathAPI.selectSingleNode(xslDOM, "//for-each");articleSelect.getAttributes().getNamedItem("select").setNodeValue("//article[@ArticleNr='" + articleNumber + "']");
    However, articleSelect is always null so the second line throws an exception. I also tried "//xsl:for-each" and "//xsl:for-each[@select='//whatever']" and whatnot as the XPath expression, but still no luck... :(
    Any thoughts or ideas will be greatly appreciated :)
    Greetings,
    Erik

    Never mind... the original post misteriously re-appeared :-)

  • Xsl transformation from version1 to version2, problem with namespaces

    Guys!
    In my current project we need to have an interface in Oracle ESB which is build on lets say a wsdl version1 and an interface build on wsdl version2.
    In esb i need to define a transformation which will transform the request on version1 to version2. Because the xsd for the operation is really huge (+1000 items) i made some templates in xsl to do most of the work, works great..only i'm having a few issues now.
    To re-order items from source to target i do the next in a template
    <nameGroep>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    </nameGroep>The only problem from the xsl:copy-of is, it also copies the namespace along. So if my target document uses an other namespace, it fails.
    To correct this i hoped i could make use of <xsl:namespace-alias> but this doesn't work on a literal/text tag (hope i explain this correct).
    Other option is, for every element do something like
    [code[
    <elementname>
    <xsl:value-of select=""/>
    </elementname>
    but this will create the <elementname> always in the target whether or not it's in the source. You could do a check to see if it's in the source, but this isn't a solution because then i need to check for every 1000+ item in the source document, so..we skip this idea.
    So i reach a point where im still searching for a good solution and hoped you guys could help me a bit with it.
    If the problem isn't explain well please say so, and i will add extra info.

    Guys!
    In my current project we need to have an interface in Oracle ESB which is build on lets say a wsdl version1 and an interface build on wsdl version2.
    In esb i need to define a transformation which will transform the request on version1 to version2. Because the xsd for the operation is really huge (+1000 items) i made some templates in xsl to do most of the work, works great..only i'm having a few issues now.
    To re-order items from source to target i do the next in a template
    <nameGroep>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    <xsl:copy-of select="andhere the xpath from source"/>
    </nameGroep>The only problem from the xsl:copy-of is, it also copies the namespace along. So if my target document uses an other namespace, it fails.
    To correct this i hoped i could make use of <xsl:namespace-alias> but this doesn't work on a literal/text tag (hope i explain this correct).
    Other option is, for every element do something like
    [code[
    <elementname>
    <xsl:value-of select=""/>
    </elementname>
    but this will create the <elementname> always in the target whether or not it's in the source. You could do a check to see if it's in the source, but this isn't a solution because then i need to check for every 1000+ item in the source document, so..we skip this idea.
    So i reach a point where im still searching for a good solution and hoped you guys could help me a bit with it.
    If the problem isn't explain well please say so, and i will add extra info.

  • XML/XSLT: Setting xsl:include href attribute with a variable

    I have a main layout stylesheet and depending on which page the user selects I want to use xsl:include to display the selected information in the 'content' DIV. The process works fine if hardcode it like this:
    <xsl:include href="welcome.xsl"/>
    <div id="content"
    <xsl:call-template name="welcome"/>
    </div>
    but, what I would like to do is have the name of the included template pulled from the xml file depending on which page was selected by the user. Something similar to this:
    <xsl:variable name="ss">
    <xsl:text><xsl:value-of select="root/stylesheet"/></xsl:text>
    </xsl:variable>
    <xsl:include href="{$ss}.xsl"/>
    <div id="content">
    <xsl:apply-template name="{$ss}"/>
    </div>
    So far I have tried using many different forms of code and have been unable to get this to work. Any ideas?
    EDIT: Okay, I have it partly figured out, at least why it isn't working. As far as I can tell, the 'xsl:include' tag must be a child of the 'xsl:stylesheet' tag, and is thus declared before the <xsl:template match="/"> which means it can't read the xml element to even store it in the variable. I have an idea of how to accomplish what I need, though.
    Last edited by munkyeetr (2009-01-28 03:29:58)

    I have attempted the same thing before as well. The only way I was able to dynamically build the xsl:include was to declare a new namespace e.g xmlns:out="output.xsl" in my XSL file and do something like the following:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="output.xsl">
    <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
    <xsl:varible name="xxx" select=" 'myFile.xsl' "/>
    <xsl:template match="/">
    <out:stylesheet version="1.0">
    <out:template match="/">
    <out:include>
    <xsl:attribute name="href">
    <xsl:value-of select="$xxx" />
    </xsl:attribute>
    </out:include>
    </out:template>
    </out:stylesheet>
    </xsl:template>
    </xsl:stylesheet>
    When applied to any valid XML document this produces the XSL file you are after as the output.
    To use this output against your intended XML source consider the following: A Java program can very quickly apply the above stylesheet to any XML source to get the output you want... then apply that XSL result to the actual XML document you are wanting to transform. From here you can do what you want with the transformed result.

  • XSL using Instant Saxon

    I am using oracle 8.1.7 database on windows2000 advanced server.I am using Instant saxon in order to transform XML documents into new XML documents.I am providing the Instant Saxon with the source XML document and XSL document.Its output in the IE6.0 is just fine like this:
    <?xml version="1.0" encoding="utf-8" ?>
    <WRATE_INDICATORS>
    <mappings>
    <RIND_CURR_CODE_1>119</RIND_CURR_CODE_1>
    <RIND_CURR_CODE_2>131</RIND_CURR_CODE_2>
    <RIND_INDICATOR>1</RIND_INDICATOR>
    </mappings>
    <mappings>
    <RIND_CURR_CODE_1>119</RIND_CURR_CODE_1>
    <RIND_CURR_CODE_2>136</RIND_CURR_CODE_2>
    <RIND_INDICATOR>1</RIND_INDICATOR>
    </mappings>
    </WRATE_INDICATORS>
    But when i press view->source to see it in text file i get the following output:
    <?xml version="1.0" encoding="utf-8"?><WRATE_INDICATORS><mappings><RIND_CURR_CODE_1>119</RIND_CURR_CODE_1><RIND_CURR_CODE_2>131</RIND_CURR_CODE_2><RIND_INDICATOR>1</RIND_INDICATOR></mappings><mappings><RIND_CURR_CODE_1>119</RIND_CURR_CODE_1><RIND_CURR_CODE_2>136</RIND_CURR_CODE_2><RIND_INDICATOR>1</RIND_INDICATOR></mappings></WRATE_INDICATORS>
    Does the instant Saxon always do that??...Is there a way or maybe another processor in order to get the output in text file the same as IE6.0. Can i generate the file without the (encoding="utf-8") in the beginning of the file?
    Thanks a lot...

    There is no rule that says that the "http://www.w3.org/1999/XSL/Transform" namespace must use the prefix "xsl". Any prefix will work just as well, as you found out. It's just a convention that makes it easier for people to work with XSLT.
    As for why the xsl:namespace-alias element isn't working the way you (and I) think it should, there are two possibilites: (1) it's a bug in Xalan (2) we are misunderstanding it.

  • XMLTYPE.Transform()  issue with namespace-alias

    I have an XSLT that uses the namespace-alias. When i use the XMLTYPE.Transform() funtion in oracle it disregards the alias and outputs the stylesheet prefix rather than outputting result prefix
    Eg:
    The XSLT has the follwing lines:
    xmlns:wxsl="http://www.w3schools.com/w3style.xsl"
    xmlns:wxmlns="http://temp.xmlns"
    <xsl:namespace-alias stylesheet-prefix="wxsl" result-prefix="xsl"/>
    <xsl:namespace-alias stylesheet-prefix="wxmlns" result-prefix="xmlns"/>
    <wxsl:element name="my:myFields">
    </wxsl:element>
    The would output the following XML:
    <wxsl:element name="my:myFields">
    </wxsl:element>
    Its just doen't uses the result prefix.
    Is this a bug in oracle XMLTYPE.Transform function ?

    Please provide a small working example of an XML and XSLT that demonstrates what you have described. Also include your version of Oracle (4 digits i.e. 10.2.0.4). It is easier when others don't have to guess at what you have coded. As a general posting note, see the FAQ in the upper right for how to use the tag to wrap code/SQL/etc to retain formatting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Xsl:include, dynamic href attribute

    Is it possible to use a xsl parameter or variable for the href attribute of xsl:include ?
    I tried
    <xsl:param name="xxx" />
    and then <xsl:include href="{$xxx}"/>
    or even
    <xsl:include>
    <xsl:attribute name="href">
    <xsl:value-of select="$xxx" />
    </xsl:attribute>
    </xsl:include>
    None of this works (I haven't tried with other xslt processors than Oracle).
    Any suggestions ?
    null

    I have attempted the same thing before as well. The only way I was able to dynamically build the xsl:include was to declare a new namespace e.g xmlns:out="output.xsl" in my XSL file and do something like the following:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="output.xsl">
    <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
    <xsl:varible name="xxx" select=" 'myFile.xsl' "/>
    <xsl:template match="/">
    <out:stylesheet version="1.0">
    <out:template match="/">
    <out:include>
    <xsl:attribute name="href">
    <xsl:value-of select="$xxx" />
    </xsl:attribute>
    </out:include>
    </out:template>
    </out:stylesheet>
    </xsl:template>
    </xsl:stylesheet>
    When applied to any valid XML document this produces the XSL file you are after as the output.
    To use this output against your intended XML source consider the following: A Java program can very quickly apply the above stylesheet to any XML source to get the output you want... then apply that XSL result to the actual XML document you are wanting to transform. From here you can do what you want with the transformed result.

  • Tool for creating xsl for .xsql

    I am looking for tool that will give me the
    default code for xsl base on a .xsql file as imput.
    What I am looking for is a xsl designer.
    null

    If you are doing HTML you can just start with a well-formed HTML file and:
    (1) Add the xsl namespace to the top element,
    (2) Add in <xsl:for-each> tags where you
    need to loop
    (3) Add in <xsl:value-of> tags where
    you want to plug-in values.
    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform xsl:version="1.0">
    <body>
    <xsl:for-each select="ROWSET/ROW">
    <tr>
    <td><xsl:value-of select="ENAME"/></td>
    <td><xsl:value-of select="SAL"/></td>
    </tr>
    </xsl:for-each>
    </body>
    </html>
    That's it. We don't yet offer an XSL visual editor.
    null

  • Transformation - exclude-result-prefixes   doesn't prevent prefix 'xsl'

    Hi all fellow sufferers.
    I am generating an xsl document (yes, xsl) and to do that I do the following create element :
    <xsl:element name="xsl:value-of">
            <xsl:attribute name="select"><xsl:value-of select="$varval"/></xsl:attribute>
    </xsl:element>which basically works, however it does leave behind this damn prefix all through the generated xsl code, eg
    <p class="P1">
        <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="/PatientRecord/Demographics/name/@label"/>
    </p>Thing is, I am using the exclude-result-prefixes directive in the stylesheet tag, .... (although, to be honest, I was surprised I would have this problem in just creating an xsl:value-of node!!)
    Is there something else I should be doing to prevent this? Why is the annoying prefix being generated anyway! ?
    please? someone?
    thanks!

    Hi,
    Yes, I agree that my knowledge is probably inadequate. However, I can't help but wonder if I am not being misunderstood!
    Let me explain one more time... (before I go off and by a good book.).
    First, in the XSL document DOING the transformation, I had this tag at the root.
    <xsl:stylesheet version="1.0"      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">As you can see, this is correctly declaring the namespace, xsl.
    If then I try to generate a xsl tag using this XSL document, I get what I have previously shown you.
    <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="/PatientRecord/Demographics/insurance"/>It was only when I first tried this and got those annoying (though perfectly legal) xmlns:xsl="http://www.w3.org/1999/XSL/Transform" attributes in the end result of my xsl:value-of tags, that I started playing around with the exclude-result-prefixes directive.
    Now, I agree that I am getting well-formed XML, but yes, I don't want the bulk of the extra redundant attributes in my end result.
    Surely there must be a way to generate XSL tags without them including these xmlns:xsl attributes? As the end document WILL have the xsl namespace declared!
    Is there a way to declare a namespace for the result document perhaps?
    The transforming XSL document already has one.
    Thanks for your help.

  • Invalid tag generated in result XML file, xslt mapping done using MAPFORCE

    HI
    My requirement is File to File using xslt mapping
    I have done a very simple XSLT mapping, but through MAPFORCE tool
    Here are the steps, I followed:
    1. Supplied source xsd and xml file to MAPFORCE
    2. Supplied target xsd file
    3. mapped it as required
    4. tested by supplying a sample xml file by clicking OUTPUT button, which displays perfect XML structure
    5. Clicked XSLT button and copied and created a new file with extension .xsl file
    6. Zipped the above xsl file
    7. imported into IR imported archives folder
    8. Selected the above xslt mapping in my Interface mapping.
    9. Now tested my Interface Mapping by supplying sample some data for the source structure.
    Now I got the error or warning "XML not well-formed" and got the successfull completion message window for my mapping when I proceed.
    Now when I clicked xml source button for the target structure, It displays the invalid tag and starting with "#default"
    So If I removed this particular tag at the first and last lines, it becomes a valid xml structure and able to see properly in my internet explorer
    Here is the result I am getting:
    <?xml version="1.0" encoding="UTF-8"?>
    <#default:MT_Student_Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:xsltMappingScenarios C:/DOCUME~1/Satya/Desktop/MT_Student_Result.xsd">
      <Data>
        <Name>Khan Raj</Name>
        <Marks>
          <Total_Marks>166</Total_Marks>
        </Marks>
      </Data>
    </#default:MT_Student_Result>
    When I tested through MAPFORCE it generates absolutely valid XML structure when I clicked OUTPUT button on MAPFORCE, but not when I used the xslt mapping through my interface mapping.
    What is the error I am making or any step missing?
    Please help me!
    Edited by: Shilpa Shetty on Oct 9, 2008 4:17 AM
    Edited by: Shilpa Shetty on Oct 9, 2008 5:58 AM
    Edited by: Chris Rock on Oct 9, 2008 6:06 AM

    For some reason when I use MapForce tool to generate my xslt mapping source, it is generating the following statement in the xsl file.
         <xsl:namespace-alias stylesheet-prefix="n" result-prefix="#default"/>
    So at the root element of XML file, it is replacing the character n with '#default' for some reason, I don;t know the purpose of this.
    As you suggested, I changed the name space, still I experienced same problem.
    It is now resolved after removing the above xsl statement from the xsl file before creating/uploading the relevant zip file into archives folder.
    It works fine now. Thanks for the clue.

  • Regarding jdbc scenario

    hi friends plz find my error "Error while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)".

    HI this is my xslt mapping file please check if any errors r there.
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    This file was generated by Altova MapForce 2008sp1
    YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
    OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
    Refer to the Altova MapForce Documentation for further details.
    http://www.altova.com/mapforce
    -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:n="http:file2jdbc_xslt" exclude-result-prefixes="xs xsi xsl" xmlns="http:file2jdbc_xslt">
         <xsl:namespace-alias stylesheet-prefix="n" result-prefix="#default"/>
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
         <xsl:template match="/n:send_msg_typ">
              <n:receive_msg_typ>
                   <xsl:attribute name="xsi:schemaLocation">
                        <xsl:value-of select="'http:file2jdbc_xslt C:/DOCUME~1/miracle/Desktop/receive_msg_typ.xsd'"/>
                   </xsl:attribute>
                   <xsl:variable name="Vvar0_firstSource" select="."/>
                   <rowvalue xmlns="">
                        <statement>
                             <xsl:attribute name="action">
                                  <xsl:value-of select="'insert'"/>
                             </xsl:attribute>
                             <table>
                                  <xsl:value-of select="'emp'"/>
                             </table>
                             <access>
                                  <xsl:for-each select="empname">
                                       <xsl:variable name="Vmarkerloopempname" select="."/>
                                       <xsl:for-each select="$Vvar0_firstSource/empnum">
                                            <xsl:variable name="Vmarkerloopempnum" select="."/>
                                            <xsl:for-each select="$Vvar0_firstSource/empsal">
                                                 <xsl:variable name="Vmarkerloopempsal" select="."/>
                                                 <xsl:for-each select="$Vvar0_firstSource/dept">
                                                      <xsl:variable name="Vvar4_result" select="concat($Vmarkerloopempname, $Vmarkerloopempnum)"/>
                                                      <xsl:variable name="Vvar5_result" select="concat($Vvar4_result, $Vmarkerloopempsal)"/>
                                                      <xsl:variable name="Vvar6_result" select="concat($Vvar5_result, .)"/>
                                                      <empdetails>
                                                           <xsl:value-of select="$Vvar6_result"/>
                                                      </empdetails>
                                                 </xsl:for-each>
                                            </xsl:for-each>
                                       </xsl:for-each>
                                  </xsl:for-each>
                             </access>
                        </statement>
                   </rowvalue>
              </n:receive_msg_typ>
         </xsl:template>
    </xsl:stylesheet>
    and my error is "Error while parsing or executing XML-SQL document: ERROR occured parsing request:com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x23(:main:, row:2, col:2)(:main:, row=2, col=2) -> com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x23(:main:, row:2, col:2)"
    please rectify my error.

  • One mapping program for three diferent enviroments

    Hello there,
    I have developed a scenario in which an rfc requests a web service trough XI. In the process a BPM is involved together with some XSLT mappings.
         R3->XI->WebService
    The Web service request message looks like follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <cem:Z_ORDER_SEARCH xmlns:cem="http://XXXXXXXX/yyyyyyyyyyyy">
         <messageStructure/>
    </cem:Z_ORDER_SEARCH>
    Where "http://XXXXXXXX/yyyyyyyyyyyy" Is the web service destination.
    Everything works fine, but as I have to manage three different environments for Development, Quality and Production I need three different versions of the XSL mapping since destinations are not the same for Dev, Qlty and Production environments.
    I found out that I can get information of the sender using runtime parameters as follows:
    <xsl:param name="SenderSystem">
    I would like to evaluate this information to determine the target URL destination.
    If the sender is the development sender then the URL target is the development destination and so on.
    I tried the following code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem=""
    <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
    <xsl:template match="/">
         <cem:mappingProgram/>
    </xsl:template>
    </xsl:stylesheet>
    This works all right, but I cannot insert code to evaluate the destination.
    On the other hand, this code is not valid:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem="">
    <xsl:param name="SenderSystem"/>
         <xsl:choose>
              <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>
              </xsl:when>
              <xsl:when test="string($SenderSystem) = 'QUALITY'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>
              </xsl:when>
              <xsl:otherwise>
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
              </xsl:otherwise>
         </xsl:choose>
         <xsl:template match="/">
              <cem:mappingProgram/>
         </xsl:template>
    </xsl:stylesheet>
    Neither this one:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:cemDev="http://developmentDestination"
    xmlns:cemQlty="http://qualityDestination"
    xmlns:cemPrd="http://productionDestination"
    xmlns:cem="">
            <xsl:param name="SenderSystem"/>
            <xsl:template match="/">
         <xsl:choose>
              <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>
              </xsl:when>
              <xsl:when test="string($SenderSystem) = 'QUALITY'">
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>
              </xsl:when>
              <xsl:otherwise>
                   <xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>
              </xsl:otherwise>
         </xsl:choose>
         <cem:mappingProgram/>
          </xsl:template>
    </xsl:stylesheet>
    I tried this other code, which is obviously not valid:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <xsl:param name="SenderSystem"/>
              <xsl:choose>
                   <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">
                   </xsl:when>
                   <xsl:when test="string($SenderSystem) = 'QUALITY'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">
                   </xsl:when>
                   <xsl:otherwise>
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">
                   </xsl:otherwise>
              </xsl:choose>
         <cem:mappingProgram/>
    </cem:Z_ORDER_SEARCH>               
         </xsl:template>
    </xsl:stylesheet>
    So the only way I found to make it works is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <xsl:param name="SenderSystem"/>
              <xsl:choose>
                   <xsl:when test="string($SenderSystem) = 'PRODUCTION'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:when test="string($SenderSystem) = 'QUALITY'">
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:otherwise>
                        <cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">
         <cem:mappingProgram/>
                        </cem:Z_ORDER_SEARCH>               
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    </xsl:stylesheet>
    Unfortunately this doesn’t solve my problem, because I need to reproduce the mapping program three times in the document.
    Any ideas, or suggestions how to manage one mapping program for the three different environments?
    Thanks a lot in advance, Raú

    Hi there,
    I just found one way of getting this done. It may not be the better waw, but I post it in case it is helpfull.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
         <!-- Sender System at runtime-->
         <xsl:param name="senderSystem"/>
         <!-- SenderSystem constants (development addressed by default)-->
         <xsl:variable name="qualitySenderSystem" select="'WHATEVERTHENAMEOFTHEQUALITYSENDERSYSTEM'"/>
         <xsl:variable name="productionSenderSystem" select="'WHATEVERTHENAMEOFTHEPRODUCTIONSENDERSYSTEM'"/>
         <!-- Mapping program template to be called-->
         <xsl:template name="mappingProgram" match="/">
              <!-- MAPPING PROGRAM-->
              <UNIQUE_MAPPING_PROGRAM/>
              <!-- END OF MAPPING PROGRAM-->
         </xsl:template>
         <!Receiver determination depending on senderSystem>
         <xsl:template match="/">
              <xsl:choose>
                   <xsl:when test="$senderSystem=$productionSenderSystem">
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://production">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:when test="$senderSystem=$qualitySenderSystem">
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://quality">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:when>
                   <xsl:otherwise>
                        <xxx:Z_ORDER_SEARCH xmlns:xxx="http://development">
                             <xsl:call-template name="mappingProgram"/>
                        </xxx:Z_ORDER_SEARCH>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    </xsl:stylesheet>

Maybe you are looking for