Generating repeating XML aggregate using OSB
Hi all,
Following is my scenario:-
I get an XML request as:
<Request>
<aaa>1234</aaa>
<bbb>asdf</bbb>
<ccc>as123</ccc>
<ddd></ddd>
</Request>
I want to transform it into:
<NewRequest>
<test data="aaa" flag="true">
<detail>1234</detail>
<test data="bbb" flag="true">
<detail>asdf</detail>
<test data="ccc" flag="true">
<detail>as123</detail>
<test data="ddd" flag="false">
<detail></detail>
</NewRequest>
Here the element test is the Repeating Aggregate.
I want the element in 1st XML to be the value of attribute 'data' in 2nd XML dynamically.
Also if the element is empty, I want the attribute 'flag' to be false (as in case of ddd in the example); else it should be equal to true (as in case of aaa, bbb, ccc in the example).
Can this be implemented using OSB? Please help me!
Thanks in advance!!
Regards,
Karthik
xquery version "1.0" encoding "Cp1252";
(:: pragma parameter="$anyType1" type="xs:anyType" ::)
(:: pragma type="xs:anyType" ::)
declare namespace xf = "http://tempuri.org/CreateClient/XQuery/otn/";
declare function xf:otn($anyType1 as element(*))
as element(*) {
<NewRequest>
<req>
for $request in $anyType1/*
return
<item>
<test data="{fn:node-name($request)}" flag="{if (data($request)) then 'true' else 'false'}">
<detail>{data($request)}</detail>
</test>
</item>
</req>
</NewRequest>
declare variable $anyType1 as element(*) external;
xf:otn($anyType1)
Similar Messages
-
Hi ,
i need to know how to do accept edifact request and generate corresponding xml response using osb .
Would i need to use B2b adapter for it , please guide me how to proceed further for this .
I have went to url
[http://blogs.oracle.com/oracleb2bgurus/entry/osb_-_b2b_integration_-_edifac]
But how to make B2B Translation webservice and how to use B2B console
Regards,
Abhinav Gupta
Edited by: Abhinav on Jul 13, 2011 6:56 AMHi Anuj,
I tried using Translate web service as you mentioned , i want to translate EDIFACT payload to native using translation web service of B2B.
I used otn sample b2b-003-edifact_orders_1.0_dist
Steps i used are as follows :
1. I created EDIFACT Document Definition Orders_def, using EDIFACT_D98A_ORDERS.xsd and EDIFACT_D98A_ORDERS.ecs provided with sample.
2. Created two partners Acme and GlobalChips and deployed the document definitions on both partners Acme(as sender) and GlobalChips(as receiver).
3. Created Acme_GlobalChips_EDIFACT_D98A_Orders_AS2 agreement and deployed the same also , under managed deployments its showing active also.
4. I imported wsdl of B2B Translate web service and created the Business Service out of it, on OSB.
5. I tested the Business service with EDI payload as following
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://xmlns.oracle.com/integration/b2b">
<ns1:TranslateRequest>
<ns1:from type="Name">Acme</ns1:from>
<ns1:to type="Name">GlobalChips</ns1:to>
<ns1:documentTypeName>ORDERS</ns1:documentTypeName>
<ns1:documentProtocolVersion>D98A</ns1:documentProtocolVersion>
<ns1:action>anyType</ns1:action>
<ns1:encoding>utf-8</ns1:encoding>
<ns1:payload>
<test>
<![CDATA[UNA:+ ? 'UNB+UNOB:1+Acme:ZZ+GlobalChips:ZZ+070223:1027+9158'UNH+12891+ORDERS:D:98A:UN'BGM+105+CP16391+9'DTM+4:2007-02-23:102'RFF+ADE:37027'RFF+VR:90072'NAD+ST+037027.0001++Acme Osteonics SA:Swiss Sales & Distribution:Succ. de Plan-les-Ouates:Chemin des Aulx 5++Plan-les-Ouates++CH-1228+CH'CUX+2:USD:9'LIN+1++0233032300:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:4538'LIN+2++0242720025:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:40460'LIN+3++0266721100:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:3718'LIN+4++0266723100:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:3631'LIN+5++0266724000:VP'QTY+21:5:EA'DTM+2:2007-02-26'PRI+INF:2468'LIN+6++0266725000:VP'QTY+21:4:EA'DTM+2:2007-02-26'PRI+INF:4621'LIN+7++0275720300:VP'QTY+21:6:EA'DTM+2:2007-02-26'PRI+INF:1212'LIN+8++0275720500:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:3759'LIN+9++0275720600:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:6448'LIN+10++0275720700:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:12296'LIN+11++0275723120:VP'QTY+21:1:EA'DTM+2:2007-02-26'PRI+INF:5165'LIN+12++0275725100:VP'QTY+21:4:EA'DTM+2:2007-02-26'PRI+INF:10670'LIN+13++0275725110:VP'QTY+21:3:EA'DTM+2:2007-02-26'PRI+INF:6670'LIN+14++0275725120:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:6227'LIN+15++0300034900:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:66330'LIN+16++0300034901:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:58162'LIN+17++0375565000:VP'QTY+21:4:EA'DTM+2:2007-02-26'PRI+INF:6990'LIN+18++0377030200:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:26510'LIN+19++0377030400:VP'QTY+21:1:EA'DTM+2:2007-02-26'PRI+INF:5439'LIN+20++0377727550:VP'QTY+21:2:EA'DTM+2:2007-02-26'PRI+INF:25365'UNS+S'UNT+89+12891'UNZ+1+9158']]>
</test>
</ns1:payload>
</ns1:TranslateRequest>
</soap:Body>
</soap:Envelope>
response achieved ...
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>
Error -: B2B-52330: Error invoking translation Web Service.
</faultstring>
<faultactor>
http://localhost:7001/b2b/services/TranslateService
</faultactor>
<detail>
<tns:error xmlns:tns="http://xmlns.oracle.com/integration/b2b">
java.lang.Exception:
Error :
Mandatory attribute missing: Standard.
at oracle.tip.b2b.ws.runtime.WebServiceImpl.translateToNative(WebServiceImpl.java:206)
at oracle.tip.b2b.ws.provider.B2BProvider.processTranslateTransport(B2BProvider.java:544)
at oracle.tip.b2b.ws.provider.B2BProvider.processMessage(B2BProvider.java:304)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1187)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1081)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:581)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:232)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:192)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:484)
at oracle.tip.b2b.ws.provider.B2BProviderServlet.doPost(B2BProviderServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
</tns:error>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
Edited by: Abhinav on Jul 19, 2011 5:48 AM -
How do I generate XML File Using JDeveloper 9.0.3
Hi All
I want to generate a XML file against the data in one of my Oracle table,,,, This is the first time I am doing this Task, so please let me know whether I am going through the correct path, or if not appreciate if you could put me to the correct system of doing this please���..
OK , Well I am working to a publishing company in Australia and we have Oracle 8i (Release 3 ) database and I have Oracle JDeveloper (9.0.3 -Preview ) version in my personal computer.
I have a Table(ONIXT4) with three Columns( ISBN,Author,Price) in Oracle as follows:
ISBN Author Price
2512456321 Peter 14.50
7445854127 Ray 21.75
What I want to generate a XML File using JDeveloper as below with respect to data in above Table.
<ISBN>2512456321</ISBN>
<ProductInfor>
<Author>Peter</Author>
<Price>14.50</Price>
</ProductInfor>
<ISBN>7445854127</ISBN>
<ProductInfor>
<Author> Ray </Author>
<Price>21.75</Price>
</ProductInfor>
I created the database connection within JDeveloper to Oracle those working fine,, my major problem is,, the Tag <ProductInfor>, since this is not a Column Name of the Table I don't know how should I incorporate this with the file.
What I did so far with the JDeveloper:
1.Create the Workspace and the Project
2.File -- New -- XML -- XSQL
3.Then I Selected Query from the Component Palette,, Property Values were NOT changed, and gave 'Select * from ONIXT4'
Whole Untitled3.xsql file look likes below
<?xml version = '1.0' encoding = 'windows-1252'?>
<!--
| Uncomment the following processing instruction and replace
| the stylesheet name to transform output of your XSQL Page using XSLT
<?xml-stylesheet type="text/xsl" href="YourStylesheet.xsl" ?>
-->
<page xmlns:xsql="urn:oracle-xsql" connection="Connection1">
<xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
Select * From OnixT4
</xsql:query>
</page>
Then the Result comes as:
<?xml version="1.0" encoding="windows-1252" ?>
- <!--
| Uncomment the following processing instruction and replace
| the stylesheet name to transform output of your XSQL Page using XSLT
<?xml-stylesheet type="text/xsl" href="YourStylesheet.xsl" ?>
-->
- <page>
- <rowset>
- <row num="1">
<isbn>2512456321</isbn>
<author>Peter</author>
<price>14.5</price>
</row>
- <row num="2">
<isbn>7445854127</isbn>
<author>Ray</author>
<price>21.75</price>
</row>
</rowset>
</page>
How do I format the outcome to obtain the my requirement??
Welcome all comments of donig this ....To format your XML to the requiered output you'll use a stylesheet and XSLT
As it says in your output:
- <!--
| Uncomment the following processing instruction and replace
| the stylesheet name to transform output of your XSQL Page using XSLT
<?xml-stylesheet type="text/xsl" href="YourStylesheet.xsl" ?>
-->
A nice tutorial on XSLT is available on the XML technology center in OTN:
See Transforming XML with XSLT
http://otn.oracle.com/tech/xml/learner.html -
Generating an XML Document from an internal table in ABAP
Good day to all of you;
With ABAP, in the R/3 system, I'm trying to figure out a way to accomplish the following:
1) SELECT a set of Purchase Order data into an internal table.
2) Generate an XML document, containing the above data, using a specific schema.
I've been playing around with function module SAP_CONVERT_TO_XML_FORMAT which has the following interface:
CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ''
I_LINE_HEADER = ''
I_FILENAME = v_fname
I_APPL_KEEP = ''
I_XML_DOC_NAME = v_docname
IMPORTING
PE_BIN_FILESIZE = v_byte
TABLES
I_TAB_SAP_DATA = i_SapData
CHANGING
I_TAB_CONVERTED_DATA = i_XMLData
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
I'm uncertain as to whether or not the Export parameter, I_XML_DOC_NAME refers to some schema or definition and therefore have been excluding it. In doing so, the generated XML document seems to use the field name/type information from my itab for the tags.
If this function module requires an XML Document Name, how do I create one and where do I store it in R/3? If this is not the recommended solution, is anyone familiar with a way to load an XML schema, retrieve some data then have SAP generate an XML document using the schema?
Many thanks for any help available.
THai Phillips
Try with the following Code
This program exports an internal table to an XML file.
Report ZPRUEBA_MML_13 *
Export an internal table to XML document *
NO BORRAR ESTE CODIGO *
REPORT ZPRUEBA_MML_13.
PANTALLA SELECCION *
PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
PANTALLA SELECCION *
TYPE TURNOS *
TYPES: BEGIN OF TURNOS,
LU LIKE T552A-TPR01,
MA LIKE T552A-TPR01,
MI LIKE T552A-TPR01,
JU LIKE T552A-TPR01,
VI LIKE T552A-TPR01,
SA LIKE T552A-TPR01,
DO LIKE T552A-TPR01,
END OF TURNOS.
TYPE TURNOS *
TYPE SOCIO *
TYPES: BEGIN OF SOCIO,
NUMERO LIKE PERNR-PERNR,
REPOSICION LIKE PA0050-ZAUVE,
NOMBRE LIKE PA0002-VORNA,
TURNOS TYPE TURNOS,
END OF SOCIO.
TYPE SOCIO *
ESTRUCTURA ACCESOS *
DATA: BEGIN OF ACCESOS OCCURS 0,
SOCIO TYPE SOCIO,
END OF ACCESOS.
ESTRUCTURA ACCESOS *
START OF SELECTION *
START-OF-SELECTION.
PERFORM LLENA_ACCESOS.
PERFORM DESCARGA_XML.
END-OF-SELECTION.
END OF SELECTION *
FORM LLENA_ACCESOS *
FORM LLENA_ACCESOS.
REFRESH ACCESOS.
CLEAR ACCESOS.
MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
CLEAR ACCESOS.
MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
ENDFORM.
FORM LLENA_ACCESOS *
FORM DESCARGA_XML *
FORM DESCARGA_XML.
DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
G_IXML TYPE REF TO IF_IXML,
W_STRING TYPE XSTRING,
W_SIZE TYPE I,
W_RESULT TYPE I,
W_LINE TYPE STRING,
IT_XML TYPE DCXMLLINES,
S_XML LIKE LINE OF IT_XML,
W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
D LIKE LINE OF XML,
END OF XML_TAB.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
WRITE: / 'Converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'ACCESOS'
DATAOBJECT = ACCESOS[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
IF W_RC IS INITIAL.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
W_RC.
ENDIF.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = M_DOCUMENT
IMPORTING
XML_AS_STRING = W_STRING
SIZE = W_SIZE
TABLES
XML_AS_TABLE = IT_XML
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
LOOP AT IT_XML INTO XML_TAB-D.
APPEND XML_TAB.
ENDLOOP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = GK_RUTA
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
FORM DESCARGA_XML *
Thanks & regards
Sreenivasulu P -
Generation of XML file using DMEE format tree
Hi Experts,
Can you please provide all the steps to generate a XML file using a DMEE format tree.
Thanks in adavance!!!
Regards,
Vishal.Hi,
you can do it exaclty the same way like creating ordinary flat file.
You can find also some examples made by SAP. Search format tree with this pattern: XML -
How do we create generate webservices.xml file?
Hi all,
Im new to webservices...
im able to generate mapping.xml file using wsgenerate
but i dont know how do we generate webservices.xml.
Im waiting for ur reply.
http://tech.groups.yahoo.com/group/completeJava/
http://tech.groups.yahoo.com/group/completeJava/messages
http://completejava-group.blogspot.com/You use the web interface of xmlsidecar generator made by Johannes Henseler and the push the button there "generate". Copy paste that into a plain text file and then change tex extension from txt to xml. That's how you do a sidecar.xml the easy way.
Afterwards, yo've got to import "multiple files" (or "many files"... my DPS is a Spanish one) from Folio Builder.
If the folder are structured properly, folio builder will start swallowing the data of sidecar and uploading the articles.
Right now, while posting this, my pc is doing that with about one hundred articles. As happy and busy as a beaver in heat
Gustavo (Posting from Madrid) -
How to automatically generate build.xml file in eclipse?
Hello every body,
I am learning about ANT. e.g I have writen a very simple programme which displays output "no worries". But how can I compile it with ANT and how can I generate build.xml file using eclipse.This is not really a Java issue but rather is an Eclipse issue. You may wish to look for their support sites or forums.
-
Reading large XML file using a file event generator and a JPD process
I am using a FileEventGenerator and a JPD Subscription process to read a large XML file. The large XML file basically contains repeated XML elements. My understanding is that the file subscription method reads the whole file in memory which causes lots of problem for huge file size like 1MB. Is there a way to read the file size-wise or is there a way to read chunks of data from a large size file..or any other alternative. I would like to process the file in a loop iteration by iteration.
Hitejain,
Here are a couple of pointers you could try. One is that the file event generator has a pass by reference (filename) functionality which you could use so that you could do the following inside of your process.
1) Read file name from the reference
2) Move the file to a processed directory (so it doesn't get picked up again. Note: I don't know how the embedded archive methods of the file event generator plays with pass by reference.
3) Open a stream to the file.
4) Use a SAX or SAX - DOM combined approach to parse your XML while managing the memory usage inside of your process
There is another possibility which might fit your needs and it is related to the RawData object that BEA provides. If I understand it correctly provides wrapping functionality around a stream object, but depending on your parsing methods might just postpone the problem.
Hope this helps
Chris Falling
Stormforge Software -
Using a variable value in CDATA for generating an XML type in Oracle
Hello,
I have prepared a function given below where I have some input variables & I have to generate one XML with those input variables as tag attribute value:
create or replace function NEW_PROJECT_DETAILS
( p_ReferenceId in varchar2 ,
p_Project_No in varchar2,
p_Project_Name in varchar2,
p_Project_Desc in varchar2 ,
p_Project_Type in varchar2,
p_Project_Location in varchar2,
p_Project_Status in varchar2 )
return xmltype
as
payload xmltype;
begin
dbms_output.put_line('Payload Started');
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation><![CDATA[p_Project_Location]]></ProjectLocation>
/* <ProjectLocation>'||p_Project_Location||'</ProjectLocation> */
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');
dbms_output.put_line('Payload Comp1');
return payload;
end;
This procedure works absolutely fine.
Now the problem which I am having is that the variable p_Project_Location has value like "6747:BBO&M SBV".
Due to the '*&*' in that value I have to use CDATA. But i dont know how to pass this variable directly in the CDATA in the XML.
Please help me with this asap.
Thanks & Regards,
Divya Aggarwal
Edited by: 784414 on Dec 2, 2010 4:15 AM
Edited by: 784414 on Dec 2, 2010 4:16 AMHi,
If you absolutely want to use a CDATA section, then :
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation><![CDATA['||p_Project_Location||']]></ProjectLocation>
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');Alternatively, you can escape non valid characters with DBMS_XMLGEN.CONVERT, e.g. :
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation>'||dbms_xmlgen.convert(p_Project_Location)||'</ProjectLocation>
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');which outputs :
<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>1</RefID>
<ProjectNo>1</ProjectNo>
<ProjectName>PRJ1</ProjectName>
<ProjectDesc>This is project 1</ProjectDesc>
<ProjectType>P</ProjectType>
<ProjectLocation>6747:BBO&M SBV</ProjectLocation>
<ProjectStatus>S</ProjectStatus>
</ProjectDetails>Any basic XML parser should then convert back escaped characters when processing the document.
You can also use SQL/XML functions, which will take care of that automatically.
For example :
SELECT appendChildXML(
XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
XMLForest(
'1' as "RefID",
'1' as "ProjectNo",
'PRJ1' as "ProjectName",
'This is project 1' as "ProjectDesc",
'P' as "ProjectType",
'6747:BBO&M SBV' as "ProjectLocation",
'S' as "ProjectStatus"
FROM dual;or,
SELECT appendChildXML(
XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
XMLForest(
'1' as "RefID",
'1' as "ProjectNo",
'PRJ1' as "ProjectName",
'This is project 1' as "ProjectDesc",
'P' as "ProjectType",
XMLCData('6747:BBO&M SBV') as "ProjectLocation",
'S' as "ProjectStatus"
FROM dual; -
Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf
Hi,
I have a requirement to display output from a particular table in XL format. Out of all the known possible options, I am planning to use the XML publisher to generate XL output.
For the data source, instead of using the conventional way of creating XML data using rdf,I am planning to use DBMS_XMLGEN.getxmltype pl/sql procedure to generate the XML output. And from the output, call the template to generate the required Excel output.
Now, I am using the following code to generate XML output but am not sure how to proceed from here. I need to first print the XML data in the FND Output file after which I was planning to call the 'XML Report Publisher' (XDOREPPB) program and use the current request id to get the excel output but I am not able to find the way to print the XML data in the output file as:
fnd_file.put_line (fnd_file.output, l_xml_type); - is throwing an error as l_xml_type is an XML data output.
PROCEDURE xml_main (
errbuf OUT VARCHAR2
,retcode OUT VARCHAR2
,p_project_from IN VARCHAR2
,p_project_to IN VARCHAR2
AS
l_xml_type XMLTYPE;
BEGIN
SELECT DBMS_XMLGEN.getxmltype
('SELECT fnd_global.conc_request_id
,TO_CHAR (segment1)
,to_char(start_date,''MM/DD/RRRR'')
,to_char(xxmcc_project_details_pkg.current_profit_projection
(project_id),''999,999,990.90'')
,to_char(xxmcc_project_details_pkg.cost_to_date (project_id),''999,999,990.90'')
,''1''
FROM pa_projects_all
WHERE segment1 BETWEEN NVL (p_project_from, segment1)
AND NVL (p_project_to, segment1)')
INTO l_xml_type
FROM DUAL;
fnd_file.put_line (fnd_file.output, l_xml_type);
END xml_main;
Can anyone point me as to how to publish XML output using a PL/SQL procedure (DBMS_XMLGEN.getxmltype)
Thanks.Pl see if the example included in this presentation helps http://www.oracle.com/technology/products/applications/Events/OOW-2006/EBS/S281401_Sridhar_Bogelli.pdf
Also, you do not need to explicitly call XDOREPPB in later versions of XML Publisher. If you set up everything correctly (as described in the presentation above and the link below) the Output Post Processor is called automatically after the XML file is generated successfully.
Another excellent tutorial is at http://www.oracle.com/technology/obe/fusion_middleware/fusion/bi/xmlp_ebiz/index.html
HTH
Srini -
Generate XML report using MAX Generate report.vi
Hi All,
Caught in simple and wierd problem. I'm using a simle VI called MAX Generate Reoprt.vi to generate an XML report but getting error
Error code -2147220553
Error description :Incorrect report file extension provided.
The image of the block diagram is attached. I'm able to generate HTML reoport from MAX(absolutely no probs).
Thanks in advance
Regards
VDC
Attachments:
Error_in_MAX.JPG 7 KBYou must have the correct file extention. Here's what is wirtten in the detailed help of the function:
output filename specifies the filename of the generated report.
You must have the correct extension for the type of report to generate (.xml, .htm, .html, or .zip).
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions -
Error while printing generated XML doc using DBMS_OUTPUT
while generating XML document using XDK for PL/SQL i am getting " ORU-10027: buffer overflow, limit of 1000000 bytes " error even though i had set DBMS_OUTPUT to 1000000.
Is there any way to getrid of this problem .
i am using this code ..
CREATE OR REPLACE procedure SQLToXML1 is
queryCtx DBMS_XMLquery.ctxType;
result CLOB;
begin
DBMS_OUTPUT.ENABLE (1000000);
queryCtx := DBMS_XMLQuery.newContext ('select * from depolib_library' )
result := DBMS_XMLQuery.getXML(queryCtx);
printClobOut(result);
DBMS_XMLQuery.closeContext(queryCtx);
exception
when others then
dbms_output.put_line(sqlerrm);
end;
urgent help is needed
Thanks
nullNo, It is a PO Print only. Only for changes to PO that do not affect the value of the PO,this error occurs. When i select the entry for the PO and click on Output message, the output message fails. On clicking Display Message, it shows the message - No schedules exist for the Scheduling Agreement XXXXXX(the PO number".
So,it is not for Scheduling Agreements but for PO only. I know it is weird to see such an error on the PO output message in ME9F.
Pls help. -
Generating XML Payload using outbound interface
Hi Members ,
I have a requirement which is not that clear or details of which are not exactly known.But I just know that I have to outbound some accounting information basically GL Account segment values .Thing is I have done some interfaces before but was using UTL_FILE to have delimiter files. Please let me know how to generate XML file in our case?
Is it something I can leverage in R12 the XML Gateway ??
Appreciate help.
Thanks
Narayana1) First you have yo create map using message designer(map between DTD and DataBase). Please refer user guide for more details.
2) Load Map
3) use ecx_oubound.getxml for generating an xml with the map code given -
Generic Populating the XML document using Java Class Generator and Reflection
I am looking for a generic source code in order to convert the data parsed from any tabular text form ( tab delimited for example that maps certain XML Schema created form Database Schema for Oracle.
I know it is possible to generate XML DTD or XSD from Oracle database table schema by XSU utility from XDK. And also it is possible to create Java source files from an XML DTD or XSD by using XML Clas Generator.
I believe there must be some generic code that parses tabular text data and converts them to XML format using above mentioned generated Java source files and may be Java reflection mechanism.
If anyone has any tool or knows any free ware that helps me, I would like to know about it, and I would really appreciate it.1. Read the XML file into a DMO object, walk the DOM to find the list, insert your new entry as a child, write the DOM back to a file.
2. If the XML is not in a file, but in a string, then you can do the same with string input and output. -
Generating a XML using XML Schema
Hi,
I have a requirement where I need to generate a XML which should follow XML Schema. If XML schema changes, i should still be able to generate XML file. Any sample code or idea will help me.http://java.sun.com/webservices/jaxb/users-guide/jaxb-using.html
This tutorial is a good place to start. ideally you will use the xjc.bat file present in
jwsdp-2.0 (thats whaty i use) to generate a package full of classes that corresponds to your
schema.
Use ANT-build script to generate this package then you will do some marshalling
followed by validating against a DTD, and unmarshalling - to do get java objects out of XML
Maybe you are looking for
-
Moving iTunes library to new pc on Windows 8
I have moved my library across using an external hard drive and following these instructions http://support.apple.com/en-us/HT4527 It still doesn't work and I get an error message saying "The iTunes Library.itl file cannot be found or created. The de
-
Upgrade Forms from 9.0.4 to 10.1.2
I'm trying to determine the steps required to upgrade forms from 9.0.4 to 10.1.2 (OAS 10gR1 to OAS 10gR2). Is it just a simple: "open in 10.1.2, compile, save, close" for each form? Thanks, Meredith
-
Restricting Thread Pool for Servlet instances
I am using WebLogic5.1.0 version wherein I am registering a Servlet which would be called by all the clients connecting to my aplication. The servlet's service methods is taking some time to execute. Since the servlet is following a SingleThreadModel
-
undo and redo buttons are not working
-
Subcontracting Scrap with J1IfQ Reconciliation
Hi All, My client is sending HR Coils (XYZ) and making it into Sllit Coils(ABC) , so scrap is generated during operation and sent back to client with slit coil. I am not clear on the scrap procss to map at the time of GR as well as for 57F4 Challan R