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

Similar Messages

  • 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 the Root Element of the variable

    Hi Gurus,
    We need to call a webservice which requires a namespace prefix at the root elemnt of the xml payload. But as we know that the default behaviour of BPEL removes the prefix so the invoke activity is failing and so we are stuck.
    I found this thread Namespace prefix in Root element missing during variable assignment but i feel the solution specified in this link works only in SOA 10g environment Please let us know what needs to be done?
    Appreciate a prompt response.
    NOTE: SOA Suite Version- 11.1.1.4
    Regards
    Ayush

    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.

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

  • Namespace prefix in SOAP Elements causes problems in XI

    Hi guys,
    I'm using code generated by NW Developer Studio for use inside Portal components acting as a web service consumer. The problem is that the code generated includes a namespace prefix for each element in the body of the message, but XI doesn't like the namespace prefixes and throws back a DeliveryException.
    The SOAP message created by the generated NWDS code is:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wn3="http://www.w3.org/1999/XMLSchema" xmlns:wn2="http://www.w3.org/2000/10/XMLSchema" xmlns:wn1="http://www.w3.org/2001/XMLSchema" xmlns:wn0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wn4="http://allieddomecq.com/poc" xmlns:tns="http://allieddomecq.com/poc">
         <SOAP-ENV:Body>
              <wn4:PortalSOAP_MT_Request>
                   <wn4:CustomerIdentifier>0001000064</wn4:CustomerIdentifier>
                   <wn4:SalesOrganization>ES50</wn4:SalesOrganization>
                   <wn4:SystemIdentifier>R3D</wn4:SystemIdentifier>
              </wn4:PortalSOAP_MT_Request>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The problem is the "wn4" prefixes on the CustomerIdentifier, SalesOrganization, and SystemIdentifier tags. When we send the soap request from XML Spy without the prefixes, the response comes back OK with the expected data.
    I've had a very good look around the generated code - the serializers for creating the soap request - but could not find what exactly might be changed to leave off the prefixes.
    Alternatively, is there something I could ask our XI consultant to do, to make his component accept the request with the redundant prefixes in the tags?
    Many thanks for any advice/help,
    Laura

    Hi Laura,
    you have to realize that the two documents
    <ns:CustomerRecord xmlns:ns="http://company.com">
    <ns:CustomerNumber> </ns:CustomerNumber>
    <ns:CustomerDetails> </ns:CustomerDetails>
    </ns:CustomerRecord>
    and
    <ns:CustomerRecord xmlns:ns="http://company.com">
    <CustomerNumber> </CustomerNumber>
    <CustomerDetails> </CustomerDetails>
    </ns:CustomerRecord>
    from an XMl point of view have totally fifferent structure. Thus, a mapping which is able to deal with the first structure will fail for the second and vice versa.
    Surely, both structures somehow can carry the same information, but they do this with different languages (Maybe you can compare this to the fact, that you may deliver the same information in English or in German language).
    When you model the structure in Integration Repository using datatypes and message types (what I think you did), you will always get a structure that looks like the second one. This is just a convention (like the convention that all information in this forum should be presented in English). When defining a message mapping for this structure it also relies on this fact and thus will not understand the other kind of document.
    External Definitions are more flexible. They are also able to understand structures that are modelled the other way. This greater flexibility is due to the fact that External Definitions were designed to understand structures that come from an external world where different conventionts might be used.
    To come to a conclusion: If the structure you have to deal with has been defined externally then it is not intended that you model it inside the Integration Builder using datatypes and message types. In this case the external source should provide a description of the message as XSD, WSDL, or DTD. You upload this as External Definition, and everything works fine.
    If you have designed the structure yourself, you can model it with datatypes and message types. But then you will always get a structure which looks like the second one. In this case you should make sure that all other participants in the game also stick to that structure. Then everything will be fine, too.
    Greetings Stephan

  • Root element miss

    We work in graphics server2.1 ,using operation system is window xp of china
    now,run example of net show err "root element miss"
    Does anyone know why?

    Hi Rodrigo,
    Check if your input schedule has numberics with long decimals .
    Ideally the BW cube  can only save the number within 13 digits left of the decimal point, and 7 digits right of the decimal point.
    If it crosses beyond that then you get the subjected error.Correct the decimals in the input schedule and try sending data again you will not see the error anymore. Hope this helps. Thanks.
    Sanjeev

  • Declaring namespaces ONLY on root element during serialization

    I'm using JAXP 1.3 and I'd like to be able to serialize a document so that the namespace declarations are only specified once on the root element and not repeated throughout the document.
    I'm working on a journal publication system and the request came from our users (i.e., editors) who say the repeated declarations are distracting when editing the XML. They are using an XML editor (Arbortext), but when they have the view set to display tags all the namespace declarations really clutters up the screen. In particular, we use the MathML namespace:
    <m:math overflow="scroll" xmlns:m="http://www.w3.org/1998/Math/MathML">
    Can this be done?
    Thanks,
    Jeff Bailey

    It's just declared on on the root element on the input file.
    I just tried what you suggested and it worked great. The mathml namespace is only declared on the root element in my output file now.
    Odd that there's a difference between the two methods. For posterity, here's the code I used to serialize the XML:
    TransformerFactory transformerFactory = TransformerFactory
    .newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
    transformer.setOutputProperty(OutputKeys.ENCODING, "US-ASCII");
    transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
    doc.getDoctype().getPublicId());
    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
    doc.getDoctype().getSystemId());
    OutputStream outputStream = new FileOutputStream(new File(
    "C:\\temp\\foo.xml"));
    transformer.transform(new DOMSource(doc),
    new StreamResult(outputStream));
    Thanks very much for your help.
    Jeff

  • Namespace prefix for Security elements being removed from SOAP Header

    Hello, I'm seeing a strange problem when accessing a web service using two different Netbeans projects.
    If I use a Netbeans Java Application, add the Web Client Reference , add the web client code, all works fine and the wsse:Security element looks like this:
    <S:Header>
    <ns4:Security xmlns:ns2="IAMP" xmlns:ns3="urn:realops.com:amp:workflow" xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <ns4:UsernameToken>
    <ns4:Username>admin</ns4:Username>
    <ns4:Password>admin123</ns4:Password>
    </ns4:UsernameToken>
    </ns4:Security>
    However if I do a similar sort of thing but access the web service via a Web Application, the namespace prefix is removed from all child elements wsse:Security like so:
    <S:Header>
    <ns4:Security xmlns:ns2="IAMP" xmlns:ns3="urn:realops.com:amp:workflow" xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <UsernameToken>
    <Username>admin</Username>
    <Password>admin123</Password>
    </UsernameToken>
    </ns4:Security>
    Which causes an authentication exception.
    The question is, why, when the wsdl are exactly the same for both projects , is the namespace prefix removed from the web app?
    Thanks in advance,
    jsz.

    Hello, I'm seeing a strange problem when accessing a web service using two different Netbeans projects.
    If I use a Netbeans Java Application, add the Web Client Reference , add the web client code, all works fine and the wsse:Security element looks like this:
    <S:Header>
    <ns4:Security xmlns:ns2="IAMP" xmlns:ns3="urn:realops.com:amp:workflow" xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <ns4:UsernameToken>
    <ns4:Username>admin</ns4:Username>
    <ns4:Password>admin123</ns4:Password>
    </ns4:UsernameToken>
    </ns4:Security>
    However if I do a similar sort of thing but access the web service via a Web Application, the namespace prefix is removed from all child elements wsse:Security like so:
    <S:Header>
    <ns4:Security xmlns:ns2="IAMP" xmlns:ns3="urn:realops.com:amp:workflow" xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <UsernameToken>
    <Username>admin</Username>
    <Password>admin123</Password>
    </UsernameToken>
    </ns4:Security>
    Which causes an authentication exception.
    The question is, why, when the wsdl are exactly the same for both projects , is the namespace prefix removed from the web app?
    Thanks in advance,
    jsz.

  • Several namespaces in root element

    Hi,
    I'm using JDOM and I would like to create an XML document that starts like this:
    <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0"
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-1.0"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-1.0"
    xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-1.0"
    xmlns:cur="urn:oasis:names:specification:ubl:schema:xsd:CurrencyCode-1.0"
    xmlns:sdt="urn:oasis:names:specification:ubl:schema:xsd:SpecializedDatatypes-1.0"
    xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnspecializedDatatypes-1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0 UBL-Invoice-1.0.xsd">
    </Invoice>
    Is there a way to add several namespaces to the root element?? I have tried hard, but nothing works...
    Thank you very much for your help,
    Susana

    OK, it's like dvohra09 said. I had an old copy of jdom.jar and the method addNamespaceDeclaration() didn't exist.
    So, here you have the code to generate the beginning of my file, if ever it's useful to someone as I found it a little bit complicated to find out:
    For this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-1.0" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
    xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0 UBL-Invoice-1.0.xsd">
         <ID>serie1_04/00011</ID>
         <cbc:CopyIndicator>false</cbc:CopyIndicator>
    </Invoice>
    The code is:
    Element rootElement = new Element("Invoice", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0");
    rootElement.addNamespaceDeclaration(Namespace.getNamespace("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-1.0"));("schemaLocation", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0 UBL-Invoice-1.0.xsd", Namespace.getNamespace("xsi", "http://www.w3.org/2000/10/XMLSchema-instance" ));
    rootElement.setAttribute(schemaLoc);
    Document invoiceDocument = new Document(rootElement);
    // ID          
    rootElement.addContent(new Element("ID", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-1.0").setText(invoice.getId_serie_desc() + "_" + invoice.getNum_factura()));
    // cbc:CopyIndicator     
    rootElement.addContent(new Element("CopyIndicator", "cbc",
    "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-1.0").setText(copyIndicator));
    Thank you for your answers.
    Susana

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

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

  • Extracting XML values with namespace prefixes

    Hint: I put this topic in "SQL and PL/SQL" but that was a bad idea, I think.
    Hi!
    I have a XML file:<?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/styl.xsl"?>
    <wnio:Deklaracja
    xmlns:adr="http://crd.gov.pl/xml/schematy/adres/2008/05/09/"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:inst="http://crd.gov.pl/xml/schematy/instytucja/2008/05/09/"
    xmlns:meta="http://crd.gov.pl/xml/schematy/meta/2008/05/09/"
    xmlns:oso="http://crd.gov.pl/xml/schematy/osoba/2008/05/09/"
    xmlns:str="http://crd.gov.pl/xml/schematy/struktura/2009/11/16/"
    xmlns:wnio="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xsi:schemaLocation="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/ http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/schemat.xsd">
                                <wnio:OpisDokumentu><str:CID>[email protected]</str:CID><meta:Identyfikator typIdentyfikatora="idFormularza"><meta:Wartosc>InstytucjaPubliczna/Deklaracja podatku od środków transportowych DT-1</meta:Wartosc></meta:Identyfikator></wnio:OpisDokumentu>
                                <wnio:Naglowek>
                                    <wnio:KodFormularza kodSystemowy="DT-1(3)"/>
                                    <wnio:WariantFormularza>3</wnio:WariantFormularza>
                                    <wnio:Rok>2008</wnio:Rok>
                                    <wnio:ObowiazekSkladaniaDeklaracji>1</wnio:ObowiazekSkladaniaDeklaracji>
                                    <wnio:MiejsceSkladania/>
                                </wnio:Naglowek>
                                <wnio:Podatnik>
                                    <wnio:OsobaPrawna>
                                        <wnio:NIP>345678901</wnio:NIP>
                                        <wnio:PelnaNazwa>Testowa Instytucja Publiczna</wnio:PelnaNazwa>
                                        <wnio:NazwaSkrocona/>
                                        <wnio:REGON>234512345</wnio:REGON>
                                    </wnio:OsobaPrawna>
                                    <wnio:AdresSiedzibyZamieszkania>
                                        <wnio:KodKraju>PL</wnio:KodKraju>
                                        <wnio:Wojewodztwo>ŚLĄSKIE</wnio:Wojewodztwo>
                                        <wnio:Powiat>Katowice</wnio:Powiat>
                                        <wnio:Gmina>Katowice (gmina miejska)</wnio:Gmina>
                                        <wnio:Ulica>ul. Mikołowska</wnio:Ulica>
                                        <wnio:NrDomu>100</wnio:NrDomu>
                                        <wnio:NrLokalu>924</wnio:NrLokalu>
                                        <wnio:Miejscowosc>Katowice (miasto)</wnio:Miejscowosc>
                                        <wnio:KodPocztowy>40-065</wnio:KodPocztowy>
                                        <wnio:Poczta>Katowice</wnio:Poczta>
                                    </wnio:AdresSiedzibyZamieszkania>
                                </wnio:Podatnik>
                                <wnio:PozycjeSzczegolowe>
                                    <wnio:D.1>
                                        <wnio:P_22/>
                                        <wnio:P_23/>
                                    </wnio:D.1>
                                    <wnio:D.2>
                                        <wnio:P_28/>
                                        <wnio:P_29/>
                                    </wnio:D.2>
                                    <wnio:P_82/>
                                    <wnio:P_83/>
                                </wnio:PozycjeSzczegolowe>
                                <wnio:Zalacznik_DT-1A>
                                    <wnio:P_1/>
                                    <wnio:P_2/>
                                    <wnio:P_22>1</wnio:P_22>
                                </wnio:Zalacznik_DT-1A>
                                <wnio:Zalacznik_DT-1A>
                                    <wnio:P_1/>
                                    <wnio:P_2/>
                                    <wnio:P_22>3</wnio:P_22>
                                </wnio:Zalacznik_DT-1A>
                            </wnio:Deklaracja>and an overloaded function:
    function dodaj_DT1_z_xml(p_dt1 in out nocopy XMLType) return number as
      r_dt1   POD_SRTR_DT1%rowtype;
      r_dt1a  POD_SRTR_DT1A%rowtype;
      r_sdek  POD_SRTR_DEKLARACJE%rowtype;
      l_wariantDT1  number(2);
      l_xosf  XMLType;
      l_xosp  XMLType;
      l_xadr  XMLType;
      l_xszcz XMLType;
      l_zal   XMLType;
      l_z     XMLType;
      l_zno   pls_integer;
      l_xml   XMLType;
      l_ns    varchar2(10);
    -- xmlns:wnio="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/"
    begin
      if --p_dt1.existsNode('/wnio:Deklaracja')=0 and
         p_dt1.existsNode('/Deklaracja','xmlns:wnio="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/"')=0
      then  return -2;  end if;
      if p_dt1.existsNode('/wnio:Deklaracja')=1 then
        l_ns := 'wnio:';
      end if;
      if p_dt1.existsNode('/'||l_ns||'Deklaracja')=0 then                     return -2;  end if;
      if p_dt1.existsNode('/'||l_ns||'Deklaracja/'||l_ns||'Naglowek')=0 then            return -3;  end if;
      if p_dt1.existsNode('/'||l_ns||'Deklaracja/'||l_ns||'Podatnik')=0 then            return -4;  end if;
      if p_dt1.existsNode('/'||l_ns||'Deklaracja/'||l_ns||'PozycjeSzczegolowe')=0 then  return -5;  end if;
      return 1;
    end;
    function dodaj_DT1_z_xml(p_dt1 in out nocopy CLOB) return number is
      l_xml   XMLType;
    begin
      l_xml := XMLType(p_dt1);
      return dodaj_DT1_z_xml(l_xml);
    end dodaj_DT1_z_xml;I run the code:declare
      v_clob  CLOB;
      v_out   number;
    begin
      SELECT dok_content INTO v_clob FROM EPUAP.epuap_dokumenty WHERE dok_id=13;
      v_out := POD_PCK_SRTR_DT1.DODAJ_DT1_Z_XML(v_clob);
      DBMS_OUTPUT.put_line(v_out);
    end;the output is -2. What must I change to find the node "wnio:Deklaracja"? I'm newbie in XML and namespaces :(
    Help me, please...
    Oracle version is 10.2.0.3

    Hi,
    If you declare a namespace prefix then corresponding elements must be qualified.
    So, either do :
    p_dt1.existsNode('/wnio:Deklaracja','xmlns:wnio="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/"')or use a default namespace declaration :
    p_dt1.existsNode('/Deklaracja','xmlns="http://test.epuap.gov.pl/FeResourceServlet/wzor_lokalny/InstytucjaPubliczna/Deklaracja_DT/"')BTW, could you explain what are you trying to accomplish?

  • Problem with namespace prefix

    Dear all,
    I'm using code generated by NW Developer Studio  2004s for use inside Portal components acting as a web service consumer. The problem is that the code generated includes a namespace prefix for each element in the body of the message, but ECC (ERP 6.0) doesn't like the namespace prefixes (the namespace was not recognised by the ECC mapping tool.)and throws back a DeliveryException.
    The SOAP message created by the generated NWDS code is:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wn3="http://www.w3.org/1999/XMLSchema" xmlns:wn2="http://www.w3.org/2000/10/XMLSchema" xmlns:wn1="http://www.w3.org/2001/XMLSchema" xmlns:wn0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wn4="urn:sap-com:document:sap:rfc:functions" xmlns:tns="urn:sap-com:document:sap:rfc:functions">
    - <SOAP-ENV:Body>
    - <wn4:Z_APPOINTMENT_GET_JCO_ORG>
      <wn4:DATE_FROM>2007.01.01</wn4:DATE_FROM>
      <wn4:DATE_TO>2008-02-02</wn4:DATE_TO>
      <wn4:USERID>EGREO</wn4:USERID>
      </wn4:Z_APPOINTMENT_GET_JCO_ORG>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    I've had a very good look around the generated code - the serializers for creating the soap request - but could not find what exactly might be changed to leave off the prefixes.
    I am using portal server 2004s
    Many thanks for any advice/help
    Reza

    I find out how should I do that.
    /Reza

  • XML Namespace Prefix Lost

    I am working on a RFC to JMS scenario and am having trouble getting the XML in the required format.  I have loaded the XML file provided in my mapping.  However the result was not what I had anticipated.
    <br>
    This is the XML provided and what I want to produce:
    <br>
    <
    ?xml version="1.0" encoding="UTF-8" ?>  <br>
    <MyNS3:Maint_Struc <br>
       xmlns:MyNS1="http://www.MyTest.com/My_Namespace/Part1"   <br>
       xmlns:MyNS2="http://www.MyTest.com/My_Namespace/Part2"   <br>
       xmlns:MyNS5="http://www.MyTest.com/My_Namespace/Part5"   <br>
       xmlns:MyNS3="http://www.MyTest.com/My_Namespace/Part3"   <br>
       xmlns:MyNS4="http://www.MyTest.com/My_Namespace/Part4"   <br>
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        <br>
       xsi:schemaLocation="www.MyTest.com/My_Namespace/Part3 file:/C:/MyStructure.xsd">
    <br>
       <
       MyNS2:SubStruc_1>   <br>
         <
         MyNS2:Fld_1_1_A>Value001<
         /MyNS2:Fld_1_1_A>  <br>
         <
         MyNS2:Fld_1_1_B>Value002<
         /MyNS2:Fld_1_1_B> <br>
       <
       /MyNS2:SubStruc_1> <br>
    <br>
       <
       MyNS3:SubStruc_2>  <br>
          <
          MyNS1:SubStruc_2_1>  <br>
            <
            MyNS1:Fld_2_1_A>Value003<
            /MyNS1:Fld_2_1_A>   <br>
            <
         MyNS1:Fld_2_1_B>Value004<
    /MyNS1:Fld_2_1_B>  <br>
          <
    /MyNS1:SubStruc_2_1>  <br>
          <
    MyNS4:Fld_2_A>Value005<
    /MyNS4:Fld_2_A>  <br>
          <
    MyNS4:Fld_2_B>Value006<
    /MyNS4:Fld_2_B>  <br>
       <
    /MyNS3:SubStruc_2>  <br>
    <br>
       <
    MyNS3:SubStruc_3>  <br>
          <
    MyNS5:SubStruc_3_1>  <br>
             <
    MyNS5:Fld_3_1_A>Value007<
    /MyNS5:Fld_3_1_A>  <br>
             <
    MyNS5:Fld_3_1_B>Value008<
    /MyNS5:Fld_3_1_B>  <br>
          <
    /MyNS5:SubStruc_3_1> <br>
          <
    MyNS3:Fld_3_A>Value009<
    /MyNS3:Fld_3_A>  <br>
          <
    MyNS5:Fld_3_B>Value010<
    /MyNS5:Fld_3_B>  <br>
          <
    MyNS2:Fld_3_C>Value011<
    /MyNS2:Fld_3_C>  <br>
       <
    /MyNS3:SubStruc_3>  <br>
    <
    /MyNS3:Maint_Struc>  <br>
    <br>
    However I am getting the following when mapped: <br>
    <
    ?xml version="1.0" encoding="UTF-8"?> <br>
    <
    ns0:Maint_Struc   <br>
       xmlns:MyNS4="http://www.MyTest.com/My_Namespace/Part4"  <br>
       xmlns:MyNS5="http://www.MyTest.com/My_Namespace/Part5"  <br>
       xmlns:MyNS2="http://www.MyTest.com/My_Namespace/Part2"  <br>
       xmlns:MyNS1="http://www.MyTest.com/My_Namespace/Part1"  <br>
       xmlns:ns0="http://www.MyTest.com/My_Namespace/Part3"  <br>
       xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance"  <br>
       ns1:schemaLocation="www.MyTest.com/My_Namespace/Part3 file:/C:/MyStructure.xsd"> <br>
       <
    ns2:SubStruc_1 xmlns:ns2="http://www.MyTest.com/My_Namespace/Part2">  <br>
          <
    ns2:Fld_1_1_A>Value001<
    /ns2:Fld_1_1_A>  <br>
          <
    ns2:Fld_1_1_B>Value002<
    /ns2:Fld_1_1_B>  <br>
       <
    /ns2:SubStruc_1>  <br>
    <br>
       <
    ns0:SubStruc_2>  <br>
          <
    ns3:SubStruc_2_1 xmlns:ns3="http://www.MyTest.com/My_Namespace/Part1">  <br>
             <
    ns3:Fld_2_1_A>Value003<
    /ns3:Fld_2_1_A>  <br>
             <
    ns3:Fld_2_1_B>Value004<
    /ns3:Fld_2_1_B>  <br>
          <
    /ns3:SubStruc_2_1>  <br>
          <
    ns4:Fld_2_A xmlns:ns4="http://www.MyTest.com/My_Namespace/Part4">Value005<
    /ns4:Fld_2_A>  <br>
          <
    ns4:Fld_2_B xmlns:ns4="http://www.MyTest.com/My_Namespace/Part4">Value006<
    /ns4:Fld_2_B>  <br>
       <
    /ns0:SubStruc_2>  <br>
    <br>
       <
    ns0:SubStruc_3> <br>
          <
    ns5:SubStruc_3_1 xmlns:ns5="http://www.MyTest.com/My_Namespace/Part5"> <br>
             <
    ns5:Fld_3_1_A>Value007<
    /ns5:Fld_3_1_A>  <br>
             <
    ns5:Fld_3_1_B>Value008<
    /ns5:Fld_3_1_B> <br>
          <
    /ns5:SubStruc_3_1>  <br>
          <
    ns0:Fld_3_A>Value009<
    /ns0:Fld_3_A>  <br>
          <
    ns5:Fld_3_B xmlns:ns5="http://www.MyTest.com/My_Namespace/Part5">Value010<
    /ns5:Fld_3_B>  <br>
          <
    ns2:Fld_3_C xmlns:ns2="http://www.MyTest.com/My_Namespace/Part2">Value011<
    /ns2:Fld_3_C>  <br>
       <
    /ns0:SubStruc_3>  <br>
    <
    /ns0:Maint_Struc>  <br>
      <br>
    Things that are wrong with the mapped XML:  <br>
    - the namespace "http://www.MyTest.com/My_Namespace/Part3" was prefixed with MyNS3 but XI reassigned it to ns0
      <br>- original prefixes are not used in the element tags  <br>
      <br>
    Appreciate if anyone can help.  <br>
    Thanks.

    Thank you for all your valuable suggestions.  Does any know why XI/PI does not acknowledge/use the namespace prefix that is defined in the XML?  Is there no other way around this short-coming apart from using XSLT mapping? 
    <br>
    I did try using the anonymizer (as suggested by Manjusha).  With the anonymizer I am able to change the namespace prefix in the element tags to the way I want it.  However the namespace definition is still showing in the element tag.
    <br>
       <MyNS2:SubStruc_1 xmlns:MyNS2="http://www.MyTest.com/My_Namespace/Part2">  <br>
          <MyNS2:Fld_1_1_A>Value001</MyNS2:Fld_1_1_A>  <br>
          <MyNS2:Fld_1_1_B>Value002</MyNS2:Fld_1_1_B>  <br>
       </MyNS2:SubStruc_1>  <br>
      <br>
    This is almost perfect only if I am able to remove the definition xmlns:MyNS2="http://www.MyTest.com/My_Namespace/Part2" from the element tag.  Suggestion any one?
    Thanks All.

  • Adding namespace prefix to the XMLa root element

    I am facing a problem in our application. I am assigning an XML content to a XSD variable. While assignment operation is performed the prefix of the XML root element alone is getting replaced with default namespace, though the source XML has the prefix. Please let me know if any patch or workaround is available to address this issue.
    Thanks!

    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

  • How can I delete credit card info from my account?

    have tried every way and it will not let me. Have cancelled auto renew but still no joy. I have now figured out that my credit card details were probably also hacked as well as my email account details. Grrr!

  • HDMI, Mini Display Port and Mountain Lion

    Hello, After reading about numerous issues concerning the Mini Display Port and Mountain Lion, I'm trying to discuss it here with you all to see if there is any solution. I have a MacBook Pro (2009), and used it with my TV (HDMI cable + Mini display

  • How can I see only new topics from selected spaces on one page?

    Just wondering how can I do the subj. For instance, Im interested only in Database space, and only in several sub-spaces like high availability, upgrade, general. So, I would like to see new topics only from these areas on single page. how can I do t

  • Group and table visibility

    Hello Friends, I am facing a problem as follows: In an existing application I am trying to modify some code: there is a group which contains two tables the visibility of both tables are set to context element node also called visibility: and its elem

  • BIC Mapping new Version

    HI can anyone explain me how to use EDI 850 4030 Version Mappings in BIC We have standard mapping for 4010 version Thanks, Singh.