Disable namespace prefixes in Transformer

hi
I am stuck in a cyclic problem. JAXP XSLT and SchemaValidator do not work together. (Java 1.5 and 1.6)
I have a XSD with a namespace.
When I generate the XML using an XSLT I specify namespace using the namespace attribute of xsl:element
The JAXP transformer always generate the namespace prefix and equate the prefix with the actual URI
Is there a way to disable this behavior, that is, I do want the xmlns URI in the root element but not the prefix?
There are two reasons for wanting an XML without prefixes:
1) The Schema Validator provided with JRE is not able to validate the message with prefix, but it works fine with xmlns URI
<rootelem xmlns="urn:xmlns:xyz.abc.com"> validates fine
but
<ns0:rootelem xmlns:ns0="urn:xmlns:xyz.abc.com"> fails validation with error:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'ns0:rootelem'.
I am able to generate the first case when I use Saxon based OrangeXSLT plugin for Eclipse but JAXP based transformer always generate the second case.
2) More importantly, I have XML consumers that could use parsing without namespace support and prefixed element will not work there.
I am using StreamResult in the Transformer.transform() call and my guess is that the internal implementation of Transformer might be using a SAX ContentHandler (XML Serializer) to write XML to the outputStream and I guess one way to get around could be that I write a custom ContentHandler and use a SAXResult in the transform call. I am not sure if I am thinking in the right direction.
If I am correct in my guess, could someone please point to some implementation of XMLSerializer that could be overridden just to disable namespace prefixing behavior?
I have removed the namespace from the XSD for things to work. I would appreciate any help with this.

Moving to latest Xalan and Xerces solved the problem.
But a new one surfaced.
Xalan's latest transformer does not handle StreamSource correctly and throws some exception internally (IOException related to end of stream), with the message:
SystemId Unknown; Line #-1; Column #-1; Premature end of file.
It work correctly if a DOMSource is provided as the input. This does not make sense, since the InputStream my code is using for StreamSource is ByteArrayInputStream for an in-memory XML and such error would happen if this stream is read more than once without calling a reset in between.
Please let me know if this seems like a valid bug or if I am doing something wrong.

Similar Messages

  • How to suppress n0: default Namespace prefix in Transformations

    Hi,
    I use Simple Transformations for serialization of deep structured data.
    In the XML File the whole tree needs to use a special namespace. Therefore i use the attribute xmlns="ABC.de" without a namespace prefix in my root element. During serialization SAP generates a default namespace prefix like 'n0:'.
    Is it possible to suppress the generated namespace prefix?
    Thank you very much for reply
    René
    Edited by: René Libbert on Feb 14, 2012 8:09 AM

    Maybe somebody is interested.
    It seems to be a problem on old 640. On a NW 702 the result is as expected. NW 700 was not tested.
    Workaround for the 640 is to use as result a STRING field not an XSTRING.
    Greetings René

  • JDeveloper 10.1.3 - Disabling ns0: namespace prefix in soap body children ?

    I am attempting to use a PeopleSoft web service. However, the PeopleSoft web service does not recognize operations which have a namespace prefix. Using visual studio, namespace prefixes are not used in the child elements of the soap body element. I am able to call the service using visual studio.
    JDeveloper 10.1.3 uses a namespace prefix for children of the body element which is recommended by the soap spec. However, I need to disable that behavior so that I can actually get the program working with PeopleSoft.
    Can anyone tell me if there is an easy way to disable the ns0: prefix that is used by the generated web service proxy stub? I have traced through the generated proxy code but I do not see any properties that can be modified. The only thing I can think of is to modify the generated code but I do not want to go that route.
    Thanks,
    Rich

    Delete the NS0: related text, in JDev, from your WSDL and it should work. I had the same problem with .NET not liking it also.
    Keep in mind you'll have to tweak the WSDL again if you regenerate it.
    You sure you're using 10.1.3? I upgraded and it shows the NS0: as a problem in existing projects. I'm working on the latest, production download so maybe it's been corrected.

  • Xsl-xml transformation: how to resolve namespace prefix?

    public static String  XMLTransform(Source xmlSource, Source xsltSource)throws DocumentException,TransformerException,TransformerConfigurationException,Exception{
              ByteArrayOutputStream returnByteStream = new ByteArrayOutputStream();
              StreamResult streamResult = new StreamResult(returnByteStream);
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Templates templates = tFactory.newTemplates(xsltSource);
              Transformer transformer = templates.newTransformer();
              transformer.transform(xmlSource, streamResult);
              String result= returnByteStream.toString();
              return result;
         }now xml I have is like this
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <soap:Body>
              <FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Traversal="Shallow">
                   <ItemShape>
                        <t:BaseShape>AllProperties</t:BaseShape>
                   </ItemShape>
                   <ParentFolderIds>
                        <t:DistinguishedFolderId Id="inbox"/>
                   </ParentFolderIds>
              </FindItem>
         </soap:Body>
    </soap:Envelope>how do i pass namespace in transformation?

    You don't "pass" the namespace in your transformation. Simply declare it in the root element, exactly as you declared it in your XML document.

  • Namespace prefix in Root element missing during variable assignment in SOA Suite 11g

    I need qualified element Namespaces in one of the target variables. All elements being referred to would have the namespace prefixed. This is working for all child elements, but not the for root element. How can i get the root element prefixed with the namespace?
    We are using SOA Suite 11g and the Jdeveloper version we are using is 11.1.1.6.0
    when i use transform operation to populate the target variable the variable gets populated something like this :
    <inputVariable>
    <part  name="payload">
    <Message>
    <msg:Header>
    <head:field1>xxxxxx</head:field1>
    <head:field2>2013-07-09T08:00:55</head:field1>
    </msg:Header>
    </Message>
    But the actual output we need is
    <inputVariable>
    <part  name="payload">
    <msg:Message>
    <msg:Header>
    <head:field1>xxxxxx</head:field1>
    <head:field2>2013-07-09T08:00:55</head:field1>
    </msg:Header>
    </msg:Message>
    We tried the fix suggested in one of the SOA threads but its not working for us and looks like that will work only for SOA SUITE 10g.
    Please provide us any help/suggestions if anyone know the solution.
    Thank you in advance for the help.

    Any one can help us please.......

  • Namespace prefix in Root element missing during variable assignment

    In bpel 10.1.3.4, I need qualified element Namespaces in one of the target variables. I have an xsd that has elementFormDefault = "qualified" set, therefore all elements being referred to would have the namespace prefixed. This is working for all child elements, but not the root element. How can i get the root element prefixed with the namespace?
    If i use transform or copy/append operation to populate in the target variable the variable gets populated something like this :
    <Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
    <pidx:InvoiceProperties>
    <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
    </pidx:InvoiceProperties>
    </Invoice>
    Whereas i need :
    <*pidx:*Invoice xmlns:pidx="http://www.api.org/pidXML/v1.0" pidx:transactionPurposeIndicator="Original" pidx:version="1.0" xmlns="http://www.api.org/pidXML/v1.0">
    <pidx:InvoiceProperties>
    <pidx:InvoiceNumber>test123</pidx:InvoiceNumber>
    </pidx:InvoiceProperties>
    </*pidx:*Invoice>
    Is there some way to accomplish this?
    Regards,
    Sandeep

    Hi Sandeep,
    We have exactly the same issue, but, when we implemented the solution, we are getting the following error, when we tried to compile the code, we are using 11.1.1.4.0 version of SOA 11g, appreciate if there is any way you can help us on this:
    Jul 12, 2011 2:40:28 PM com.collaxa.cube.CubeLogger info
    INFO: validating "BPELProcess1.bpel" ...
    oracle.jrf.UnknownPlatformException: JRF is unable to determine the current application server platform.
         at oracle.jrf.ServerPlatformSupportFactory.getInstance(ServerPlatformSupportFactory.java:79)
         at oracle.integration.platform.blocks.WLSPlatformConfigurationProvider.<clinit>(WLSPlatformConfigurationProvider.java:44)
         at oracle.integration.platform.blocks.FabricConfigManager.<clinit>(FabricConfigManager.java:154)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXpathFunctions(FabricXPathFunctionResolver.java:282)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.loadXPathConfigFile(FabricXPathFunctionResolver.java:156)
         at oracle.integration.platform.blocks.xpath.FabricXPathFunctionResolver.init(FabricXPathFunctionResolver.java:49)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.loadFabricXpathFunctions(BPELXPathFunctionNameResolver.java:57)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<init>(BPELXPathFunctionNameResolver.java:48)
         at com.collaxa.cube.xml.xpath.BPELXPathFunctionNameResolver.<clinit>(BPELXPathFunctionNameResolver.java:44)
         at com.collaxa.cube.lang.compiler.bpel.XPathExprValidatorVisitor.<init>(XPathExprValidatorVisitor.java:122)
         at com.collaxa.cube.lang.compiler.bpel.AssignValidator.<init>(AssignValidator.java:89)
         at com.collaxa.cube.lang.compiler.bpel.BpelParser.<init>(BpelParser.java:452)
         at com.collaxa.cube.lang.compiler.bpel.BPELValidator.validate(BPELValidator.java:60)
         at com.collaxa.cube.lang.compiler.BPEL1Processor.validate(BPEL1Processor.java:329)
         at com.collaxa.cube.lang.compiler.BPEL1Processor.process(BPEL1Processor.java:153)
         at com.collaxa.cube.lang.compiler.CubeParserHelper.compile(CubeParserHelper.java:47)
         at oracle.fabric.bpel.bpelc.BPELComponentValidator.validate(BPELComponentValidator.java:40)
         at oracle.soa.scac.ValidateComposite.validateComponentTypeServicesReferences(ValidateComposite.java:1117)
         at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:500)
         at oracle.soa.scac.ValidateComposite.run(ValidateComposite.java:150)
         at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:135)
    Jul 12, 2011 2:40:29 PM CubeProcessGenerator compile
    WARNING: classpath is: C:\oracle\Middleware\jdeveloper\jdev\extensions\oracle.sca.modeler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.mediator_11.1.1\mediator_client.jar;C:\oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\oracle\Middleware\jdeveloper\jdev\extensions;;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\classes;C:\JDeveloper\mywork\InvoiceTransferApp\InvoiceTransferProj\SCA-INF\gen-classes;C:\oracle\Middleware\oracle_common\modules\commonj.sdo_2.1.0.jar;C:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;C:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel1-1-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpel_coherence_config.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\bpm-analytics.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\wsif-binding.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\monitor-rt-xbean.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\oracle.soa.bpmn.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\user-patch.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.thirdparty.jar;C:\oracle\Middleware\jdeveloper\uddi\lib\oracle.soa.uddi.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\bpm-infra.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\testfwk-xbeans.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-scheduler.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\xmlunit-1.1.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-xpath-exts.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle-soa-client-api.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-was.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime-ext-wls.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;C:\oracle\Middleware\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\classes
    Regards,
    Sireesh

  • Printing with Apex generates error (namespace prefix ref....)

    Hello forum helpers,
    i have installed bi publisher standalone and bi publisher desktop with MS Word 2003.
    I have generated a rtf document as a template.
    I loaded this rtf template into the apex database and started the TEST REPORT BUTTON in apex report queries.
    But i have seen no report.
    So, I have placed a xdodebug.cfg file into the folder java/jre/lib and so i have several logfiles created after processing printing.
    This logfiles shows this lines, which i do not understand:
    [030211_051252364][oracle.apps.xdo.template.FOProcessor][STATEMENT] Log file 'xdo_030211_051252364_fo_data_14.xsl' is created.
    [030211_051252364][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setData(InputStream) is called.
    [030211_051252364][oracle.apps.xdo.template.FOProcessor][STATEMENT] Log file 'xdo_030211_051252364_fo_data_15.xml' is created.
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] Log file 'xdo_030211_051252364_fo_out6.out' is created.
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setOutput(OutputStream)is called.
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.setOutputFormat(byte)is called with ID=3.
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] Start Memory: max=247MB, total=62MB, free=23MB
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] FOProcessor.generate() called.
    [030211_051252379][oracle.apps.xdo.template.FOProcessor][STATEMENT] createFO(Object, Object) is called.
    [030211_051252395][oracle.apps.xdo.common.xml.XSLT10gR1][STATEMENT] Oracle XML Developers Kit 10.1.0.5.0 - Production
    [030211_051252395][oracle.apps.xdo.common.xml.XSLT10gR1][STATEMENT] Scalable Feature Disabled
    [030211_051252410][oracle.apps.xdo.common.xml.XSLTWrapper][ERROR] XSL error:
    XML-22008: (Error) Namespace prefix 'ref' used but not declared.
    [030211_051252410][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) is called.
    [030211_051252426][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) done. All inputs are cleared.
    [030211_051252426][oracle.apps.xdo.template.FOProcessor][ERROR] End Memory: max=247MB, total=62MB, free=20MB
    [030211_051252426][][EXCEPTION] java.lang.reflect.InvocationTargetException
    You see, that an xml-22008 Error appears.
    In google i only found, that the declaration of this reference must be before using it. Seems to be logical.
    But the template is generated by BI Publisher himself, so now i do not understand.
    I have no choice to declare references, the xml file is made by bi publisher.
    Has anyone a solution for this ?
    Thank you for help.
    Frank

    Issue was solved, found it in the bi publisher options in word 2003

  • Namespace Problem? Namespace prefix used but not declared.

    Hello Guru's,
    I am new to XSL templates, while genrating XML publisher report with these template, I am getting below "namespace" error:
    If I remove the "set:"/"str:" expressions from the template, it works fine. Is there anything syntactically wrong in the expression? but not getting the results
    Getting "Caused by: oracle.xdo.parser.v2.XMLParseException: Namespace prefix 'str' used but not declared." error while using this code
                             <xsl:call-template name="str:generate-string">
                                  <xsl:with-param name="text" select="' '"/>
                                  <xsl:with-param name="count" select="30"/>
                             </xsl:call-template>
    Getting "Caused by: oracle.xdo.parser.v2.XMLParseException: Namespace prefix 'set' used but not declared." error while using this code
         <xsl:template name="distinct">
              <xsl:param name="nodes" select="/.."/>
              <xsl:param name="distinct" select="/.."/>
              <xsl:choose>
                   <xsl:when test="$nodes">
                        <xsl:call-template name="distinct">
                             <xsl:with-param name="distinct" select="$distinct | $nodes[1][not(. = $distinct)]"/>
                             <xsl:with-param name="nodes" select="$nodes[position() &gt; 1]"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:apply-templates select="$distinct" mode="set:distinct"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    I would appreciate any help in this regard.
    SA

    Declare them in the namespace :)
    <?xml version='1.0' encoding='windows-1252'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template name="distinct">
    <xsl:param name="nodes" select="/.."/>
    , </xsl:stylesheet>

  • How to add an element with a namespace prefix (Part 2)

    Hi all,
    I previously asked a question about adding an attribute with a namespace prefix to an element that already exists and that declares the namespace prefix here:
    https://forums.oracle.com/thread/2610142
    I received an answer that works, but now I am stumped again when I have to add an element where the element name has the namespace prefix.
    For example, let's say I already have this element:
    <A xmlns="namespace" xmlns:def="myns_namespace"/>
    And I want to add this element:
    <def:B/>
    To produce this:
    <A xmlns="namespace" xmlns:def="myns_namespace">
         <def:B/>
    </A>
    and NOT this:
    <A xmlns="namespace" xmlns:def="myns_namespace">
         <def:B  xmlns:def="myns_namespace"/>
    </A>
    This does not work:
    SELECT
    xmlserialize(document
        appendChildXML(
         xmltype('<A xmlns="namespace" xmlns:def="myns_namespace"/>')
        , '/A'
        , xmlelement("def:D")
        , 'xmlns="namespace" xmlns:def="myns_namespace"'
      indent)
    FROM dual;
    Because of this error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix "def" is not declared
    Error at line 1
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    Is there any way to do this without the child element having the duplicate namespace declaration?
    My oracle version is:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production

    Hi,
    This one's tricky, so tricky that I think it's not possible using Oracle built-in XML DML functions.
    Even XQuery Update cannot do it (for now) because, likewise, the prefix is always redeclared at child level.
    The only thing I can think of is XSLT (or maybe DOM manipulation) :
    SQL> select xmlserialize(document
      2           xmltransform(
      3             xmltype('<A xmlns="namespace" xmlns:def="myns_namespace"/>')
      4           , xmltype(
      5  '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      6     xmlns:def="myns_namespace"
      7     xmlns:ns0="namespace">
      8    <xsl:template match="ns0:A">
      9      <xsl:copy>
    10        <xsl:element name="def:B"/>
    11      </xsl:copy>
    12    </xsl:template>
    13  </xsl:stylesheet>')
    14         )
    15        indent
    16      )
    17  from dual;
    XMLSERIALIZE(DOCUMENTXMLTRANSF
    <A xmlns="namespace" xmlns:def="myns_namespace">
      <def:B/>
    </A>

  • Controlling Namespace Prefix in OSB10gR3

    Hi,
    I am doing a xquery transformation in my application, where I have defined a few namespaces with prefixes, but the prefixes get changed in my output. Is there anyway I can control the namespace prefixes.
    Thanks,
    Balaji.

    Hi Balaji,
    Have you defined those namespaces in OSB configuration with same prefix? If no, please do so, it should work.
    Few alternate approaches are mentioned here -
    Re: Namespace replace/rename issue in ALSB
    Regards,
    Anuj

  • How to add namespace prefix to root tag in XSL version 1.1  SOA 11g

    Hi Experts,
       Can any one post solution for adding namespace prefix to root tag using XSL version 1.1 in SOA 11g?
    I have tried the below options and none is working.
    1. Removing prefix add in exclude-prefixes in XSL.But still seeing no prefix for root tag.
    2. Added the <xsl-element>   tag with namespace.But it is not working
    3. Added the below XSL code and it is not working.
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
       <xsl:copy>
       <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
       <xsl:element name="ns0:{local-name()}">
       <xsl:copy-of select="namespace::*" />
       <xsl:apply-templates select="@* | node()" />
       </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Try this:
    <xsl:stylesheet  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="@*|text()|comment()|processing-instruction()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="/">
            <RootTag xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
                <xsl:apply-templates select="@*|node()"/>          
            </RootTag >
        </xsl:template>
        <xsl:template match="*">
            <xsl:element name="{local-name()}">
                <xsl:apply-templates select="@*|node()"/>
            </xsl:element>
        </xsl:template>
    </xsl:stylesheet>

  • Extracting a namespace prefix

    Hi,
    I have the following document
    <ns4:product xmlns:ns1="www.abc.com" xmlns:ns2="www.def.com" xmlns:ns3="www.ghi.com" xmlns:ns4="www.jkl.com">
    <ns4:productline>Widget</ns4:productline>
    </ns4:product>
    I'm trying to find a SQL function which will enable me to extract the namespace prefix with the value "www.jkl.com". This is so that I can then use the prefix as part of the xpath expression to search for an element value in the document eg. extractvalue('/ns4:product/ns4:productline')
    Thanks

    Hi,
    This one's tricky, so tricky that I think it's not possible using Oracle built-in XML DML functions.
    Even XQuery Update cannot do it (for now) because, likewise, the prefix is always redeclared at child level.
    The only thing I can think of is XSLT (or maybe DOM manipulation) :
    SQL> select xmlserialize(document
      2           xmltransform(
      3             xmltype('<A xmlns="namespace" xmlns:def="myns_namespace"/>')
      4           , xmltype(
      5  '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      6     xmlns:def="myns_namespace"
      7     xmlns:ns0="namespace">
      8    <xsl:template match="ns0:A">
      9      <xsl:copy>
    10        <xsl:element name="def:B"/>
    11      </xsl:copy>
    12    </xsl:template>
    13  </xsl:stylesheet>')
    14         )
    15        indent
    16      )
    17  from dual;
    XMLSERIALIZE(DOCUMENTXMLTRANSF
    <A xmlns="namespace" xmlns:def="myns_namespace">
      <def:B/>
    </A>

  • How can I change namespace prefix for JAX-RPC client request?

    I'm creating a JAX-RPC client to invoke a RPC/encoded web service. The service was generated from a ColdFusion program and for some reason when the SOAP namespace prefix is anything but "soapenv" it returns text/html instead of text/xml. Currently the client is sending requests with the prefix "env" and I'd like to change it to "soapenv".
    I created a type of javax.xml.rpc.handler.GenericHandler and attempted to do the follow:
    @Override public boolean handleRequest(MessageContext p1) {
         SOAPMessage msg = ((SOAPMessageContext) p1).getMessage(); 
         try {
              SOAPPart part = msg.getSOAPPart();
              SOAPEnvelope envelope = part.getEnvelope(); 
              envelope.setPrefix("soapenv"); 
              msg.saveChanges(); 
         } catch(SOAPException ex) {
              // TODO
              return false;
         return true;
    However I get the following exception:
    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [UNIMPLEMENTED ] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.AssertionError: UNIMPLEMENTED
    at weblogic.xml.domimpl.NodeImpl.setPrefix(NodeImpl.java:173)
    at test.MyHandler.handleRequest(MyHandler.java:33)
    at weblogic.wsee.handler.JaxrpcHandlerChain.handleRequest(JaxrpcHandlerChain.java:58)
    at weblogic.wsee.ws.dispatch.server.JaxrpcChainHandler.handleRequest(JaxrpcChainHandler.java:102)
    at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
    at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)
    at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)
    at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)
    at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:341)
    at test.Approvedsuppliers_Wrap_Stub.echo(Approvedsuppliers_Wrap_Stub.java:31)
    at test.Approvedsuppliers_WrapPortClient.echo(Approvedsuppliers_WrapPortClient.java:130)
    at test.Approvedsuppliers_WrapPortClient.main(Approvedsuppliers_WrapPortClient.java:43)
    Is there any workaround? I appreciate any feedback.
    Thanks, Bill

    What I ended up doing is converting the SOAP message to a string, replacing the namespace prefix and converting it back to a SOAP message.
    @Override
       public boolean handleRequest(MessageContext messageContext) {
          SOAPMessageContext soapMessageContext = (SOAPMessageContext) messageContext;
          SOAPMessage soapMessage = soapMessageContext.getMessage();
          String soapString = convertSOAPToString(soapMessage);
          soapString = soapString.replaceAll("env:", "soapenv:");
          soapString = soapString.replaceAll("xmlns:env", "xmlns:soapenv");
          SOAPMessage newSoapMessage = convertStringToSOAP(soapString);
          MimeHeaders mimeHeader = newSoapMessage.getMimeHeaders();
          mimeHeader.setHeader("SOAPAction", "");
          soapMessageContext.setMessage(newSoapMessage);
          return true;
       private String convertSOAPToString(SOAPMessage soapMessage) {
          StringWriter stringWriter = null;
          try {
             stringWriter = new StringWriter();
             StreamResult streamResult = new StreamResult(stringWriter);
             TransformerFactory transformFactory = TransformerFactory.newInstance();
             Transformer transformer = transformFactory.newTransformer();
             transformer.transform(new DOMSource(soapMessage.getSOAPPart()), streamResult);
          } catch (TransformerException e) {
             throw new RuntimeException(e);
          } finally {
             close(stringWriter);
          return stringWriter.toString();   
       private SOAPMessage convertStringToSOAP(String soapString) {
          SOAPMessage soapMessage = null;
          ByteArrayInputStream byteInputStream = null;
          try {
             MessageFactory msgFactory = MessageFactory.newInstance();
             soapMessage = msgFactory.createMessage();
             SOAPPart soapPart = soapMessage.getSOAPPart();
             // Load the SOAP text into a stream source
             byte[] buffer = soapString.getBytes();
             byteInputStream = new ByteArrayInputStream(buffer);
             StreamSource source = new StreamSource(byteInputStream);
             // Set contents of message
             soapPart.setContent(source);       
          } catch (SOAPException e) {
             throw new RuntimeException(e);
          } finally {
             close(byteInputStream);
          return soapMessage;
       private void close(Closeable closeable) {
          if(closeable != null) {
             try {
                closeable.close();
             } catch (IOException e) {
                // TODO

  • How to remove namespace prefix from target payload when using HTTP in PI7.0

    Hi,
    i have a requirement to remove namespace prefix from target payload when receiver receives the payload by an HTTP request.
    i am not able to use XML Anonymizer Bean as in HTTP channel its not possiile.
    Target structure after mapping now is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns3:Order xmlns:ns3="urn:xxx-com:pi:project">
    fields
    </ns3:Order>
    i need the target structure after mapping should look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <Order xmlns:="urn:xxx-com:pi:project">
    fields
    <Order>
    i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
    Please reply if anyone has solved this problem before.
    Thanks

    Hi ,
    >>>i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
    Which process you've used for removing namespace...java/xslt mapping. In case of java mapping plese remove ns3 while creating the target element. Please go through the below blog it may help you.
    Quick Tips: Dealing with Namespaces in XI/PI
    Regards,
    Priyanka

  • Missing namespace prefix in the soap body

    Hello
    The soap body that is produced along with soap header for my webservice. I
    am the client talking to a server. The first piece in RED color is what
    weblogic generates to send to the client but does NOT work. The one below
    though works fine which is what I manipulated by hand to send to the
    server. I have no idea why weblogic drops the namespace prefix in the
    BODY.
    -Narahari
    The message is as shown below
    POST /FS HTTP/1.1
    Host: asgappsrv10:6211
    Content-Type: text/xml; charset=utf-8
    Connection: close
    SOAPAction: "ListDomains"
    <?xml version="1.0" encoding="utf-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    <n1:Credentials xmlns:n1="urn:criticalpath:fs:api:1.0"
    xsi:type="n1:Credentials">
    <Username xsi:type="xsd:string">admin@default</Username>
    <Password xsi:type="xsd:string">password</Password>
    <SessionId xsi:nil="true"/>
    </n1:Credentials>
    </env:Header>
    <env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <Fulfill xmlns:n2="urn:criticalpath:fs:api:1.0"
    xsi:type="n2:Fulfill">
    <Request xsi:type="xsd:string">ListDomains</Request>
    <RequestAttributes soapenc:arrayType="n2:Attribute[0]"/>
    <Async xsi:type="xsd:boolean">false</Async>
    </Fulfill>
    </env:Body>
    </env:Envelope>
    When you see the data carefully, the env:Body has the Fulfill element. But
    it does have a namespace prefix on it. This causes the call to fail. If I
    change the above segment manally to look like
    POST /FS HTTP/1.1
    Host: asgappsrv10:6211
    Content-Type: text/xml; charset=utf-8
    Connection: close
    SOAPAction: "ListDomains"
    <?xml version="1.0" encoding="utf-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    <n1:Credentials xmlns:n1="urn:criticalpath:fs:api:1.0"
    xsi:type="n1:Credentials">
    <Username xsi:type="xsd:string">admin@default</Username>
    <Password xsi:type="xsd:string">password</Password>
    <SessionId xsi:nil="true"/>
    </n1:Credentials>
    </env:Header>
    <env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <n2:Fulfill xmlns:n2="urn:criticalpath:fs:api:1.0"
    xsi:type="n2:Fulfill">
    <Request xsi:type="xsd:string">ListDomains</Request>
    <RequestAttributes soapenc:arrayType="n2:Attribute[0]"/>
    <Async xsi:type="xsd:boolean">false</Async>
    </n2:Fulfill>
    </env:Body>
    </env:Envelope>

    Hi All,
    we are also facing the same issue, Please provide the solution if anyone knows. We are also using the SOA Suite 11g Version.

Maybe you are looking for

  • Order by

    sir I am new to database and sql.i m doing sql course and preparing 4 1z0-051 by myself (and attaining a WDP course @ OAEC on 1z0-007).I need a help for this order by stuff: select employee_id , last_name,salary,department_id FROM employees --WHERE e

  • Cover Flow in iTunes

    When I try to get album artwork for iTunes, a message pops up saying that I need to sign into the ITunes store. But when I do, I still don't automatically get the "Cover Flow." I'm working in Windows XP. Has anyone had this problem?

  • Distribution channel-wise customer sales and outstanding report.

    Hi In our scenario, one customer is direct factory sales as well consignment sales customer also. We created two distribution channel. But customer master record is one. Now my client requires customer report: Total sales value and quantity - distrib

  • Example of Aperture dead pixel problem

    A lot of people have been complaining about green pixels in their converted output. I noticed a pixel in the RAW image as rendered within Aperture and went in for a closer look. It's more like a dead pixel. I've put up crops of an image mangnified at

  • Cannot block pop ups, even when block is checked

    I have tried all of the settings provided in your directions, nothing is working, still getting at least 5 a day many times banking please help!!!!!!!!!!!!!!