Extract the job advertisement into a XML-Schema
Hi there,
I have to extraxt the job advertisements in a xml-Schema for making our E-Recruiting compatible to a job-exchange.
Is there a report or tc or something else which extracts the information of the job advertisement in a xml?
Or if not how and where can I read out my Informations about the company or the duration of my job advertisement e.g.
And after I have this information, how can I prepare the information into a dtd (XML-Schema)
Thx for answers
Yes, in fact I solved to do that, now I'm getting a differente problem, I'm trying to get the content to a file, but with no success, I'm getting just "[Document]: #null" into my file, maybe I'm doing something wrong when I try to write it, here's my code in case you or someone else can help me telling me what do I really have to do, thanks in advance.
public class XMLTransformer {
public static void main(String[] args) throws Exception {
try {
String xml_doc = //"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
//"<!DOCTYPE web-app PUBLIC \"C:\\sms.dtd\">\n" +
"" +
"<root>\n" +
"<sms>\n" +
"<tlf>584123161640</tlf>\n" +
"<op>D</op>\n" +
"<sc>3344</sc>\n" +
"<body>MENSAJE</body>\n" +
"</sms>\n" +
"</root>";
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//Document document = builder.parse(xml_doc);
InputSource inStream = new InputSource();
inStream.setCharacterStream(new StringReader(xml_doc));
Document doc1 = builder.parse(inStream);
File f1 = new File ("c:/salida.xml");
FileWriter out1 = new FileWriter(f1);
PrintWriter wr = new PrintWriter(out1);
f1.createNewFile();
//String inputLine;
//while ((inputLine = lector.readLine()) != null)
wr.write(doc1.toString());
//lector.close();
out1.close(); }
Similar Messages
-
How to extract the nodes of any given XML document ???
Hello,
Greetings! It is an interesting forum.
A Snippet of XML Schema PurchaseOrder.xsd as given in user guide is as follows
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
version="1.0" xdb:storeVarrayAsTable="true">
<xs:element name="PurchaseOrder" type="PurchaseOrderType"
xdb:defaultTable="PURCHASEORDER"/>
<xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
<xs:sequence>
<xs:element name="Reference" type="ReferenceType" minOccurs="1"
xdb:SQLName="REFERENCE"/>
<xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
<xs:element name="Reject" type="RejectionType" minOccurs="0"
xdb:SQLName="REJECTION"/>
<xs:element name="Requestor" type="RequestorType"
xdb:SQLName="REQUESTOR"/>
<xs:element name="User" type="UserType" minOccurs="1"
xdb:SQLName="USERID"/>
<xs:element name="CostCenter" type="CostCenterType"
xdb:SQLName="COST_CENTER"/>
<xs:element name="ShippingInstructions" type="ShippingInstructionsType"
xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
<xs:element name="SpecialInstructions" type="SpecialInstructionsType"
xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
<xs:element name="LineItems" type="LineItemsType"
xdb:SQLName="LINEITEMS"/>
</xs:sequence>
</xs:complexType>
full schema is available in url
http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#BABBGIED
The views use XPath expressions and functions such as extractValue() to define the mapping between columns in the view and nodes in the XML document. The following view is created on purchase order schema.
Creating Relational Views On XML Content
CREATE OR REPLACE view PURCHASEORDER_MASTER_VIEW
(REFERENCE, REQUESTOR, USERID, COSTCENTER,
SHIP_TO_NAME,SHIP_TO_ADDRESS, SHIP_TO_PHONE,
INSTRUCTIONS)
AS
SELECT extractValue(value(p),'/PurchaseOrder/Reference'),
extractValue(value(p),'/PurchaseOrder/Requestor'),
extractValue(value(p),'/PurchaseOrder/User'),
extractValue(value(p),'/PurchaseOrder/CostCenter'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/name'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/address'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/telephone'),
extractValue(value(p),'/PurchaseOrder/SpecialInstructions')
FROM PURCHASEORDER p;
When we register XML Schema in Oracle 9i, the schema elements of XML documents are stored as XMLType, that is, stored using object-relational storage techniques.
For a small schema, we could build the above view manually, but for large/nested schema, if we have query to build XML documents node list, it will help us to build Relational Views on XML Content.
How do we extract the nodes of any given XML document through O-R structures or XML DB using XML DB functions?
Any alternate thoughts are welcome.
I appreciate your help.
Regards
RamRam
Once again, I do not think that you can solve the problem you are trying to solve. Fundamentally you need to determine for a given element of a given complex type what are it's child elements. For each of those elements you then need to find out whether or not it in turn has child elements...
Then you have to think about elements defined as ref rather than type, elements that are substituteable, and the rest of possibilities that can be described with XML Schema.
If you can solve that problem you're a better man than I as the saying goes. Anyone rather than give you a fish, I'll show you how to at least put a worm on the hook..
The following query gets the names of the elements inside a each of the global complex types
Good luck, if you come up with a query to do this I'd love to see it...
SQL> column COMPLEX_TYPE format A32
SQL> column ELEMENT format A32
SQL> --
SQL> select extractvalue
2 (
3 value(ct),
4 '/xs:complexType/@name',
5 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
6 ) COMPLEX_TYPE,
7 extractvalue
8 (
9 value(et),
10 '/xs:element/@name',
11 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
12 ) ELEMENT
13 from resource_view,
14 table
15 (
16 xmlsequence
17 (
18 extract
19 (
20 res,
21 '/r:Resource/r:Contents/xs:schema/xs:complexType',
22 'xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"
23 xmlns:xs="http://www.w3.org/2001/XMLSchema"')
24 )
25 ) ct,
26 table
27 (
28 xmlsequence
29 (
30 extract
31 (
32 value(ct),
33 '/xs:complexType/*/xs:element',
34 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
35 )
36 )
37 ) et
38 where equals_path(res,'/home/SCOTT/poSource/xsd/purchaseOrder.xsd') = 1
39 /
COMPLEX_TYPE ELEMENT
-------------------------------- ------------------------PurchaseOrderType Reference
PurchaseOrderType Actions
PurchaseOrderType Reject
PurchaseOrderType Requestor
PurchaseOrderType User
PurchaseOrderType CostCenter
PurchaseOrderType ShippingInstructions
PurchaseOrderType SpecialInstructions
PurchaseOrderType LineItems
LineItemsType LineItem
LineItemType Description
LineItemType Part
ActionsType Action
RejectionType User
RejectionType Date
RejectionType Comments
ShippingInstructionsType name
ShippingInstructionsType address
ShippingInstructionsType telephone
19 rows selected. -
How to convert information of a job posting into a xml string or file
hi hr experts,
I hope to find some answers.
Is there a function in the ERP system that converts all the information of a job posting into a xml string or file?
This could be used to communicate with external job databases, e.g. monster or jobpilot.
The function CALL TRANSFORMATION converts data to XML. Is this really the only way to convert the job posting?
Thanks for your feedback and help.
Ralf von Seht
Edited by: Ralf von Seht on Mar 26, 2008 4:45 PM
Edited by: Ralf von Seht on Mar 26, 2008 4:46 PMHi Elena,
The issue is caused by XSLT is not script enabled by default. Please provide XsltSettings in the loading to fix the issue. For more information, please see:
http://daomingworks.wordpress.com/2009/12/11/xslt-transform-data-error-use-the-xsltsettings-enablescript-property-to-enable-it/
Thanks,
Jinchun Chen
Jinchun Chen
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff AT microsoft.com(Please replace AT with @) -
Is JAXB the best solution to store XML schema in databse
Hi, i have a doubt regarding which is better way to store XML schema to database.
I have looked on JAXB, DOM, SAX.
I should be able to modify the database and store back the changes in XML schema..
i am really consfused about this.
plz suggest me
thanxThank you for your reply
As per as I know JAXB take XML schema as basis to
create tables in database and store the XML data
according to that . I want to store the XML Data in
the database structured according to XML schema
defined by me.I'm not sure how a schema would impact this. Schema is a data definition that constraints a given XML data document. The XML itself is stored as a string. Databases like Oracle now have XML column types and allow you to use XML querying languages and x-Path in normal SQL queries.
There are 2 types of mapping from XML to datbase
Table space and object relational
A tablespace is conceptually similar to a namespace. Object relational mappers go from objects to relational databases and back. I do not see how either of these two concepts are mutually exclusive. And the latter makes no sense if you talking about an object database. There is no O/R mapping because there is no relational database, it's an object database.
I want to do object-relational mapping from XML to
o object oriented database . and the modifications
done on the datbase want to store again in XML. As
per as I know JAXB give us classes as per the XML
schema and we can write DDL to store the data in
databse
JAXB is for marshalling and unmarshalling Java objects to and from XML. The XML itself can be stored in any LOB database column.
Is it the right approach or do you have any better
idea?I still do not really understand what you are trying to do. It seems like you have a bit too much technology soup to consume. What are the actual requirements?
- Saish -
Extracting the Attributes values of an XML Element
Dear Forum Members
Please tell me any XML Function which is used to extract the Attribute value of an XML Element.
Given below
<BRKCD_STREDSWTINVIN_C Key="6708">
is an Element With some Key value.
I want to have that Key value.
Using Extract and Extractvalue I am not able to get the Attribute value.
Is there any way..
Regards
Madhu KYour xml is not really complete ;), but this should get you started:
michaels> with t as
(select xmltype('<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>') xml from dual)
select d.xml, d.xml.extract('//BRKCD_STREDSWTINVIN_C/@Key') key
from t d
XML KEY
<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C> 6708 -
How can I extract the full SQL script for a schema?
Hi,
How can I extract the full SQL script for a schema?
I am looking for some method that needs jus SQL*Plus and preferably doesn’t need any extra tool.
Thank you,
AlanHow can I extract the full SQL script for a schema?What are you looking for? PL/SQL code? DDL for objects?
-
Need to extract PDF form answers into an XML file
Hi Adobe gurus,we have a requirement like this. We have a Time Tracking and Project Monitoring System whose DB is a Oracle 10g R2. We want to automate our ''Meeting Minute'' processing.
1. The project lead will write minutes into a form PDF. i.e. a PDF where people can type in information into fields and also tick check-boxes etc.
2. The PDF will be e-mailed to the project manager.
3. Project manager will save the PDF in a HDD directory.
4. Then he will run a program.
5. Program will pickup all the PDFs in that directory one-by-one.
6. For each PDF, the program should read the fields and get the values for the form fields and create an .XML file for it.
7. Now, another program will read the XML files, extract the information and store those in a DB against each project lead.
I went through the thread PDF to XML conversion, but unfortunately it has no complete solution. This problem is present for lots of people and I would be really grateful if Adobe experts can give a complete solution. In order to make it easy to answer, I have made a small questionnaire below:
(A.) When creating a PDF form. i.e. a PDF where you can type information to questions and tick checkboxes etc., can you create the PDF with structure. i.e. for example, the field into which a user types project name should be identifiable (as a tag or something like like PROJECT_NAME), when we create an XML out of it later? Is this called creating a tagged PDF?
(B.) Does this mean that we cannot convert an untagged PDF to XML?
(C.) In order to convert a PDF to XML do we need a XSD or DTD? I ask this because, I some converters from the web, like this one, asks for the XSD. And this tool which converts a PDF to XML, asks for a rules set before converting the PDF. So is this necessary?? i.e. Do we have to have our own XSD and rules set, or does the PDF->XML utility convert to XML based on predefined ADOBE PDF tags??
(D.) Do we HAVE TO use the Adobe LiveCycle ES DLLS to do this??? I ask this becuase most of the free PDF-2-XML convertes give wrong results and has no guarantee.
(E). Can you please elaborate the process of converting PDFs to XML. Please note that we are doing this using a program (i.e. we process a batch of PDFs).
(F.) If we use ADOBE DLLS then do we have to purchase the Adobe LiveCycle ES product??
(G.) If we purchase Adobe LC ES then can we use the DLLs in Java, .Net??? Or is it possible to call the Adobe DLLs only using C or C++ (I read about this on the .Net)?
(H.) Is Adobe LiveCycle ES a separate product from the Adobe SDK and Adobe PDF writer??
Your advice would be greatly appreicated.
Thanks in advance.
Ravi de Silva.Thanks, however, I just want the user to be able to hit the Submit by E-mail button, and e-mail the form to the Manager. I believe, that this is what this button should be able to do, except that it converts the file to .XML format.
Still looking for help. thanks -
How to extract the cobol files into owb
Hi
How to extract the cobol files in owb,I am using OWB9.2.
Ex:I am having 2 records DCEC4000100 9159000050C those values are 5 bytes 'RAVI and 6 bytes '15000'.
Using contorl file i am trying to load these into Oracle,But i am not able into insert these records into Oracle.
Can any tell me how to handle this kind of situation?
Regards,
RupakGood morning Ashok,
Your data is in a SQL*Loader supported datatype, so basically it should not be a problem.
Have you checked the Database Utilities guide (for Oracle9i for instance: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96652/toc.htm) on how to handle this?
I'll also repeat my previous question, have you ever been able to load data into the database using SQL*Loader (either using ASCII values or any other datatype)?
For the OWB part, have you read "Importing Data Definitions" (typically chapter 4)? More specifically, "Specifying Field Properties" in "About Flat File Sources and Targets"?
In "SQL*Loader Properties" it says the following:
Type Describes the data type of the field for the SQL*Loader. You can use the Flat
File Sample Wizard to import the following data types: CHAR, DATE, DECIMAL
EXTERNAL, FLOAT EXTERNAL, INTEGER EXTERNAL, ZONED , AND ZONED
EXTERNAL. For complete information on SQL*Loader field and data types, refer to
Oracle9i Utilities. Currently, only portable datatypes are supported.
If you check the database utitlities guide (chapter 6 Field List Reference) and look for "SQL*Loader Datatypes", you'll find (packed) decimal under the Nonportable Datatypes. This implies that OWB does not support it.
This does not mean you can't use SQL*Loader, you'll only have to define everything separate from OWB and call it separately as well.
Good luck, Patrick -
How to convert the TEXT file into an XML using plsql code
Hi all ,
I need to convert an TEXT file into an XML file how can i do it
Below is my sample TEXT file .
TDETL00000000020000000000000120131021115854ST2225SKU77598059 0023-000000010000
I want the above to be converted into the below format
<?xml version="1.0" encoding="UTF-8"?>
<txt2xml>
<!-- Processor splits text into lines -->
<processor type="RegexDelimited">
<regex>\n</regex>
<!--
This is used to specify that a message should be created per line in
the incoming file;
NOTE: this was designed to work with all the processors, however it
only works correctly with 'RegexDelimited' processors (check the
enclosing top processor type)
-->
<maxIterationsPerMsg>1</maxIterationsPerMsg>
<!-- For lines beginning with FHEAD (File Header) -->
<processor type="RegexMatch">
<element>FHEAD</element>
<regex>^FHEAD(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,Type,Date</element>
<regex>^(\d{10})(\w{4})(\d{14})$</regex>
</processor>
</processor>
<!-- For lines beginning with TDETL (Transaction Details) -->
<processor type="RegexMatch">
<element>TDETL</element>
<regex>^TDETL(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,TransControlNumber,TransDate,LocationType,Location,ItemType,Item,UPCSupplement,InventoryStatus,AdjustReason,AdjustSign,AdjustQty</element>
<regex>^(\d{10})(\d{14})(\d{14})(\w{2})(\d{4})(\w{3})([\w ]{13})([\w ]{5})(\d{2})(\d{2})([+-]{1})(\d{12})$</regex>
</processor>
</processor>
<!-- For lines beginning with FTAIL (File Tail) -->
<processor type="RegexMatch">
<element>FTAIL</element>
<regex>^FTAIL(.*)</regex>
<processor type="RegexMatch">
<element>OriginalLine</element>
<regex>(.*)</regex>
<consumeMatchedChars>false</consumeMatchedChars>
</processor>
<processor type="RegexMatch">
<element>LineSeq,TransCount</element>
<regex>^(\d{10})(\d{6})$</regex>
</processor>
</processor>
</processor>
</txt2xml>
ThanksSorry, that doesn't make much sense.
The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
Are you a user of this utility? -
Anyone register the full ACORD P&C XML schema in XDB?
Hi -
We are attempting to use Oracle’s XDB in a new project and are experiencing some issues. I am wondering if anyone has any experience with the following and could share or enlighten us as to the cause of our troubles.
We have two test servers set up (10gR1 & 11gR1) and are trying to register the ACORD P&C XML Schema. It is a very large schema and it references a number of other NS and DTD’s.
The most recent attempts to register this schema have resulted in out of memory errors.
Has anyone registered the ACORD P&C XML Schema in Oracle Xdb? 10g or 11g?
Has anyone attempted to register a schema that is 12 to 20MB in size?
While, the schema is very large, the XML documents will only implement a small portion of it and should be small in size, <1MB. We need to perform Inserts, Updates and Deletes on the XDB data in addition to Selects joining this data to relational tables. It appears that structured storage fits this scenario the best. However, if someone has had some practical experience with both structured and unstructured and can share their thoughts, that would be helpful as well.
I'm hoping someone has already faced and resolved this issue.
Thanks in advance for any help!
Mike
Edited by: mriley99 on Sep 30, 2009 8:45 AMYour best place to ask this question would be the {forum:id=34} forum since that is for XML DB related questions. I would also information regarding how you are registering the schemas and the exact error(s) you are getting.
-
How to extract the element name of an XML Document
This is how my xml file looks like:
<?xml version="1.0" encoding="UTF-8" ?>
- <nsiData>
- <instance timestamp="2011-05-25 19:01:00">
<AECI>47.00</AECI>
<EEI>-553.00</EEI>
<EES>-91.00</EES>
<EKPC>-22.00</EKPC>
<LGEE>-140.00</LGEE>
<MHEB>-1376.00</MHEB>
<MISO>-4725.00</MISO>
<MOWR>55.00</MOWR>
<ONT>-872.00</ONT>
<OVEC>-144.00</OVEC>
<PJM>-1438.00</PJM>
<SPA>-55.00</SPA>
<SPC>20.00</SPC>
<SWPP>69.00</SWPP>
<TVA>-69.00</TVA>
<WAUE>-158.00</WAUE>
</instance>
- <instance timestamp="2011-05-25 19:02:00">
<AECI>47.00</AECI>
<EEI>-555.00</EEI>
<EES>-91.00</EES>
<EKPC>-22.00</EKPC>
<LGEE>-148.00</LGEE>
<MHEB>-1375.00</MHEB>
<MISO>-4709.00</MISO>
<MOWR>55.00</MOWR>
<ONT>-871.00</ONT>
<OVEC>-144.00</OVEC>
<PJM>-1426.00</PJM>
<SPA>-55.00</SPA>
<SPC>20.00</SPC>
<SWPP>82.00</SWPP>
<TVA>-69.00</TVA>
<WAUE>-158.00</WAUE>
</instance>
</nsiData>
I want to extract the element name and the element value from this file. I was trying to do it this way:
SELECT datetime,
loc.aeci_value,
loc.eei_value
FROM temp_xmltype txml,
XMLTABLE ('/nsiData' PASSING xmldata) misolmp,
XMLTABLE ('/nsiData/instance' PASSING misolmp.object_value
COLUMNS
datetime VARCHAR2(100) PATH '/instance/@timestamp') misodt,
XMLTABLE ('/nsiData/instance' PASSING misolmp.object_value
COLUMNS
aeci_value VARCHAR2(100) PATH '/instance/AECI',
eei_value VARCHAR2(100) PATH '/instance/EEI') loc
WHERE txml.feed_id = 127
But doing it this way does not get me AECI as a column value. Is there any way to get the element name as a column value.
I am on 11gR2The SQL statement you wrote returns 4 rows and there is only two AECI values in there. The corrected version of what you wrote should really be
SELECT loc.datetime,
loc.aeci_value,
loc.eei_value
FROM temp_xmltype txml,
XMLTABLE ('/nsiData/instance' PASSING txml.xmldata
COLUMNS
datetime VARCHAR2(100) PATH '@timestamp',
aeci_value VARCHAR2(100) PATH 'AECI',
eei_value VARCHAR2(100) PATH 'EEI') loc
WHERE txml.feed_id = 127;If you know the element name and want it returned as a column name, why not just hard code it in the SQL statement, such as
SELECT loc.datetime,
'AECI' as AECI,
loc.aeci_value,
'EEI' AS EEI,
loc.eei_value
FROM temp_xmltype txml,
XMLTABLE ('/nsiData/instance' PASSING txml.xmldata
COLUMNS
datetime VARCHAR2(100) PATH '@timestamp',
aeci_value VARCHAR2(100) PATH 'AECI',
eei_value VARCHAR2(100) PATH 'EEI') loc
WHERE txml.feed_id = 127;I suspect you are really looking for something like {message:id=9535532}
Note: See the FAQ (under your sign-in name) for how to use the code tag to format code as shown above. -
Can we bind the same fragments into different xsd Schemas
I have created different fragments for a single form. I have to render the fragments as well as the complete form on the web. I have created the different services for each fragment and bind the schema with them and this works fine for me but while using the same all fragments in one complete form I am not able to get the data. How can I do this?
Can we bind the same fragments into different Schemas? If yes, then how?
Or we need to follow some other approach?yes, we are using the LiveCycle Designer and LiveCycle Workbench Process for rendering the PDF form.
-
Extract the classification data into internal table
Hi all,
I having requirement to extract classification data for material number.
1) Provide the selection option for material number (MATNR).
2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).
Please provide the sample code for select the following data. Thanks.
Classification table
OBJEK (from AUSP table)
MAFID (from AUSP table)
KLART (from AUSP table)
CLASS (from KLAH table)
ATWRT (from AUSP table)
MSEHI (from CABN table)
OBTAB (check if class type=002, set it as MARA)
STDCL (from KSSK table)Hi,
if I understand, you´re trying to get information from the classification system for the material. You can use the following code:
DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,
datos LIKE TABLE OF clobjdat WITH HEADER LINE.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
class = 'DESK' "clase a buscar
classtype = '001' "tipo de la clase
features = 'X'
language = sy-langu
object = 'PM00A000C055' "Material
objecttable = 'MARA'
key_date = sy-datum
initial_charact = 'X'
change_service_clf = 'X'
TABLES
t_class = clases
t_objectdata = datos
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
loop at datos.
endloop. -
Problem extracting the content of a big xml data
Hello
I'm trying to use a web service that needs and returns big messages (>1Mo).
Could you tell me if I do something wrong ? (I have a problem with the extract function at the end of the process)
For this I modified the soap_api package to use clob for the envelope instead of varchar2.
Sending a message works well, I modified the part of the invoke function that does this to
send the message chunked :
generate_envelope(p_request, l_envelope, p_type);
--show_envelope(l_envelope);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'Transfer-Encoding', 'chunked' );
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
--UTL_HTTP.write_text(l_http_request, l_envelope);
v_clob_length := dbms_lob.getlength(l_envelope);
loop
if (v_end > v_clob_length) then
v_end := v_clob_length;
v_length := v_end - v_start + 1;
end if;
v_chunk_data := null;
v_chunk_data := DBMS_LOB.SUBSTR(l_envelope, v_length, v_start);
UTL_HTTP.write_text(l_http_request, v_chunk_data );
if (v_end = v_clob_length) then
exit;
end if;
v_start := v_end + 1;
v_end := v_start + 2000;
end loop;
After that I modified the function to retrieve the message line by line instead of in one block :
l_http_response := UTL_HTTP.get_response(l_http_request);
--UTL_HTTP.read_text(l_http_response, l_envelope);
l_envelope := null;
begin
LOOP
utl_http.read_line(l_http_response, v_line, TRUE);
v_line_clob := v_line;
l_envelope := l_envelope || v_line_clob;
END LOOP;
UTL_HTTP.end_response(l_http_response);
exception
WHEN utl_http.end_of_body THEN
utl_http.end_response(l_http_response);
end;
--show_envelope(l_envelope);
l_response.doc := XMLTYPE(l_envelope);
l_response.envelope_tag := p_request.envelope_tag;
(I modified the show_envelope function to save the xml in a file and the message is completed and the creation of the xmltype returns no errors)
But the last part that I didn't change doesn't work :
l_response.doc := l_response.doc.extract('/' || l_response.envelope_tag || ':Envelope/' || l_response.envelope_tag || ':Body/child::node()',
'xmlns:' || l_response.envelope_tag || '="http://schemas.xmlsoap.org/soap/envelope/"');
show_envelope(l_envelope);
It should remove the <soap:Envelope> and <sopa:Body> part but they still exists after the extract.
This is an example of the xml I receive from the web service :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/"><Resultat>
</Resultat></getResultTestRetourStringResult></soap:Body></soap:Envelope>Maybe because you are using l_envelope when calling show_envelop?
l_response.doc := l_response.doc.extract('/' || l_response.envelope_tag || ':Envelope/' || l_response.envelope_tag || ':Body/child::node()',
'xmlns:' || l_response.envelope_tag || '="http://schemas.xmlsoap.org/soap/envelope/"');
show_envelope(l_envelope);
It's really hard to tell from your snippets of code, some of which have nothing to do with the issue. The following works for me just fine on 11.1.0.6
declare
l_doc XMLTYPE;
l_snip XMLTYPE;
begin
l_doc := XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/">
<Resultat></Resultat>
</getResultTestRetourStringResult>
</soap:Body>
</soap:Envelope>');
l_snip := l_doc.extract('/a:Envelope/a:Body/*','xmlns:a="http://schemas.xmlsoap.org/soap/envelope/"');
dbms_output.put_line(l_snip.getStringVal);
end;
produces
<getResultTestRetourStringResult xmlns="http://www.verlingue.fr/WSCalculTarificateur/">
<Resultat/>
</getResultTestRetourStringResult>
I also get the same thing when using child::node() instead of *
You'll notice that my namespace prefixes do not agree with what's in the XML. That's okay. Only the URI matters, not the prefix itself. Since your URI is hard-coded, you could simplify the XPath as I showed so that it is easier to read.
Welcome to the forums.
Here is an always helpful read.
Re: 2. How do I ask a question on the forums? -
Can castor retrieve the comnstraints provided in an xml schema
hi,
plz help me !!!!!!!!!!!
does castor provide any function to retrieve the constraints
defined in an xsd
i know it provides functions for setting the constraints
can i retrieve the value of constraints fromthe descriptor files returned by cator
while unmarshalling the xsd file .
thaksHi 00ps, the way to do this with XSD schemas is to use a "choice" node, where you can select either BusinessEntity or Person. Each of these nodes can then have different elements (inherited from a common source if you desire).
Whilst doing all this is entirely possible with the BizTalk schema editor, it is far, far easier to use a specialist tool such as
XMLSpy, which makes defining complex relationships an easy task. For example, here is a similar sort of restriction I have in place on a schema:
The "party" element is used in multiple schemas through the use of an import. You can either use
organisation or individual, they both use a common element called
contact which contains address information etc which would be the same for both, but allow for different structures for party types.
As you can see from the screen-shot, it's a lot easier to visualise with XML Spy. The XSD notation is:
<xs:choice>
<xs:element name="organisation">
...blah...
</xs:element>
<xs:element name="individual">
...blah...
</xs:element>
</xs:choice>
If this is helpful or
answers your question - please mark accordingly.
Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)
Maybe you are looking for
-
Apparent EJB Class Loader Issue
I am having a problem loading narrowing an EJB. It appears to be a class loader problem. I am getting a ClassCastException with the following message: Cannot narrow remote object to com.dte.ejb.facade.AccessoryServiceHome. Here is my code that looks
-
Hi Friends, While doing GR am geting document number and can see that in MB03. Now in MKPF table there is field called Customs reference number( field name # GTS_CUSREF_NO) , and after putting material document number in MKPF am getting all the detai
-
SCORM: Why not write the API Instance in ActionScript
We're working on a SCORM compliant system for a major blue chip. We have a mixture of old AS1 and AS2 content, along with shiny new AS3 modules, all of which needs to be intergrated into a single system. As I have posted about elsewhere here, there s
-
Audigy Se & Prince of Persia Forgotten Sands!!!!!
Hi AlL.... Somone help me... Today i installed Prince of persia Forgotten sands in Xp Sp3.... The game sound is muffled[lack of detail & treble bass is good] while playing, but on cutscenes it's good but low audio output through out the game..... Ins
-
I have ps 7 i was using it yesterday to edit some photos, but today I was trying to use it. I'm trying to crop some pictures today but it wont change from the hand tool. I try help section in ps7 but it tell error has occured and to reinstall ps7. So