Searching CLOB column of XML documents with leading wildcard - Performance
Hi, our table has a text indexed CLOB column of XML documents and when performing a search with a leading wild card, we never retrieve any results.
The query looks like this:
select id from <table> where contains(columnname, '(%12345)') > 0;
I cant even generate an explain plan from this query. I killed it after 39 minutes.
If the query changes to:
select id from <table> where contains(columnname, '(12345%)') > 0;
I get an explain plan immediately with a cost=2 and when I execute the query, I get results in less than a second.
I'd appreciate any thoughts of what I should check or what the problem might be.
Thanks! Doug
Can you provide a script that reproduces the case. I am unable to reproduce the problem with just some small sample data, as shown below. That means that there is nothing wrong with the syntax, but you may be having problems due to the size of your data or other parameters that have not been mentioned.
SCOTT@10gXE> CREATE TABLE your_table (id NUMBER, columnname CLOB)
2 /
Table created.
SCOTT@10gXE> insert into your_table
2 select 1, dbms_xmlgen.getxml
3 ('select deptno, dname,
4 cursor (select empno, ename
5 from emp
6 where emp.deptno = dept.deptno ) employee
7 from dept
8 where deptno = 10')
9 from dual
10 /
1 row created.
SCOTT@10gXE> SELECT * FROM your_table
2 /
ID COLUMNNAME
1 <?xml version="1.0"?>
<ROWSET>
<ROW>
<DEPTNO>10</DEPTNO>
<DNAME>ACCOUNTING</DNAME>
<EMPLOYEE>
<EMPLOYEE_ROW>
<EMPNO>7782</EMPNO>
<ENAME>CLARK</ENAME>
</EMPLOYEE_ROW>
<EMPLOYEE_ROW>
<EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
</EMPLOYEE_ROW>
<EMPLOYEE_ROW>
<EMPNO>7934</EMPNO>
<ENAME>MILLER</ENAME>
</EMPLOYEE_ROW>
</EMPLOYEE>
</ROW>
</ROWSET>
SCOTT@10gXE> CREATE INDEX your_idx ON your_table (columnname)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 /
Index created.
SCOTT@10gXE> EXEC DBMS_STATS.GATHER_TABLE_STATS ('SCOTT', 'YOUR_TABLE')
PL/SQL procedure successfully completed.
SCOTT@10gXE> SET AUTOTRACE ON EXPLAIN
SCOTT@10gXE> select id from your_table where contains (columnname, '(%839)') > 0
2 /
ID
1
Execution Plan
Plan hash value: 2832585188
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 888 | 0 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| YOUR_TABLE | 1 | 888 | 0 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | YOUR_IDX | | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."CONTAINS"("COLUMNNAME",'(%839)')>0)
SCOTT@10gXE> SET AUTOTRACE OFF
Similar Messages
-
Cannot search file content on Word document with embedded Excel table
Cannot search file content on Word document with embedded Excel table. I have Windows 8.1 64-bit and Office 2010 Professional. Only phrases from within Excel tables are not searchable. I have many Word documents with embedded Excel table.
I use it for my invoices. Those invoices are converted to pdf to be sent via mail. Searching the same phrases in related pdf files Works fine. And yes, folders are indexed, searching service is active......... For example I can find all invoices that have
specific address or name, which is located in word document, but cannot find invoices with specific item name or price, being that information is in embedded Excel table. (not linked, embedded). I thought that is a question for Windows forum, but guys directed
me here on Office forum. To clarify, I do not use Ctrl+F inside some document, but Windows Search in my folders. Probably the same happens in Office 2013.
Thank you.Hi, I have a lot of Word documents (invoices, offers). Main part of those documents is embedded Excel file because it is easier to do mathematics in Excel than in Word. There are columns with description, unit price, quantity, taxes... Now, I need
to find who bought HP switch 2530-24G last year. I open folder with last year invoices and search "2530". Cannot find any. But if that document was converted to pdf for mail, than I can find that phrase. Windows search does not work for content if the content
is in embedded file. -
How do you include CLOB data in XML document? Is there a size limit?
Im actually using the Oracle API's to create an XML document as a clob.
But for the columns that are CLOB columns they just put
<column>(CLOB)</column> in the document and not the actual CLOB.
Anybody know the direction I need to resolve this?Could you post the code that is causing this?
-
Open XML document with proper layout
Hi,
I created my own XML form and I have problem when accessing the document within "KM Content".
Indeed, when I click on the XML file generated by the XML Form it doesn't render it with the "Show" form but rather displays it as an usual XML document (with all its tags).
Hint:
I linked my iView to a custom CM repository. But, if I link my iView containing the XML Form to the out-of-the-box CM repository "/documents", it works fine.
What should I do to make this work?
Thanks in advance,
EricHi Eric,
in the Configuration under 'System Administration' -> 'System Configuration' -> 'Knowledge Management' -> 'Content Management' -> 'Repository Filters' you can find a filter named 'xmlforms_filter'. Some repositories are registered for this filter (in the standard e.g. documents). You should add your repositoriy here. After that the files in your repository should use the Show-form when being displayed.
Hope this helps
Karin -
Please help; how to write XML document with JSP?
I try to write XML document with JSP...
But I got wrong results everytime.
The result is not XML file displayed in the browser,
but HTML file.
I even tried to use HTML special code for <, >, "
but still display as HTML file not XML file.
How to do this?
Thanks in advance. I put my codes below.
Sincerely,
Ted.
================
Here is code for the JSP (called stk.jsp):
<%@ page contentType="text/xml" %>
<%@ page import="bean.Stock" %>
<jsp:useBean id="portfolio" class="bean.Portfolio" />
<% java.util.Iterator pfolio = portfolio.getPortfolio();
Stock stock = null; %>
<?xml version="1.0" encoding="UTF-8"?>
<portfolio>
<% while (pfolio.hasNext())
stock = (Stock) pfolio.next(); %>
<stock>
<symbol>
<%=stock.getSymbol() %>
</symbol>
<name><%=stock.getName() %> </name>
<price><%=stock.getPrice() %> </price>
</stock>
<% } %>
</portfolio>
=================
Here is the code for bean.Stock:
package bean;
public class Stock implements java.io.Serializable
String symbol, name;
float price;
public Stock(String symbol, String name, float price)
this.symbol = symbol;
this.name = name;
this.price = price;
public String getSymbol()
return symbol;
public String getName()
return name;
public float getPrice()
return price;
===============
And here is bean.Portfolio:
package bean;
import java.util.Iterator;
import java.util.Vector;
public class Portfolio implements java.io.Serializable
private Vector portfolio = new Vector();
public Portfolio()
portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
public Iterator getPortfolio()
return portfolio.iterator();
}Hi
I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
Keep me posted.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems
http://www.sun.com/developers/support -
PowerShell - to search recycle bin - for any document with title containing "disaster" in it?
Hi there,
I am looking for PowerShell - to search recycle bin - for any document with title containing "disaster" in it?
E.g. it should search for any documents with title "SharePoint Disaster Recover.doc" or whatever title contains this word?
Thank you so much.This should do it:
Get-SPSite http://yourServer/sites/yourSite |
Select -ExpandProperty RecycleBin |
Where { $_.Title -Like "*disaster*" } |
Select DirName, Title
or for all Site Collections in the farm:
Get-SPSite -Limit All |
Select -ExpandProperty RecycleBin |
Where { $_.Title -Like "*disaster*" } |
Select DirName, Title
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner -
Search a CLOB column(contains XML) in Oracle table
Hi,
I need help on how will i be able to search the data in a clob column that contains XML in an ORACLE table.
Thanks,
PSSWe are using 10g.. and database in which the table is located.. i just have a read only access .. so i am pulling all the data into a flat file (im using a shell script) and from there on i need to process the data... and my problem is how to pull the data in the CLOB using sql or whichever way.. if you can explain me with an example i would really appreciate it...
Thanks,
PSS -
How to search for a text node with a particular value in an xml document with labview
supposing i have the following xml document:
<head>
<book>
<bookname>zio</bookname>
<author>dan</author>
</book>
<book>
<bookname>the spear warrior</bookname>
<author>britney</author>
</book>
<book>
<bookname>the beard</bookname>
<author>derrick</author>
</book>
</head>
i want to search for the author of the book "the beard" using for example the V.I Get first match of labview to access the the node with value "the beard" and then use Get next sibling V.I and Get node text content to get get the author of this book..so my question is how do i write the xpath expression for Get first match so as to access the node with bookname "the beard" instantyly? am trying to minimise the use of loops because they increase the time duration,..thank you (NB:i dont want to use Get all Matched V.I because it obliges me to use a loop in order to access the name derrick and this increases the time duration for my v.i)
Solved!
Go to Solution.Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ
Attachments:
Two-stage match demo.vi 8 KB -
Please help to read the XML document with XMLTable
Hi Gurus,
I am not very familiar with XML parsing. It seems to me it should be very easy to get the data. For some reason, I am having a problem to get the data.
SELECT *
FROM util.hlsr_online_entries e,
XMLTABLE(
xmlnamespaces(
'http://tempuri.org/' as "dt",
'urn:schemas-microsoft-com:xml-diffgram-v1' as "dg"),
'/DataTable/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
PASSING XMLTYPE(e.entry_data)
COLUMNS
SeqNo FOR ORDINALITY,
DocumentID NUMBER PATH 'DocumentID',
ClubName VARCHAR2(100) PATH 'ClubName') as test
WHERE e.ref_id = 33422
The above query does not bring any data for me. My hunts is the problem with DocumentElement tab. I have been trying a different variation to handle.
Please help me out to tune the query
I have the following XML document from the DotNet developer
<?xml version="1.0" encoding="utf-8"?>
<DataTable xmlns="http://tempuri.org/">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="JrShowCustomerHeifers">
<xs:complexType>
<xs:sequence>
<xs:element name="DocumentID" type="xs:int" minOccurs="0" />
<xs:element name="ClubName" type="xs:string" minOccurs="0" />
<xs:element name="LastName" type="xs:string" minOccurs="0" />
<xs:element name="FirstName" type="xs:string" minOccurs="0" />
<xs:element name="PreferredName" type="xs:string" minOccurs="0" />
<xs:element name="Email" type="xs:string" minOccurs="0" />
<xs:element name="Exhibitor" type="xs:string" minOccurs="0" />
<xs:element name="AnimalName" type="xs:string" minOccurs="0" />
<xs:element name="RegistryNo" type="xs:string" minOccurs="0" />
<xs:element name="DateofBirth" type="xs:string" minOccurs="0" />
<xs:element name="NameofSire" type="xs:string" minOccurs="0" />
<xs:element name="SireRegistryNo" type="xs:string" minOccurs="0" />
<xs:element name="NameofDam" type="xs:string" minOccurs="0" />
<xs:element name="DamRegistryNo" type="xs:string" minOccurs="0" />
<xs:element name="Tattoo" type="xs:string" minOccurs="0" />
<xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0" />
<xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0" />
<xs:element name="Tattoo_Location" type="xs:string" minOccurs="0" />
<xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0" />
<xs:element name="OracleBreedID" type="xs:int" minOccurs="0" />
<xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0" />
<xs:element name="ValidationDate" type="xs:dateTime" minOccurs="0" />
<xs:element name="ValidatedBy" type="xs:string" minOccurs="0" />
<xs:element name="ValidationComment" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<DocumentElement xmlns="">
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
<DocumentID>18442</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>113</AnimalName>
<RegistryNo>C1026447</RegistryNo>
<DateofBirth>01/14/2013</DateofBirth>
<NameofSire>808 GAME DAY 808 LH</NameofSire>
<SireRegistryNo>C961101</SireRegistryNo>
<NameofDam>SADDIE 7/7 LE</NameofDam>
<DamRegistryNo>C941067</DamRegistryNo>
<Tattoo>113</Tattoo>
<SecondaryTattoo />
<UniversalIDNumber>1194F020</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location />
<OracleBreedID>6383</OracleBreedID>
<JrValidationBreedName>Beefmaster</JrValidationBreedName>
<ValidationDate>2014-11-25T08:39:00-06:00</ValidationDate>
<ValidatedBy>laineyb</ValidatedBy>
<ValidationComment />
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
<DocumentID>18473</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>KPH PURPLE CORALEE 349</AnimalName>
<RegistryNo>P43461953</RegistryNo>
<DateofBirth>11/04/2013</DateofBirth>
<NameofSire>PURPLE MOXY 22X ET</NameofSire>
<SireRegistryNo>P43126458</SireRegistryNo>
<NameofDam>TCC CORKY 6603</NameofDam>
<DamRegistryNo>P42457119</DamRegistryNo>
<Tattoo>349</Tattoo>
<SecondaryTattoo>KPH</SecondaryTattoo>
<UniversalIDNumber>1194F021</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment />
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
<DocumentID>18474</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
<RegistryNo>43504761</RegistryNo>
<DateofBirth>03/02/2014</DateofBirth>
<NameofSire>LH TNT 1017</NameofSire>
<SireRegistryNo>43199794</SireRegistryNo>
<NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
<DamRegistryNo>43315143</DamRegistryNo>
<Tattoo>4107</Tattoo>
<SecondaryTattoo />
<UniversalIDNumber>1194F018</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location />
<OracleBreedID>6398</OracleBreedID>
<JrValidationBreedName>Hereford</JrValidationBreedName>
<ValidationDate>2014-11-24T14:26:00-06:00</ValidationDate>
<ValidatedBy>Validator</ValidatedBy>
<ValidationComment />
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
<DocumentID>18475</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
<RegistryNo>P43406978</RegistryNo>
<DateofBirth>02/05/2013</DateofBirth>
<NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
<SireRegistryNo>P42945146</SireRegistryNo>
<NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
<DamRegistryNo>P42927201</DamRegistryNo>
<Tattoo>19A</Tattoo>
<SecondaryTattoo />
<UniversalIDNumber>1194F017</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location />
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>2014-12-01T11:55:00-06:00</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment />
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
<DocumentID>18477</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>PURPLE SGW EDEN 12B</AnimalName>
<RegistryNo>P43521932</RegistryNo>
<DateofBirth>04/02/2014</DateofBirth>
<NameofSire>RST TIME'S A WASTIN' 0124</NameofSire>
<SireRegistryNo>43123163</SireRegistryNo>
<NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
<DamRegistryNo>P43235169</DamRegistryNo>
<Tattoo>12B</Tattoo>
<SecondaryTattoo>12B</SecondaryTattoo>
<UniversalIDNumber>1194F015</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>2014-12-01T11:56:00-06:00</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment />
</JrShowCustomerHeifers>
</DocumentElement>
</diffgr:diffgram>
</DataTable>Hi odie_63,
Good evening. I am not sure what you are suggesting. Please provide me the example how to solve the problem. I am very new to XML parsing.
In the meantime, I am having another problem to get the data because .net developer changes the webservice format. To me it is supposed to work fine. May be my eyes are getting blurred so, I can't see where I am wrong.
Thanks in advance. Please help me out.
SELECT exh.docid,exh.clubname,exh.lname,exh.fname,exh.exhibitor,exh.animalname
FROM util.hlsr_online_entries e,
XMLTABLE(
xmlnamespaces(
'http://webservices.hlsr.net/JrShowOracleService/' as "dt",
'urn:schemas-microsoft-com:xml-diffgram-v1' as "dg"),
'/dt:GetJrShowCustomerHeifersResponse/GetJrShowCustomerHeifersResult/dg:diffgram/DocumentElement/JrShowCustomerHeifers'
PASSING XMLTYPE(e.entry_data)
COLUMNS
SeqNo FOR ORDINALITY,
DocID NUMBER PATH 'DocumentID',
ClubName VARCHAR2(100) PATH 'ClubName',
LName VARCHAR2(100) PATH 'LastName',
FName VARCHAR2(100) PATH 'FirstName',
Email VARCHAR2(100) PATH 'Email',
Exhibitor VARCHAR2(100) PATH 'Exhibitor',
AnimalName VARCHAR2(100) PATH 'AnimalName',
RegNo VARCHAR2(100) PATH 'RegistryNo',
DOB VARCHAR2(100) PATH 'DateofBirth',
SireName VARCHAR2(100) PATH 'NameofSire',
SireRegNo VARCHAR2(100) PATH 'SireRegistryNo',
Dam VARCHAR2(100) PATH 'NameofDam',
DamRegNo VARCHAR2(100) PATH 'DamRegistryNo',
Tattoo VARCHAR2(100) PATH 'Tattoo',
SecTattoo VARCHAR2(100) PATH 'SecondaryTattoo',
UnivIDNum VARCHAR2(100) PATH 'UniversalIDNumber',
TattooLoc VARCHAR2(100) PATH 'Tattoo_Location',
OraBreedID NUMBER PATH 'OracleBreedID',
Breed VARCHAR2(100) PATH 'JrValidationBreedName',
ValDate VARCHAR2(100) PATH 'ValidationDate'
) as exh
WHERE e.ref_id = 33432
<GetJrShowCustomerHeifersResponse xmlns="http://webservices.hlsr.net/JrShowOracleService/">
<GetJrShowCustomerHeifersResult>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="JrShowCustomerHeifers" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="JrShowCustomerHeifers">
<xs:complexType>
<xs:sequence>
<xs:element name="DocumentID" type="xs:int" minOccurs="0"/>
<xs:element name="ClubName" type="xs:string" minOccurs="0"/>
<xs:element name="LastName" type="xs:string" minOccurs="0"/>
<xs:element name="FirstName" type="xs:string" minOccurs="0"/>
<xs:element name="PreferredName" type="xs:string" minOccurs="0"/>
<xs:element name="Email" type="xs:string" minOccurs="0"/>
<xs:element name="Exhibitor" type="xs:string" minOccurs="0"/>
<xs:element name="AnimalName" type="xs:string" minOccurs="0"/>
<xs:element name="RegistryNo" type="xs:string" minOccurs="0"/>
<xs:element name="DateofBirth" type="xs:string" minOccurs="0"/>
<xs:element name="NameofSire" type="xs:string" minOccurs="0"/>
<xs:element name="SireRegistryNo" type="xs:string" minOccurs="0"/>
<xs:element name="NameofDam" type="xs:string" minOccurs="0"/>
<xs:element name="DamRegistryNo" type="xs:string" minOccurs="0"/>
<xs:element name="Tattoo" type="xs:string" minOccurs="0"/>
<xs:element name="SecondaryTattoo" type="xs:string" minOccurs="0"/>
<xs:element name="UniversalIDNumber" type="xs:string" minOccurs="0"/>
<xs:element name="Tattoo_Location" type="xs:string" minOccurs="0"/>
<xs:element name="Secondary_Tattoo_Location" type="xs:string" minOccurs="0"/>
<xs:element name="OracleBreedID" type="xs:int" minOccurs="0"/>
<xs:element name="JrValidationBreedName" type="xs:string" minOccurs="0"/>
<xs:element name="ValidationDate" type="xs:string" minOccurs="0"/>
<xs:element name="ValidatedBy" type="xs:string" minOccurs="0"/>
<xs:element name="ValidationComment" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<DocumentElement xmlns="">
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers1" msdata:rowOrder="0">
<DocumentID>18442</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>113</AnimalName>
<RegistryNo>C1026447</RegistryNo>
<DateofBirth>01/14/2013</DateofBirth>
<NameofSire>808 GAME DAY 808 LH</NameofSire>
<SireRegistryNo>C961101</SireRegistryNo>
<NameofDam>SADDIE 7/7 LE</NameofDam>
<DamRegistryNo>C941067</DamRegistryNo>
<Tattoo>113</Tattoo>
<SecondaryTattoo/>
<UniversalIDNumber>1194F020</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location/>
<OracleBreedID>6383</OracleBreedID>
<JrValidationBreedName>Beefmaster</JrValidationBreedName>
<ValidationDate>11/25/2014</ValidationDate>
<ValidatedBy>laineyb</ValidatedBy>
<ValidationComment/>
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers2" msdata:rowOrder="1">
<DocumentID>18473</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>KPH PURPLE CORALEE 349</AnimalName>
<RegistryNo>P43461953</RegistryNo>
<DateofBirth>11/04/2013</DateofBirth>
<NameofSire>PURPLE MOXY 22X ET</NameofSire>
<SireRegistryNo>P43126458</SireRegistryNo>
<NameofDam>TCC CORKY 6603</NameofDam>
<DamRegistryNo>P42457119</DamRegistryNo>
<Tattoo>349</Tattoo>
<SecondaryTattoo>KPH</SecondaryTattoo>
<UniversalIDNumber>1194F021</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>12/01/2014</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment/>
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers3" msdata:rowOrder="2">
<DocumentID>18474</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>LANGFORDS SWEET N SOUR 4107</AnimalName>
<RegistryNo>43504761</RegistryNo>
<DateofBirth>03/02/2014</DateofBirth>
<NameofSire>LH TNT 1017</NameofSire>
<SireRegistryNo>43199794</SireRegistryNo>
<NameofDam>LANGFORDS LADY 2206 ET</NameofDam>
<DamRegistryNo>43315143</DamRegistryNo>
<Tattoo>4107</Tattoo>
<SecondaryTattoo/>
<UniversalIDNumber>1194F018</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location/>
<OracleBreedID>6398</OracleBreedID>
<JrValidationBreedName>Hereford</JrValidationBreedName>
<ValidationDate>11/24/2014</ValidationDate>
<ValidatedBy>Validator</ValidatedBy>
<ValidationComment/>
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers4" msdata:rowOrder="3">
<DocumentID>18475</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>PURPLE CCC LYDIA 19A</AnimalName>
<RegistryNo>P43406978</RegistryNo>
<DateofBirth>02/05/2013</DateofBirth>
<NameofSire>PURPLE MB WOMANIZER 14UET</NameofSire>
<SireRegistryNo>P42945146</SireRegistryNo>
<NameofDam>PURPLE CMCC NASTIA 9U</NameofDam>
<DamRegistryNo>P42927201</DamRegistryNo>
<Tattoo>19A</Tattoo>
<SecondaryTattoo/>
<UniversalIDNumber>1194F017</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location/>
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>12/01/2014</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment/>
</JrShowCustomerHeifers>
<JrShowCustomerHeifers diffgr:id="JrShowCustomerHeifers5" msdata:rowOrder="4">
<DocumentID>18477</DocumentID>
<ClubName>Perrin FFA</ClubName>
<LastName>Hamman</LastName>
<FirstName>Kaily</FirstName>
<Email>[email protected]</Email>
<Exhibitor>Hamman, Kaily</Exhibitor>
<AnimalName>PURPLE SGW EDEN 12B</AnimalName>
<RegistryNo>P43521932</RegistryNo>
<DateofBirth>04/02/2014</DateofBirth>
<NameofSire>RST TIME'S A WASTIN' 0124</NameofSire>
<SireRegistryNo>43123163</SireRegistryNo>
<NameofDam>PURPLE SM WONDER WOMAN 160Y</NameofDam>
<DamRegistryNo>P43235169</DamRegistryNo>
<Tattoo>12B</Tattoo>
<SecondaryTattoo>12B</SecondaryTattoo>
<UniversalIDNumber>1194F015</UniversalIDNumber>
<Tattoo_Location>TATTOO - Left Ear</Tattoo_Location>
<Secondary_Tattoo_Location>TATTOO - Right Ear</Secondary_Tattoo_Location>
<OracleBreedID>6389</OracleBreedID>
<JrValidationBreedName>Polled Hereford</JrValidationBreedName>
<ValidationDate>12/01/2014</ValidationDate>
<ValidatedBy>Hannah</ValidatedBy>
<ValidationComment/>
</JrShowCustomerHeifers>
</DocumentElement>
</diffgr:diffgram>
</GetJrShowCustomerHeifersResult>
</GetJrShowCustomerHeifersResponse>
Thanks again. -
How to parse an XML document with oracle8i
Has anyone a good link or an example how to decode and store an XML document into an oracle8i database.
I' ve found only good things for oracle9i.
Thank you
RogerHere is an example of parsing xml taken fro Oracle8i 8.1.7 xdk.
This one uses external OS files to pase, but could be easily converted to
use CLOB or VARCHAR2 string for parsing XML documents.
IF you wanted to use CLOB to store and manipulate xml documents you can use XMLParser and XMLDom
packages along with the DBMS_LOB package to do that.
-- This file demonstates a simple use of the parser and DOM API.
-- The XML file that is given to the application is parsed and the
-- elements and attributes in the document are printed.
-- The use of setting the parser options is demonstrated.
set serveroutput on;
create or replace procedure domsample(dir varchar2, inpfile varchar2,
errfile varchar2) is
p xmlparser.parser;
doc xmldom.DOMDocument;
-- prints elements in a document
procedure printElements(doc xmldom.DOMDocument) is
nl xmldom.DOMNodeList;
len number;
n xmldom.DOMNode;
begin
-- get all elements
nl := xmldom.getElementsByTagName(doc, '*');
len := xmldom.getLength(nl);
-- loop through elements
for i in 0..len-1 loop
n := xmldom.item(nl, i);
dbms_output.put(xmldom.getNodeName(n) || ' ');
end loop;
dbms_output.put_line('');
end printElements;
-- prints the attributes of each element in a document
procedure printElementAttributes(doc xmldom.DOMDocument) is
nl xmldom.DOMNodeList;
len1 number;
len2 number;
n xmldom.DOMNode;
e xmldom.DOMElement;
nnm xmldom.DOMNamedNodeMap;
attrname varchar2(100);
attrval varchar2(100);
begin
-- get all elements
nl := xmldom.getElementsByTagName(doc, '*');
len1 := xmldom.getLength(nl);
-- loop through elements
for j in 0..len1-1 loop
n := xmldom.item(nl, j);
e := xmldom.makeElement(n);
dbms_output.put_line(xmldom.getTagName(e) || ':');
-- get all attributes of element
nnm := xmldom.getAttributes(n);
if (xmldom.isNull(nnm) = FALSE) then
len2 := xmldom.getLength(nnm);
-- loop through attributes
for i in 0..len2-1 loop
n := xmldom.item(nnm, i);
attrname := xmldom.getNodeName(n);
attrval := xmldom.getNodeValue(n);
dbms_output.put(' ' || attrname || ' = ' || attrval);
end loop;
dbms_output.put_line('');
end if;
end loop;
end printElementAttributes;
begin
-- new parser
p := xmlparser.newParser;
-- set some characteristics
xmlparser.setValidationMode(p, FALSE);
xmlparser.setErrorLog(p, dir || '/' || errfile);
xmlparser.setBaseDir(p, dir);
-- parse input file
xmlparser.parse(p, dir || '/' || inpfile);
-- get document
doc := xmlparser.getDocument(p);
-- Print document elements
dbms_output.put('The elements are: ');
printElements(doc);
-- Print document element attributes
dbms_output.put_line('The attributes of each element are: ');
printElementAttributes(doc);
-- deal with exceptions
exception
when xmldom.INDEX_SIZE_ERR then
raise_application_error(-20120, 'Index Size error');
when xmldom.DOMSTRING_SIZE_ERR then
raise_application_error(-20120, 'String Size error');
when xmldom.HIERARCHY_REQUEST_ERR then
raise_application_error(-20120, 'Hierarchy request error');
when xmldom.WRONG_DOCUMENT_ERR then
raise_application_error(-20120, 'Wrong doc error');
when xmldom.INVALID_CHARACTER_ERR then
raise_application_error(-20120, 'Invalid Char error');
when xmldom.NO_DATA_ALLOWED_ERR then
raise_application_error(-20120, 'Nod data allowed error');
when xmldom.NO_MODIFICATION_ALLOWED_ERR then
raise_application_error(-20120, 'No mod allowed error');
when xmldom.NOT_FOUND_ERR then
raise_application_error(-20120, 'Not found error');
when xmldom.NOT_SUPPORTED_ERR then
raise_application_error(-20120, 'Not supported error');
when xmldom.INUSE_ATTRIBUTE_ERR then
raise_application_error(-20120, 'In use attr error');
end domsample;
show errors; -
Problem when trying to load an XML document with DTD or XML SCHEMA
Hello
I have tried to load an XML document in Data Services, and I created the xsd file and Dtd file. (With altova xml spy software automatically) to import into SAP Data Services 3.2. .
In Data Services I created the dtd import file DTD and then called the XML file from the DTD (the xml file is validated vs the dtd file), and I could not read the xml correctly because it tells me that an ELEMENT called <item> expected joiners who did not come in the structure of import (dtd), but if the xml.
I understand that the document root is the label: CUSTOMER_FULL_2014, the data flow is as follows:CARGA_XML_CUSTOMER |
Turns out the joiners element is used to separate the xml elements are repeated, but is used at different levels. My idea is that the design will dtd second, or something I'm missing or is incorrectly stated.
Thank you.
xml
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="utf-8"?>
<CUSTOMER_FULL_2014>
<item>
<CUST_NO>202222</CUST_NO>
<ADDRESS>
<item>
<SHIP_TO>202222</SHIP_TO>
<NAME1>Henley.</NAME1>
<STREET>Vitacura #40</STREET>
<CITY>LIMA</CITY>
</item>
</ADDRESS>
<EQUIPMENT>
<item>
<EQUI_NO>81623</EQUI_NO>
</item>
<item>
<EQUI_NO>81633</EQUI_NO>
</item>
<item>
<EQUI_NO>81993</EQUI_NO>
</item>
<item>
<EQUI_NO>82003</EQUI_NO>
</item>
<item>
<EQUI_NO>82013</EQUI_NO>
</item>
<item>
<EQUI_NO>82103</EQUI_NO>
</item>
<item>
<EQUI_NO>82113</EQUI_NO>
</item>
<item>
<EQUI_NO>581203</EQUI_NO>
</item>
<item>
<EQUI_NO>900003-EMER</EQUI_NO>
</item>
<item>
<EQUI_NO>9000033-STOCK</EQUI_NO>
</item>
</EQUIPMENT>
<STORAGE_LOC>
<item>
<STOR_LOC_NO>0001</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
</item>
<item>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 henley</DESCRIPTION>
</item>
</STORAGE_LOC>
</item>
<item>
<CUST_NO>2007933434343</CUST_NO>
<ADDRESS>
<item>
<SHIP_TO>2007933434343</SHIP_TO>
<NAME1>Campos de Almacenaje SA</NAME1>
<STREET>Calacoto2, Calle 1</STREET>
<HOUSE_NO>Piso 1</HOUSE_NO>
<CITY>La Paz</CITY>
</item>
</ADDRESS>
<EQUIPMENT>
<item>
<EQUI_NO>90000-EMER</EQUI_NO>
</item>
<item>
<EQUI_NO>90000333-STOCK</EQUI_NO>
</item>
</EQUIPMENT>
<STORAGE_LOC>
<item>
<STOR_LOC_NO>00012</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
</item>
<item>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 henley</DESCRIPTION>
</item>
</STORAGE_LOC>
</item>
<item>
<CUST_NO>200801333</CUST_NO>
<ADDRESS>
<item>
<SHIP_TO>200801333</SHIP_TO>
<NAME1>CONSTRUCTORA SA.</NAME1>
<STREET>Ruta Panamericana Km 100</STREET>
<CITY>San Antonio 23</CITY>
</item>
</ADDRESS>
<EQUIPMENT>
<item>
<EQUI_NO>1507933</EQUI_NO>
</item>
<item>
<EQUI_NO>1509733</EQUI_NO>
</item>
<item>
<EQUI_NO>90000-EMER</EQUI_NO>
</item>
<item>
<EQUI_NO>90000333-STOCK</EQUI_NO>
</item>
</EQUIPMENT>
<STORAGE_LOC>
<item>
<STOR_LOC_NO>0001</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
</item>
<item>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 henley</DESCRIPTION>
</item>
</STORAGE_LOC>
</item>
</CUSTOMER_FULL_2014>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ARCHIVO DTD CREADO (automáticamente con xml spy)
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD generado con XMLSpy v2014 rel. 2 (x64) (http://www.altova.com) -->
<!ELEMENT CITY (#PCDATA)>
<!ELEMENT item ((SHIP_TO, NAME1, STREET, HOUSE_NO?, CITY) | (CUST_NO, ADDRESS, EQUIPMENT, STORAGE_LOC) | (STOR_LOC_NO, DESCRIPTION) | EQUI_NO)>
<!ELEMENT NAME1 (#PCDATA)>
<!ELEMENT STREET (#PCDATA)>
<!ELEMENT ADDRESS (item)>
<!ELEMENT CUST_NO (#PCDATA)>
<!ELEMENT EQUI_NO (#PCDATA)>
<!ELEMENT SHIP_TO (#PCDATA)>
<!ELEMENT HOUSE_NO (#PCDATA)>
<!ELEMENT EQUIPMENT (item+)>
<!ELEMENT DESCRIPTION (#PCDATA)>
<!ELEMENT STORAGE_LOC (item+)>
<!ELEMENT STOR_LOC_NO (#PCDATA)>
<!ELEMENT CUSTOMER_FULL_2014 (item+)>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The error of MONITOR Data Services
11676
5184
XML-240108
11-04-2014 17:34:16
|Data flow CARGA_XML_CUSTOMER|Reader READ MESSAGE customer OUTPUT(customer)
11676
5184
XML-240108
11-04-2014 17:34:16
An element named <item> present in the XML data input does not exist in the XML format used to set up this XML source in data
11676
5184
XML-240108
11-04-2014 17:34:16
flow <CARGA_XML_CUSTOMER>. Please validate your XML data.
11676
5184
XML-240307
11-04-2014 17:34:16
|Data flow CARGA_XML_CUSTOMER|Reader READ MESSAGE customer OUTPUT(customer)
11676
5184
XML-240307
11-04-2014 17:34:16
XML parser failed: See previously displayed error message.
The Error from Monitor
The metadata DTD
Thanks
JuanHi Juan Juan,
I generated a new XSD file using MS Visual Studio based on your XML file.
The empty spaces in the source is replaced with <Null> in the target table.
Here is the XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="CUSTOMER_FULL_20140207_033015_001">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="CUST_NO" type="xs:unsignedInt" />
<xs:element name="ADDRESS">
<xs:complexType>
<xs:sequence>
<xs:element name="SHIP_TO" type="xs:unsignedInt" />
<xs:element name="NAME1" type="xs:string" />
<xs:element name="STREET" type="xs:string" />
<xs:element minOccurs="0" name="HOUSE_NO" type="xs:string" />
<xs:element name="CITY" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="EQUIPMENT">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="EQUI_NO" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="STORAGE_LOC">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="STOR_LOC_NO" type="xs:unsignedByte" />
<xs:element name="DESCRIPTION" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
For Source XML
<?xml version="1.0" encoding="utf-8"?>
<CUSTOMER_FULL_20140207_033015_001>
<CUST_NO>200530</CUST_NO>
<ADDRESS>
<SHIP_TO>903533</SHIP_TO>
<NAME1>HENLEY - PART MAQUINARIAS S.A.</NAME1>
<STREET>Dean Camilo # 148, San Carlos</STREET>
<CITY>LIMA</CITY>
</ADDRESS>
<EQUIPMENT>
<EQUI_NO>4442</EQUI_NO>
<EQUI_NO>8163</EQUI_NO>
<EQUI_NO>8199</EQUI_NO>
<EQUI_NO>8200</EQUI_NO>
<EQUI_NO>8201</EQUI_NO>
<EQUI_NO>8210</EQUI_NO>
<EQUI_NO>8211</EQUI_NO>
<EQUI_NO>58120</EQUI_NO>
<EQUI_NO>90000-EMERGENCY</EQUI_NO>
<EQUI_NO>90000-STOCK</EQUI_NO>
</EQUIPMENT>
<STORAGE_LOC>
<STOR_LOC_NO>0001</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 HEN</DESCRIPTION>
</STORAGE_LOC>
<CUST_NO>200793</CUST_NO>
<ADDRESS>
<SHIP_TO>200793</SHIP_TO>
<NAME1>Minera San Cristobal S.A.</NAME1>
<STREET>Calacoto, Calle 90, Torre 2</STREET>
<HOUSE_NO>Piso 5</HOUSE_NO>
<CITY>La Paz</CITY>
</ADDRESS>
<EQUIPMENT>
<EQUI_NO>90000-EMERGENCY</EQUI_NO>
<EQUI_NO>90000-STOCK</EQUI_NO>
</EQUIPMENT>
<STORAGE_LOC>
<STOR_LOC_NO>0001</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 HEN</DESCRIPTION>
</STORAGE_LOC>
<CUST_NO>200801</CUST_NO>
<ADDRESS>
<SHIP_TO>200801</SHIP_TO>
<NAME1>ISEMAR S.A.</NAME1>
<STREET>Ruta Km 28.45</STREET>
<CITY>Don Torcuato Paraguay</CITY>
</ADDRESS>
<EQUIPMENT>
<EQUI_NO>15079</EQUI_NO>
<EQUI_NO>15097</EQUI_NO>
<EQUI_NO>90000-EMERGENCY</EQUI_NO>
<EQUI_NO>90000-STOCK</EQUI_NO>
</EQUIPMENT>
<STORAGE_LOC>
<STOR_LOC_NO>0001</STOR_LOC_NO>
<DESCRIPTION>01 Parts Center</DESCRIPTION>
<STOR_LOC_NO>0056</STOR_LOC_NO>
<DESCRIPTION>56 HEN</DESCRIPTION>
</STORAGE_LOC>
</CUSTOMER_FULL_20140207_033015_001>
Output:
Regards,
Akhileshkiran. -
Updating a XML document with a processing instruction
Greetings Guru's
I have a fully functional XML database solution for our new system. The only thing left is for me to update a xml document in the database with a processing instruction to find the style sheet (JAXB strips it out when the XML must go back into the database).
I can update complete nodes and node elements in the xml document using updateXML in a regular update statement, but I do not know how to add the following processing instruction to my documents.
<?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
[pre]
Thanks in advance
DerrickSQL> var xmltext varchar2(4000)
SQL> --
SQL> begin
2 :xmlText := '<Hello>World</Hello>';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> drop table t
2 /
drop table t
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> create table t of xmltype
2 /
Table created.
SQL> set long 10000
SQL> --
SQL> insert into t values (xmltype(:xmltext))
2 /
1 row created.
SQL> select *
2 from t
3 /
SYS_NC_ROWINFO$
<Hello>World</Hello>
SQL> update t set object_value = updateXML
2 (
3 object_value,
4 '/',
5 xmlconcat
6 (
7 xmlpi("xml-stylesheet",'type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"'),
8 object_value
9 )
10 )
11 /
1 row updated.
SQL> select * from t
2 /
SYS_NC_ROWINFO$
<?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
<Hello>World</Hello>
SQL> -
XML-Document with special characters
Hallo
i have an oracle database with a table of XmlType.
Now i want to insert the following document:
<message>
<to>[email protected]</to>
<from>[email protected]</from>
<subject>Question</subject>
<body>über den Wolken</body>
</message>
The problem is the special character "ü" which is transformed to "??". Must i declare a special character set? If yes - where? In the XML-Document or in the Database? And how must i do this?
Thank you very much
cu
HeidiHallo Raghu,
when i insert the following by iSqlPlus in Internet Explorer (on a German WinXP):
insert into xml_table_test values (xmltype ('<message><to>[email protected]</to><from>[email protected]</from><subject>Question</subject><body>über den Wolken</body></message>')) /
a new page is displayed with the following:
Substitution Variables
Enter values for substitution variables in the script to execute:
Variable Value
uuml
and in the inputfield above Value i can insert something (in my case "ü" - i think)
But i want to insert the documents with webdav and then i can´t do this...
when i select this:
select * from nls_session_parameters
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
PARAMETER VALUE
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
it´s all american --> must i change this to German/Europe? How?
Thank you very much
cu
Heidi -
Creation of a XML Document with DTD entry
I am trying to create a XML file on the fly. I use the
NodeFactory to contruct a document (createDocument()). I have
then setStandalone("no") and setVersion("1.0"). when I try to
add a DOCTYPE node via appendChild( new XMLNode("test",
Node.DOCUMENT_TYPE_NODE)), I get a ClassCastException.
This is using the 1.0.1.1.0 xml parser.
What is the mechanism to add a node of this type? I noticed that
the NodeFactory did not have a machanism for creating a DOCTYPE
node.
nullNestor Dutko (guest) wrote:
: I am trying to create a XML file on the fly. I use the
: NodeFactory to contruct a document (createDocument()). I have
: then setStandalone("no") and setVersion("1.0"). when I try to
: add a DOCTYPE node via appendChild( new XMLNode("test",
: Node.DOCUMENT_TYPE_NODE)), I get a ClassCastException.
: This is using the 1.0.1.1.0 xml parser.
: What is the mechanism to add a node of this type? I noticed
that
: the NodeFactory did not have a machanism for creating a DOCTYPE
: node.
There is no mechanism to create a new DOCUMENT_TYPE_NODE object
via DOM APIs. The only way to get a DTD object is to parse the
DTD file or the XML file using the DOMParser, and then use the
getDocType() method. Note that new XMLNode("test",
Node.DOCUMENT_TYPE_NODE) does not create a DTD
object. It creates an XMLNode object with the type set to
DOCUMENT_TYPE_NODE, which infact should not be allowed. The
ClassCastException is raised because appendChild expects a DTD
object (based on the type).
Also, we do not do any validation while creating the DOM tree
using the DOM APIs. So setting the DTD in the Document will not
help in validating the DOM tree that is constructed. The only way
to validate an XML file is to parse the XML document using
DOMParser or SAXParser.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
How do I add (or insert) a node into an XML document with JSTL?
Dear all,
I am trying to use JSTL to store some data from a form into XML. However, I have read many articles in JSTL and only found that it can only be, as far as those articles are concerned, used to "read" data from XML files, but not "write" to them.
Am I missing something in JSTL? Or, if I want to write to an XML file (e.g., insert a new node, or modify a node's data), will I have to write my own bean and then use <c:usebean />?
Thanks very much in advance.
Regards,
RobertJSTL is not a programming language in and of itself. It is intended to help you to write scriptlet free JSPs.
JSP pages (by one school of thought) are intended to function as the "View" in a Model-View-Controller architecture.
Being a view, JSP pages should be able to look at things - but not touch.
The standard pattern is to go to a servlet first, which invokes the logic, and then forwards to a JSP for rendering.
Editing XML by adding new nodes etc etc is thus a function of the java code layer - servlet/action whatever you want to call it.
Giving you the power to edit XML documents via JSTL (ie on a JSP page) takes away from purity of the MVC design.
Hence why they don't provide the tags for manipulating XML, and only provide the database tags with a disclaimer that they should only be used for prototypes/trivial apps!
JSTL is designed to replace scriptlet code on a JSP page.
It can replace 99% of scriptlet code. The other 1% shouldn't be on the JSP in the first place :-)
cheers,
evnafets
Maybe you are looking for
-
so, i know that there are many questions about a locked iphone, but my case is quite different, i think. i just happened to change my passcode this morning before fasting (i'm fasting) and then i left it charged while i went to sleep. stupidly, i did
-
How to use at the same time the audio sounds of a keyboard & the midi sounds with mainstage
Hello! hope you can shed some light on my problem! I want to be able to use at the same time the real sounds of korg sv-1(stage keyboard, but it could be any stage piano with USB midi) and use other sounds from mainstage. Of course i switch between p
-
Sales data not replicated for materials from ECC
Hello Experts, When creating a meterial in ECC, the same gets replicated to CRM 7, but the data maintained in the sales tabs of ECC is not getting replicated to the CRM material master Sales & Distribution tab. I have already maintained the correspon
-
Hi! I upgrade my software to Lion so I don't have the CDs to format my disk.. What I should do? Should I use my snow leopard and then upgrade? or what I have to do? I want to format all my macbook pro for the first time in 3 years. Is a : MACBOOK PRO
-
Delivery is on the billing due list
Good Evening. We have a delivery is on the billing due list that was billed but still is on the billing due list. Can you please let me know how to clear this delivery. chakri