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>
Similar Messages
-
SQL function to extract XML 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')
ThanksTry DBMS_XMLDOM.GetNameSpace
-
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.3Hi,
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? -
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.
ThanksHi ,
>>>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. -
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,
SandeepHi 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 -
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. -
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 AMMaybe 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é -
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
RezaI find out how should I do that.
/Reza -
Hello,
our partner uses Biztalk to receive our SOAP calls. They tell us that each attribute and element needs to have the namespace prefix otherwise Biztalk cannot read it.
We are sending:
SAP XI Output
<?xml version="1.0" encoding="utf-8" ?>
<ns11:Receive_SAP xmlns:ns11="http://zzz.com/it/mmpur/sem/xi">
<part>
<xform id="SWI:PLG:Order Header - SAP">
<model>A</model>
</xform>
</part>
</ns11:Receive_SAP>
They want:
Biztalk Requirement:
<?xml version="1.0" encoding="utf-8" ?>
<ns11:Receive_SAP xmlns:ns11="http://zzz.com/it/mmpur/sem/xi">
<ns11:part>
<ns11:xform id="SWI:PLG:Order Header - SAP">
<ns11:model>A</ns11:model>
</ns11:xform>
</ns11:part>
</ns11:Receive_SAP>
Can that be done with the XI 3.0 Graphical mapping or do I have to use JAVA Mapping or XSLT?
Did anyone come accros this before with Biztalk Server and it there an option to avoid it on the Biztalk Server side?
Thanks
StefanHi Stefan,
Where did you obtain the schema (XSD) from?
Most likely, the elements you are using are local elements and do not belong to the target namespace, but to an unnamed global namespace. This is a typical characteristic of schema's defined by SAP.
The short answer/solution is probably putting elementFormDefault="true" in the header of your target schema. That should do the trick.
Kind regards, Guy Crets -
Namespace prefix: Using Anonymizer
Hi guys,
I'm having some difficulties using XMLAnonymizer for placing some namespace prefix's in my message.
After sending the message, I can check on RWB that the module Anonymizer is loaded, but results in the following:
2007-06-21 16:55:45 Success MP: processing local module localejbs/AF_Modules/XMLAnonymizerBean
2007-06-21 16:55:45 Warning Anonimizer: message is empty or has no payload
2007-06-21 16:55:45 Success MP: leaving
Well, why do I have message empty? to what message is he referring to?
Why do I need Anonymizer? Well, the thing is, some namespace prefixes are not being place on the sent message. Without this prefixes the actual mapping fails and no fields are mapped....
Can you give me a hand?Hi Stefan,
Thanks for your reply! It works, well, the anonymizer gets the message, but now I've another question....
2007-06-22 11:04:41 Success New JMS message with JMS message ID ID:f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f1f8404040404040 received. The XI message ID for this message is fe826d20-20a7-11dc-8363-00145e1855ec
2007-06-22 11:04:41 Success JMS message converted to XI message format successfully
2007-06-22 11:04:41 Success Anonimizer: anonymizing XML ...
2007-06-22 11:04:42 Success Anonimizer: successfully anonymized
2007-06-22 11:04:42 Success Application attempting to send an XI message asynchronously using connection AFW.
2007-06-22 11:04:42 Success Trying to put the message into the send queue.
2007-06-22 11:04:42 Success Message successfully put into the queue.
I've checked my message but a strange thing happened, maybe I've misunderstood the anonymizer function....
The original message was:
So the namespaces introduced were deleted. But What I thought it was going to happen was that the Anonymizer would introduce the prefix ns0 and ns1 on the tags that had the namespace declaration.... Is this possible with the anonymizer?
Problem solved.... it was a wrong namespace :S
Thanks for the help Anonymizer does wonders and saves a hell lot of time
Message was edited by:
Gonçalo Mouro Vaz -
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.
FrankIssue was solved, found it in the bi publisher options in word 2003
-
SOASuite 11g
Oracle Weblogic Server 10.3.3
Oracle Solaris on SPARC (64-bit) 10
Database: Oracle Server - Enterprise Edition 10.2.0.5
When I start the SOA domain server, I find the following in the log file:
<Feb 25, 2011 10:41:23 AM CET> <Error> <org.apache.commons.digester.Digester> <BEA-000000> <Parse Error at line 9 column 79: <Line 9,
Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
org.xml.sax.SAXParseException: <Line 9, Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:342)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)
at org.apache.commons.digester.Digester.parse(Digester.java:1785)
at oracle.fabric.composite.Parser.parseComposite(Parser.java:132)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.deployComposite(WLSFabricKernelInitializer.java:493)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.prepareCompositeDeployments(WLSFabricKernelInitializer.java:
239)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.init(WLSFabricKernelInitializer.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1976)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1950)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1869)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
>
My composite.xml is:
<composite name="JIPSYHandleRTOTaskEBF" revision="1.0" mode="active" state="on"
xmlns="http://xmlns.oracle.com/sca/1.0"
xmlns:ui="http://xmlns.oracle.com/soa/designer/"^M
xmlns:xs="http://www.w3.org/2001/XMLSchema">^M
<import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
<service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
</composite>
But when it has been deployed, I see that this has been changed into:
<composite name="JIPSYHandleRTOTaskEBF" revision="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
<service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
</composite>
(I exported this from MDS).
Apparently, some namespaces are stripped.
This appears to happen during the deploy (using ant), because the version in the generated jar file is already missing the namespaces.
The BPEL processes appear to work fine though.
Why is this happening and how can I prevent these errors?I've fiddled around with the file composite.xml and found the following workaround:
If I change the start of the file to:
<?xml version="1.0" encoding="UTF-8"?>
<composite name="JIPSYUpdateWorkflowReqABCSImpl"
xmlns="http://xmlns.oracle.com/sca/1.0"
xmlns:ui="http://xmlns.oracle.com/soa/designer/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
revision="1.0"
mode="active"
state="on">
it remains unchanged and the errors during deployment are gone. -
Error: Namespace prefix 'split-by-page-break' used but not declared.
I have my machine reimaged, now when I try to preview an rtf template I get the below error. Nothing has changed in my template and I am using 1.0.0 Build 9 as before my reimage as well. This is an uregent problem that I am not able to find the solution for on my own. Please advise with any help.
Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'split-by-page-break' used but not declared.
at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:782)
at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:564)
... 14 more
ThanksI'm just new to XMLP and am receiving the same error.. My error is occuring when trying to use sub-templates in my master template.
I believe I have the syntax correct:
To import template file:
<?import:file:h:///CN_LTR_TEMPLATES.rtf?>
to call the sub-template:
<?call-template: signature:?>
Its the call-template to signature thats generating my error message.. My only thought is that its not calling my import properly..
Anyway.. Hope this might help you a bit.. you never mentioned anything about using a sub-templates. Perhaps since you formated your computer, your template may be in a different location or gone all together (that is if you are using sub-templates).
If i figure anything out in the mean time, i'll let you know..
Edited by: user8682333 on Aug 16, 2009 6:51 AM
Maybe you are looking for
-
8.1.5 Install Problem: Database Configuration Assistant
I have problems installing Oracle 8.1.5 on Linux. On the "Configuration tools" screen, I get the following error for the 'Oracle Database Configuration Assistant': "A required command line argument is missing" The installation claims the error is not
-
Error Handling in workitem---user decision step
HI Experts, I have created work item through user decision step. In that decision i have given Approve & Reject Option now when user click on Approve that i need to do some validation based on this i need to give error also at same time i dont want t
-
Problem with SpryMenuBarHorizontal on IE any version
I have a problem with SpryMenuBarHorizontal, you do not see the SubMenu on IE. It's ok on Firefox, Safari, Opera, but on any version of IE don't work. I tried to fix the CSS, but nothing. Thank you for your help Margherita
-
Clip play when reach area on page
Hi everyone! Im trying to play a clip that I have made in edge animate on my website, I havent published it yet so i dont have a example but does anyone know how to play a clip when you reach an area of a page? Thansk
-
How to create a transaction variant
Hi Experts, How to create a transaction variant. Regards, Abinaya