Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using isSchemaValid for xmltype

cveaseyAug 8 2004 — edited Aug 9 2004
Hello,
I am trying to validate my xml document against the registered schema. As I have multiple schemas registered, I wanted to use isSchemaValid so that I can pass the URL of the schema I wanted to use. I receive the following error back:

ERROR at line 48:
ORA-06550: line 48, column 1:
PLS-00221: 'ISSCHEMAVALID' is not a procedure or is undefined
ORA-06550: line 48, column 1:

I took the sample from XDB developer's guide. Here's my code:


set serveroutput on;

declare

xmldoc xmltype;
xOut varchar2(4000);

begin

-- populate xmldoc

xmldoc:=xmltype('<?xml version="1.0" encoding="UTF-8"?>
<AttendedSchool xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/xsd/CRCNewLoanRequest.xsd">
<OPEID>00234500</OPEID>
<Student>
<Index>
<SSN>123445555</SSN>
<BirthDate>1980-02-02</BirthDate>
<LastName>LITTLE</LastName>
</Index>
<Contacts>
<PermanentAddress>
<AddressLine>123 PARK AVE </AddressLine>
<City>NEW YORK</City>
<StateProvinceCode>NY</StateProvinceCode>
<PostalCode>00112</PostalCode>
</PermanentAddress>
</Contacts>
<FFELPLoanInformation LoanKey="2" Processed="N">
<StudentLevelCode>Second</StudentLevelCode>
<FinancialAwardBeginDate>2003-09-01</FinancialAwardBeginDate>
<FinancialAwardEndDate>2004-05-30</FinancialAwardEndDate>
<ProcessingTypeCode>PO</ProcessingTypeCode>
<FinancialAwardID>0023456000P78YREW</FinancialAwardID>
<EnrollmentStatusCode>FullTime</EnrollmentStatusCode>
<GraduationDate>2007-05-15</GraduationDate>
<FederalApplicationFormCode>M</FederalApplicationFormCode>
<PromissoryNoteDeliveryCode>Paper</PromissoryNoteDeliveryCode>
<Guarantor>
<OPEID>012</OPEID>
</Guarantor>
<SerialLoanRequestedIndicator>true</SerialLoanRequestedIndicator>
</FFELPLoanInformation>
</Student>
</AttendedSchool>');



-- validate against XML schema
xmldoc.isSchemaValid('http://www.oracle.com/xsd/CRCNewLoanRequest.xsd');
if xmldoc.isSchemaValid = 1 then --
dbms_output.put_line(' Valid');
else --
dbms_output.put_line(' IN-Valid');
end if;
end;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2004
Added on Aug 8 2004
6 comments
553 views