Genearte XML as per its XML schema

How would I generate an XML document from XML-DB which conform to a registered
Schema? My tables and xsd are as follows:
Customer table
==============
create table cust
( id number primary key,
last_name varchar2(50),
first_name varchar2(50),
fullname varchar2(50),
dob date
Cust_address table
==================
create table cust_address
(addr_id number primary key,
address_1 varchar2(100),
address_2 varchar2(100),
county varchar2(4),
home_ph varchar2(20),
office_ph varchar2(20),
cust_id number references cust(id) );
Some data
SQL> insert into cust
2 values( 1, 'Harvey','John','Jeff M Harvey','18-jun-80');
1 row created.
insert into cust_address
values ( 1,' 21 West Trophy Road','Memphis,
TN','0009','901-6782345','901-768234',1);
My XMLSchema is as follows:
===========================
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (
http://www.altova.com
by John -->
<xs:schema
xmlns="
http://www.oaws.org/CAR"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://www.oaws.org/CAR"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="CARData">
<xs:annotation>
<xs:documentation>Customer Contact information etc
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="NameType"/>
<xs:element name="Address" type="AddressType"/>
<xs:element name="PlayerContact">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="NameType"/>
<xs:element name="Address" type="AddressType"/>
<xs:element name="PlayCntySher" type="xs:string"/>
<xs:element name="PlayCntyClk" type="xs:string"/>
<xs:element name="PlayAlsTyp" type="xs:string"/>
<xs:element name="Play" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BankContact">
<xs:complexType>
<xs:sequence>
<xs:element name="BKName" type="xs:string"/>
<xs:element name="BKAddr1" type="xs:string"/>
<xs:element name="BKAddr2" type="xs:string"/>
<xs:element name="BKAddrfnl" type="xs:string"/>
<xs:element name="BKCNTY" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="LTRDT" type="xs:date"/>
</xs:complexType>
</xs:element>
<xs:complexType name="AddressType">
<xs:sequence>
<xs:element name="playaddr1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playaddr2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playaddrfnl" type="xs:string"/>
<xs:element name="playhomecomm">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playwrkcomm">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playcnty">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="25"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="PlayFullName" type="xs:string"/>
<xs:element name="PlayFName" type="xs:string"/>
<xs:element name="PlayLName" type="xs:string"/>
<xs:element name="PlayDefName" type="xs:string"/>
<xs:element name="PlayIDNum">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PlayDob" type="xs:date"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="money">
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CollectorType">
<xs:sequence>
<xs:element name="CollectorNumber" type="xs:integer"/>
<xs:element name="CarFullName" type="xs:string"/>
<xs:element name="CollectorPhone" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
I have registered this schema in to my database schema
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 '
http://tien.oaws.silver:8080/home/CAR/xsd/',
5 xdbURIType('/home/CAR/xsd/CARSchema.xsd').getClob(),
6 True,True,False,True
7 );
8 End;
9 /
PL/SQL procedure successfully completed.
Now I need to generate an XML which include all elements from CUST and
CUST_ADDRESS table and must conform to the XML Schema, need your help.
Thank you.

This is not the proper forum for these questions. Please visit the XML DB forum for help with using XML DB features. XML DB

Similar Messages

  • Error in xml file validation to its relevant xml schema

    Hi All,
    I have 3 xml schema files files from which I generated a XML file using PLSQL.I am getting this error when I am trying to validate xml file to the schema:
    *'WMWROOT' NOT DECLARED*.Can anyone help me with this,I am including the main schema file and also the XML generated.
    XML Schem file:
    Itemdownload.xsd:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="ItemDownload" targetNamespace="http://www.manh.com/ILSNET/Interface" elementFormDefault="qualified"
         xmlns="http://www.manh.com/ILSNET/Interface" xmlns:xs="http://www.w3.org/2001/XMLSchema" version ="2007">
         <xs:include schemaLocation="Item.xsd" />
    <xs:element name="WMWROOT" nillable="true" type="WMWROOT" />
    <xs:complexType name="WMWROOT">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="WMWDATA" type="WMWDATA" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WMWDATA" nillable="true" type="WMWDATA"/>
    <xs:complexType name="WMWDATA">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="Items" type="ItemList" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="Items" nillable="false" type="ItemList" />
    <xs:complexType name="ItemList">
    <xs:sequence>
    <xs:element minOccurs="1" maxOccurs="unbounded" name="Item" nillable="true" type="Item" />
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The generated xml file is:
    <?xml version="1.0" ?>
    <WMWROOT>
    <WMWDATA>
    <Items>
    <Item><Action>Save</Action><UserDef8>10074</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>285.93</Cost><Desc>HP DESKJET PRINTER (EMBLA)</Desc><HarmCode><UserDef8>10074</UserDef8></HarmCode><Item>R145-794</Item><InventoryTracking>Y</InventoryTracking><LongDesc>HP DESKJET PRINTER (EMBLA)</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>7</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem></XRefItem></XRef></XRefs></Item>
    <Item><Action>Save</Action><UserDef8>80862</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>54.27</Cost><Desc>Mirage Micro Mask MED&amp;LG-Internet Pkg</Desc><HarmCode><UserDef8>80862</UserDef8></HarmCode><Item>16359</Item><InventoryTracking>Y</InventoryTracking><LongDesc>Mirage Micro Mask MED&amp;LG-Internet Pkg</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>N</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem>619498163597</XRefItem></XRef></XRefs></Item>
    </Items>
    </WMWDATA>
    </WMWROOT>
    I can provide you with the other 2 dependent schemas if needed.Please reply me!!

    Hey,
    As you said I tried keeping the namespace in xml file and it worked for a strange reason I am getting the same error again,I am not able to figure it why!!
    The error is:
    SAMPLEITEMDLFILE.xml:2,139: no declaration found for element 'WMWROOT'
    The XML document SAMPLEITEMDLFILE.xml is NOT valid (1 errors)
    This is the part of PL/SQL code thru which I am generating the xml:
    UTL_FILE.put_line (l_out_file, '<?xml version="1.0" ?>');
    UTL_FILE.put_line (l_out_file, '<WMWROOT');
    UTL_FILE.put_line (l_out_file, 'xmlns="http://www.manh.com/ILSNET/Interface"> ');
    UTL_FILE.put_line (l_out_file, '<WMWDATA>');
    UTL_FILE.put_line (l_out_file, '<Items>');
    I am validating it in stylus studio tool.
    Can you please help me thru this?

  • Genearte XML based on registered  XML schema

    Hi all!!
    How would I generate an XML document from XML-DB which conform to a registered
    Schema? My tables and xsd are as follows:
    Customer table
    ==============
    create table cust
    ( id number primary key,
    last_name varchar2(50),
    first_name varchar2(50),
    fullname varchar2(50),
    dob date
    Cust_address table
    ==================
    create table cust_address
    (addr_id number primary key,
    address_1 varchar2(100),
    address_2 varchar2(100),
    county varchar2(4),
    home_ph varchar2(20),
    office_ph varchar2(20),
    cust_id number references cust(id) );
    Some data
    SQL> insert into cust
    2 values( 1, 'Harvey','John','Jeff M Harvey','18-jun-80');
    1 row created.
    insert into cust_address
    values ( 1,' 21 West Trophy Road','Memphis,
    TN','0009','901-6782345','901-768234',1);
    My XMLSchema is as follows:
    ===========================
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    xmlns="
    http://www.oaws.org/CAR"
    xmlns:xs="
    http://www.w3.org/2001/XMLSchema"
    targetNamespace="
    http://www.oaws.org/CAR"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="CARData">
    <xs:annotation>
    <xs:documentation>Customer Contact information etc
    </xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Name" type="NameType"/>
    <xs:element name="Address" type="AddressType"/>
    <xs:element name="PlayerContact">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Name" type="NameType"/>
    <xs:element name="Address" type="AddressType"/>
    <xs:element name="PlayCntySher" type="xs:string"/>
    <xs:element name="PlayCntyClk" type="xs:string"/>
    <xs:element name="PlayAlsTyp" type="xs:string"/>
    <xs:element name="Play" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="BankContact">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="BKName" type="xs:string"/>
    <xs:element name="BKAddr1" type="xs:string"/>
    <xs:element name="BKAddr2" type="xs:string"/>
    <xs:element name="BKAddrfnl" type="xs:string"/>
    <xs:element name="BKCNTY" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="LTRDT" type="xs:date"/>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="AddressType">
    <xs:sequence>
    <xs:element name="playaddr1">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playaddr2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playaddrfnl" type="xs:string"/>
    <xs:element name="playhomecomm">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playwrkcomm">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="playcnty">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NameType">
    <xs:sequence>
    <xs:element name="PlayFullName" type="xs:string"/>
    <xs:element name="PlayFName" type="xs:string"/>
    <xs:element name="PlayLName" type="xs:string"/>
    <xs:element name="PlayDefName" type="xs:string"/>
    <xs:element name="PlayIDNum">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="12"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="PlayDob" type="xs:date"/>
    </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="money">
    <xs:restriction base="xs:decimal">
    <xs:totalDigits value="14"/>
    <xs:fractionDigits value="2"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="CollectorType">
    <xs:sequence>
    <xs:element name="CollectorNumber" type="xs:integer"/>
    <xs:element name="CarFullName" type="xs:string"/>
    <xs:element name="CollectorPhone" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    I have registered this schema in to my database schema
    SQL> begin
    2 dbms_xmlschema.registerSchema
    3 (
    4 '
    http://tien.oaws.silver:8080/home/CAR/xsd/',
    5 xdbURIType('/home/CAR/xsd/CARSchema.xsd').getClob(),
    6 True,True,False,True
    7 );
    8 End;
    9 /
    PL/SQL procedure successfully completed.
    Now I need to generate an XML which include all elements from CUST and
    CUST_ADDRESS table and must conform to the XML Schema, need your help.
    Thank you.

    Does the following help at all..
    SQL> call dbms_xmlschema.deleteSchema('http://tien.oaws.silver:8080/home/CAR/xsd/CARData.xsd',4)
      2  /
    Call completed.
    SQL> drop table cust_address
      2  /
    Table dropped.
    SQL> drop table cust
      2  /
    Table dropped.
    SQL> create table cust
      2  (
      3    id number primary key,
      4    last_name varchar2(50),
      5    first_name varchar2(50),
      6    fullname varchar2(50),
      7    dob date
      8  )
      9  /
    Table created.
    SQL> create table cust_address
      2  (
      3    addr_id number primary key,
      4    address_1 varchar2(100),
      5    address_2 varchar2(100),
      6    county varchar2(4),
      7    home_ph varchar2(20),
      8    office_ph varchar2(20),
      9    cust_id number references cust(id)
    10  )
    11  /
    Table created.
    SQL> insert into cust
      2  values( 1, 'Harvey','John','Jeff M Harvey','18-jun-80')
      3  /
    1 row created.
    SQL> insert into cust_address
      2  values ( 1,' 21 West Trophy Road','Memphis, TN','0009','901-6782345','901-768234',1)
      3  /
    1 row created.
    SQL> commit
      2  /
    Commit complete.
    SQL> declare
      2    xmlSchema xmltype := xmltype(
      3  '<xs:schema xmlns="http://www.oaws.org/CAR" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.oaws.org/C
    ntFormDefault="qualified" attributeFormDefault="unqualified">
      4     <xs:element name="CARData">
      5             <xs:annotation>
      6                     <xs:documentation>Customer Contact information etc </xs:documentation>
      7             </xs:annotation>
      8             <xs:complexType>
      9                     <xs:sequence>
    10                             <xs:element name="Name" type="NameType"/>
    11                             <xs:element name="Address" type="AddressType"/>
    12                             <xs:element name="PlayerContact">
    13                                     <xs:complexType>
    14                                             <xs:sequence>
    15                                                     <xs:element name="Name" type="NameType"/>
    16                                                     <xs:element name="Address" type="AddressType"/>
    17                                                     <xs:element name="PlayCntySher" type="xs:string"/>
    18                                                     <xs:element name="PlayCntyClk" type="xs:string"/>
    19                                                     <xs:element name="PlayAlsTyp" type="xs:string"/>
    20                                                     <xs:element name="Play" type="xs:string"/>
    21                                             </xs:sequence>
    22                                     </xs:complexType>
    23                             </xs:element>
    24                             <xs:element name="BankContact">
    25                                     <xs:complexType>
    26                                             <xs:sequence>
    27                                                     <xs:element name="BKName" type="xs:string"/>
    28                                                     <xs:element name="BKAddr1" type="xs:string"/>
    29                                                     <xs:element name="BKAddr2" type="xs:string"/>
    30                                                     <xs:element name="BKAddrfnl" type="xs:string"/>
    31                                                     <xs:element name="BKCNTY" type="xs:string"/>
    32                                             </xs:sequence>
    33                                     </xs:complexType>
    34                             </xs:element>
    35                     </xs:sequence>
    36                     <xs:attribute name="LTRDT" type="xs:date"/>
    37             </xs:complexType>
    38     </xs:element>
    39     <xs:complexType name="AddressType">
    40             <xs:sequence>
    41                     <xs:element name="playaddr1">
    42                             <xs:simpleType>
    43                                     <xs:restriction base="xs:string">
    44                                             <xs:length value="100"/>
    45                                     </xs:restriction>
    46                             </xs:simpleType>
    47                     </xs:element>
    48                     <xs:element name="playaddr2">
    49                             <xs:simpleType>
    50                                     <xs:restriction base="xs:string">
    51                                             <xs:length value="100"/>
    52                                     </xs:restriction>
    53                             </xs:simpleType>
    54                     </xs:element>
    55                     <xs:element name="playaddrfnl" type="xs:string"/>
    56                     <xs:element name="playhomecomm">
    57                             <xs:simpleType>
    58                                     <xs:restriction base="xs:string">
    59                                             <xs:length value="100"/>
    60                                     </xs:restriction>
    61                             </xs:simpleType>
    62                     </xs:element>
    63                     <xs:element name="playwrkcomm">
    64                             <xs:simpleType>
    65                                     <xs:restriction base="xs:string">
    66                                             <xs:length value="100"/>
    67                                     </xs:restriction>
    68                             </xs:simpleType>
    69                     </xs:element>
    70                     <xs:element name="playcnty">
    71                             <xs:simpleType>
    72                                     <xs:restriction base="xs:string">
    73                                             <xs:length value="25"/>
    74                                     </xs:restriction>
    75                             </xs:simpleType>
    76                     </xs:element>
    77             </xs:sequence>
    78     </xs:complexType>
    79     <xs:complexType name="NameType">
    80             <xs:sequence>
    81                     <xs:element name="PlayFullName" type="xs:string"/>
    82                     <xs:element name="PlayFName" type="xs:string"/>
    83                     <xs:element name="PlayLName" type="xs:string"/>
    84                     <xs:element name="PlayDefName" type="xs:string"/>
    85                     <xs:element name="PlayIDNum">
    86                             <xs:simpleType>
    87                                     <xs:restriction base="xs:string">
    88                                             <xs:length value="12"/>
    89                                     </xs:restriction>
    90                             </xs:simpleType>
    91                     </xs:element>
    92                     <xs:element name="PlayDob" type="xs:date"/>
    93             </xs:sequence>
    94     </xs:complexType>
    95     <xs:simpleType name="money">
    96             <xs:restriction base="xs:decimal">
    97                     <xs:totalDigits value="14"/>
    98                     <xs:fractionDigits value="2"/>
    99             </xs:restriction>
    100     </xs:simpleType>
    101     <xs:complexType name="CollectorType">
    102             <xs:sequence>
    103                     <xs:element name="CollectorNumber" type="xs:integer"/>
    104                     <xs:element name="CarFullName" type="xs:string"/>
    105                     <xs:element name="CollectorPhone" type="xs:string"/>
    106             </xs:sequence>
    107     </xs:complexType>
    108  </xs:schema>');
    109  begin
    110    dbms_xmlschema.registerSchema
    111    (
    112      'http://tien.oaws.silver:8080/home/CAR/xsd/CARData.xsd',
    113      xmlSchema,
    114      True,True,False,True
    115    );
    116  end;
    117  /
    PL/SQL procedure successfully completed.
    SQL> set long 100000 pages 0
    SQL> --
    SQL> select xmlelement
      2         (
      3           "CARData",
      4           xmlAttributes
      5           (
      6              'http://www.oaws.org/CAR' as "xmlns",
      7              'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
      8              'http://www.oaws.org/CAR http://tien.oaws.silver:8080/home/CAR/xsd/CARData.xsd' as "xsi:schemaLocation",
      9              '' as "LTRDT"
    10           ),
    11           xmlElement
    12           (
    13             "Name",
    14             xmlElement("PlayFullName",fullname ),
    15        xmlElement("PlayFName",first_name),
    16             xmlElement("PlayLName",last_name),
    17        xmlElement("PlayDefName",null),
    18        xmlElement("PlayIDNum",id),
    19        xmlElement("PlayDob",dob)
    20      ),
    21           xmlElement
    22           (
    23             "Address",
    24             xmlElement("playaddr1",address_1 ),
    25        xmlElement("playaddr2",address_2),
    26             xmlElement("playaddrfnl",null),
    27        xmlElement("playhomecomm",home_ph),
    28        xmlElement("playwrkcomm",office_ph),
    29        xmlElement("playcnty",county)
    30      )
    31         ).extract('/*')
    32    from cust, cust_address
    33   where id = cust_id
    34  /
    <CARData xmlns="http://www.oaws.org/CAR" xmlns:xsi="http://www.w3.org/2001/XMLSc
    hema-instance" xsi:schemaLocation="http://www.oaws.org/CAR http://tien.oaws.silv
    er:8080/home/CAR/xsd/CARData.xsd">
      <Name>
        <PlayFullName>Jeff M Harvey</PlayFullName>
        <PlayFName>John</PlayFName>
        <PlayLName>Harvey</PlayLName>
        <PlayDefName/>
        <PlayIDNum>1</PlayIDNum>
        <PlayDob>1980-06-18</PlayDob>
      </Name>
      <Address>
        <playaddr1> 21 West Trophy Road</playaddr1>
        <playaddr2>Memphis, TN</playaddr2>
        <playaddrfnl/>
        <playhomecomm>901-6782345</playhomecomm>
        <playwrkcomm>901-768234</playwrkcomm>
        <playcnty>0009</playcnty>
      </Address>
    </CARData>
    SQL>

  • Problems using mathml XML Schema in XMLDB

    I have successfully loaded the hierarchy of XML Schema definition documents for the current 'mathml' by adjusting the relative paths in all include and import statements, and by forcing the load to overcome cyclic dependency issues.
    However when I try to create a table using the XMLTYPE or register another schema which is dependent on mathml I receive the following error:
    ERROR at line 1:
    ORA-31079: unable to resolve reference to group "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    Having tried loading into both 9iR2 and 10GR2 databases and pasting the document containing the 'Content-expr.class' into the parent document (i.e. removing the include) I have come to the conclusion that there is a problem with the schema definition.
    However being new to XML I do not know what ths issue is as the file containing the definition (math.xsd) is included well before the references in the parent document.
    Here is the group definition corresponding to the offending reference:
    <xs:group name="Content-expr.class">
    <xs:choice>
    <xs:group ref="ContExpr.class"/>
    <xs:group ref="PresExpr.class"/>
    </xs:choice>
    </xs:group>
    I am also unable to trace which reference is causing the problem as there are several.
    Does anyone have any suggestions as to what could be causing this issue, or how I can obtain further diagnostics?
    Any help much appreciated.
    Robert Honeyman
    *********** New info ***************
    OK. I have tried further to register the schema, and have the following additional information.
    I determined that I thought my problem was cyclic dependencies being resolved ONLY by virtue of the parent file mathml2.xsd. I therefore pasted all the files together in include order so that this was no longer an issue. I then performed the following actions:
    1. I tried to register into Oracle 9iR2 database (9.2.0.4) and received the following error:
    ERROR at line 1:
    ORA-31151: Cyclic definition encountered for group: "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 131
    ORA-06512: at line 14
    2. I then tried registering the schema into an Oracle 10G Release 2 database as well, and received the following error:
    ORA-31084: error while creating table "MEDLINE"."math729_TAB" for element
    "math"
    ORA-01792: maximum number of columns in a table or view is 1000
    ORA-02310: exceeded maximum number of allowable columns in table
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    My conclusions are as follows:
    1. 9iR2 (the version I was using at least 9.2.0.4) can't handle cyclic dependencies at all, or at least not complex ones.
    2. Neither 9iR2 or 10gR2 can handle cyclic dependencies (or other dependent definitions managed purely by virtue of a parent file with multiple include statements)
    3. 10gR2 can handle cyclic dependencies when they are all defined in the same file or resolved by an explicit include regardless of complexity.
    4. 10gR2 cannot handle highly complex XML Schema definitions due its limit of 1000 columns per table.
    Does anyone have any comments on these conclusions?
    I don't even want to handle Mathml, just another schema definition that imports it. I may try to make my own adjustments.
    Message was edited by:
    rhoneyman
    null

    Thanks, I found the relevant sections in the XML DB 10GR2 documentation (chapter 3 I think). As far as I can tell my options are to either use one of the following:
    - top-down technique creating tables for sub elements in the schema definition
    - bottom-up technique collapsing some of the lower elements into CLOBs (I guess this is semi-structured storage)
    The problem with Mathml is that it seems quite complex, with only one global schema element and many nested elements, hence only one table is created by XMLDB and it logically follows that we run out of columns.
    To get it to work is likely to involve a fair amount of manual schema modification, which incurs a maintenance overhead for me.
    It would be good if Oracle could provide a way of simplifying this maintenance of complex schemas to get them to be registered. I guess this would be increasing the number of columns alllowed for a table or offering some other parametric option for DBMS_XMLSCHEMA.REGISTER_SCHEMA that allowed a threshold and either a top-down or bottom-up approach to be taken automatically.
    For the time being I am using a simplified schema that does not depend on Mathml for my storage needs.

  • XML instance validation against XML schema

    How can I get a reference on the error node object after
    validation against an XML schema ?
    Ex. :
    DOMParser domP = new DOMParser();
    domP.setXMLSchema(schemaDoc); // schemaDoc = ref. on an XMLSchema
    domP.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    domP.parse(reader); // reader contains the XML instance data
    If an error occurred, I only get a message string. What I need is to get a reference on the node object which contains the error in order to retrieve its properties to the schema.
    I could then alert the user with a message such as :
    "Data xxx is not valid ; it must be comprised between yy and zz...".
    Did somebody solve this problem ? May I use the XMLError class to do this ?
    Thank you

    Hi Ray,
    Were you able to resolve this issue? I am encountering a very similar problem where I am not connected to the internet and it fails during the newSchema method on javax.xml.validation.SchemaFactory. I have attempted to implement the suggestions of ExtremeGardener and vidyut with no luck.
    Per ExtremeGardener's suggestion of replacing xmlns:xs="http://www.w3.org/2001/XMLSchema" with xmlns:xs="XMLSchema.xsd" and storing it locally, it gave me an error for trying to set the "xs" or "xsd" prefixes to anything other than "http://www.w3.org/2001/XMLSchema." I forget the exact error. I also tried to use my own prefix and it did not like that either.
    Per vidyut's suggestion of using a catalog resolver, I believe that I have tried that too (if I understand correctly). I created an LSResourceResolver and tied it to the SchemaFactory. I can invoke it for a namespace but that did not resolve the issue because it only invokes the resolver on an import, include, or redefine. I believe that it is trying to reach the internet due to the xmlns:xs="http://www.w3.org/2001/XMLSchema" attribute within the top-level schema element in the XSD and I know of no way to invoke it for that.
    I also created an ErrorHandler and tied it to the SchemaFactory. That shows me the errors and they are all related to the standard XML data types defined in XMLSchema.xsd. The errors that I am seeing are all of this form: "UndeclaredPrefix: Cannot resolve 'xs:string' as a QName: the prefix 'xs' is not declared."
    I am currently using the SchemaFactory in Java 1.5, but I am thinking about trying the Xerces SchemaFactory since they are not exactly the same implementation.
    Does anyone have any other suggestions? Any help you can provide would be greatly appreciated!
    Thanks,
    betzro1

  • Xml validation with xml schema

    Hi
    I want to do the validation of a xml file against the XML schema.How can i do that.
    As per jaxp we can do the validation of an xml file against DTD ,CAN we do the validation against XMLschema in a same way.
    Please help its urgent.
    regards
    prateek

    if you're using the Xerces parser, you def. can.
    if u look at the SAXCount example, you'll see a certain amount of attributes are set to true/false.
    one of these is Schema validation. set it to true, run the SAXCount.java example, and your XML is validated against it's XML Schema,

  • XML Schema to generate table data from a repeating subform data

    Hi All, I would like to have a check box that when checked, will hide a quotation form, and make a purchase order form visible, carrying over some of the field data from the quotation form into a new table on the Purchase order form. I've attached this form at https://workspaces.acrobat.com/?d=pqpsXx5VPi*LkMeVKrX57w if you would like to take a look. When the checkbox is unchecked, it will hid the PO form, and make the quite form visible.
    The idea behind this is that my client will create his quote and send t to his customer. Once the customer accepts the quote, he can just click a button to generate his purchase order that he will send to his supplier.
    It seems that because I've got buttons to add rows on the quote form that the problem is more complex. I would be able to do this myself if the table had a fixed number of rows and I was able to use global fields and naming each cell something different, but beacuse it's a single repeating subform, I can't seem to make it work at all.
    I understand that because its a repeating subform that I need to create an XML schema to accomplish this, but also can't figure out for the life of me how to actually create the schema. I've been reading tons of tutorials, but no clue how to apply it to my specific need. I have only been able only find info on how to bind the data source once it's been created.
    I would be forever grateful if anyone could help me out.
    Thank you!

    I've edited your form and put it here.
    Here's what I've done:
    Inserted script into your checkbox renamed Accpted that hides/shows the Purchase Order/ Sales Quotation
    I've included a scripting object with a function I wrote to transfer data from like named fields/subforms from one section to another
    Inserted a few common fields into your Purchase Order table
    What you need to do is complete the development of your Purchase Order table. Make sure the common fields between the quote and purchase tables have the same names in order to transfer the data.
    No schema necessary.
    Kyle

  • Unable to locate Spring NamespaceHandler for XML schema namespace

    I am not sure if this is the best practice approach but this is the problem I am ruining into. Below, I explain what I am doing:
    1) What I am doing:
    =============
    Based on the oracle incubator example (http://coherence.oracle.com/display/INCUBATOR/Processing+Pattern+Examples); I am running a server and submitting tasks through a proxy application that submits them to ProcessingPatternConfigurator; let's call my task processReport.
    a) my processReport is using spring and ibatis together, I created a utility static class to obtain a spring context and retrieves beans using the following lines ( see exhibit "A1 and A2" below).
    b) when my task calls the context and that spring loads, it is failing with the error show in exhibit "B".
    I suspect I am missing a lib? I googled the error and searched you site but could find a meaningful discussion on it. I guess my question is if this is not the best approach, how do I integrated with spring initializing beans and setting up ibatis framwork, providing beans and database access through Ibatis for each task ruining on the grid (processReport).
    thanks
    A1) processReport (submitted in the grid) uses this line
    AbstractXmlApplicationContext ctx = (AbstractXmlApplicationContext) AmrContextUtil.getInstance();
              System.out.println("Classpath loaded. Executing Report...");
              ReportProcessor repProcessor = (ReportProcessor) ctx.getBean("reportProcessor");
    A2) Here is the AmrContextUtil:
    import org.springframework.context.support.AbstractApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    public final class AmrContextUtil {
         private static AbstractApplicationContext ctx = null;
         public AmrContextUtil() {
              super();
         public final static synchronized AbstractApplicationContext getInstance(){
              if (ctx == null){
                   ctx = new ClassPathXmlApplicationContext("classpath:config/applicationContext.xml");
                   setCtx(ctx);
              return ctx;
         public final static synchronized AbstractApplicationContext getCtx() {
              return ctx;
         public final static synchronized void setCtx(AbstractApplicationContext ctx) {
              AmrContextUtil.ctx = ctx;
    B) Here is the error reported by the server:
    2010-02-10 15:42:28.312/57.986 Oracle Coherence GE 3.5.2/463 <Warning> (thread=GridExecutor:Thread-2
    , member=1): TaskRunner - Failed to process 0x00000126B99E5524AC1F007AAB1587BBCFEC5E6637E1DED6CCB984
    03D6AADF4D due to:org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:config/reports-application.xml] Offending resource: class path resource [config/applicationContext.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing
    Offending resource: class path resource [config/reports-application.xml] Bean 'reportSqlMapConfig'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: *Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/util]*
    *Offending resource: class path resource [config/reports-application.xml] Bean 'reportSqlMapConfig'*
    -> Property 'resourceMap'
    c)Here is my application-context.xml offending line:
    <bean id="reportSqlMapConfig"
    class="com.xx.report.generator.ReportSqlMapConfig">
    <property name="resourceMap">
    <map>
    <entry>
    <key>
    <util:constant static-field="com.xx.report.domain.ReportType.FPA"/>
    </key>
    <value>classpath:config/diehardReportSqlMapConfig.xml</value>
    </entry>
    <entry>
    <key>
    <util:constant static-field="com.xx.report.domain.ReportType.FCN"/>
    </key>
    <value>classpath:config/falconReportSqlMapConfig.xml</value>
    </entry>
    <entry>
    <key>
    <util:constant static-field="com.xx.report.domain.ReportType.ODS"/>
    </key>
    <value>classpath:config/odsReportSqlMapConfig.xml</value>
    </entry>
    </map>
    </property>
    </bean>

    My guess is that something is broken in the configuration of the cacheServer and its not finding
    all of the dependencies that your process pattern application needs. Probably the best way
    to debug this stuff is to define a static main in your runnable task which will make the call
    to the run() method and invoke it as the main class using the identical settings (classpath,
    run directory) that you are using to launch the Coherence cache server.
    Regards,
    Bob

  • Try to do my first XML Schema in SQL Server 2012 Mangement Studio(SSMS2012)-How to execute the xsd and xml files in SSMS2012?

    Hi all,
    I learmed the basic stuff of XML, DTD, DOM, etc. long time ago. Now, I came back to resume my XML journey and try to learn the XML Schemas, XPath and XQuery. I have Microsoft SQL Server 2012 Management Studio (SSMS2012) in our computer network. From
    Page 221 of the old Book "Beginning XML 2nd Edition" written by David Hunter, et.al., (published by Wrox), I copied the name5.xsd and name5.xml :
    <?xml version="1.0"?>
    <schema xmlns=http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.wrox.com/name" xmlns:target="http://www.wrox.com/name"
    elementFormDefault="qualified">
    <element name="name">
    <complexType>
    <sequence>
    <element name="first" type="string"/>
    <element name="middle" type="string"/>
    <element name="last" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    <?xml version="1.0"?>
    <name
    xmlns=http://www.wrox.com/name"
    xmlns:xsi="http://www.wrox.org/2001XMLSchema-instance"
    xsi:schemaLocation="http://www.wrox.com/name name5.xsd"
    title="Mr.">
    <first>John</first>
    <middle>Frizgerald</middle>
    <last>Doe</last>
    </name>
    How can I execute these two files in my SSMS2012 for doing my first XML Schema trial?
    Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Eric Zhang, Thanks for your nice response.
    1) I saw the CREATE XML SCHEMA COLLECTION (Transact-SQL) and tried  its first example "Create XML schema collection in the database" in my SQL Server 2012 Management Studio (SSMS2012):
    -- Create a sample database in which to load the XML schema collection.
    -- Copied this set of code stsments from Microsoft Library (ms176009)
    -- ColesMS12_20a.sql (saved in C:/Documents/SQL Server Management Studio)
    -- 19 March 2015 1145 AM
    CREATE DATABASE SampleDB
    GO
    USE SampleDB
    GO
    CREATE XML SCHEMA COLLECTION ManuInstructionsSchemaCollection AS
    N'<?xml version="1.0" encoding="UTF-16"?>
    <xsd:schema targetNamespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"
    xmlns ="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
    <xsd:complexType name="StepType" mixed="true" >
    <xsd:choice minOccurs="0" maxOccurs="unbounded" >
    <xsd:element name="tool" type="xsd:string" />
    <xsd:element name="material" type="xsd:string" />
    <xsd:element name="blueprint" type="xsd:string" />
    <xsd:element name="specs" type="xsd:string" />
    <xsd:element name="diag" type="xsd:string" />
    </xsd:choice>
    </xsd:complexType>
    <xsd:element name="root">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="Location" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="step" type="StepType" minOccurs="1" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="LocationID" type="xsd:integer" use="required"/>
    <xsd:attribute name="SetupHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="MachineHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="LaborHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="LotSize" type="xsd:decimal" use="optional"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>' ;
    GO
    -- Verify - list of collections in the database.
    select *
    from sys.xml_schema_collections
    -- Verify - list of namespaces in the database.
    select name
    from sys.xml_schema_namespaces
    -- Use it. Create a typed xml variable. Note collection name specified.
    DECLARE @x xml (ManuInstructionsSchemaCollection)
    GO
    --Or create a typed xml column.
    CREATE TABLE T (
    i int primary key,
    x xml (ManuInstructionsSchemaCollection))
    GO
    -- ////The following code statements are not used in order to create SampleDB
    -- Clean up
    ---DROP TABLE T
    ---GO
    ---DROP XML SCHEMA COLLECTION ManuInstructionsSchemaCollection
    ---Go
    ---USE Master
    ---GO
    ---DROP DATABASE SampleDB
    It worked and I got the following results:
    1 4 NULL sys 2009-04-13 12:59:13.390 2012-02-10 20:16:02.097
    65536 1 NULL ManuInstructionsSchemaCollection 2015-03-19 11:47:17.660 2015-03-19 11:47:17.660
    http://www.w3.org/2001/XMLSchema
    http://schemas.microsoft.com/sqlserver/2004/sqltypes
    http://www.w3.org/XML/1998/namespace
    http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions
    But, I don't undertand (i) what SCHEMA COECTION is, (ii) what <xsd:schema targetNamespace=.....</xsd:complexType> are, (iii) How I can specify my "project specific" schema in the Microsoft SCHEMA COLLECTION to check my xml file.
    2) I dived in the XQuery programmimng in SSMS2012 in the last few weeks. I used the examles of Ad-Hoc XML File Query by Seth Delconte (in
    httpS://www.simple-talk.com/content/print.aspx?article=1756) in my SSMS2012. They worked. But I don't understand the (i) Importing XML data using a function, (ii) Using the XQuery contans()
    function to find substrings, (iii)Efficiency comparisons in the article.
    Please kindly help me in enlightening me to resolve the difficulties listed in 1) and 2).
    Thanks,
    Scott Chang

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • XML Schema - Two Questions

    1. Can a validation requirement such as the one in the following
    example be specified in the XML 1.0 schema:
    The identification information for a student must include either a
    social security number (SSN) or a student id. It is also valid to
    specify both.
    We were able to specify an exclusive or, that is either A or B, using
    the choice group element. A choice group element allows only one of its
    children to appear in an instance and thus works for the case of either
    SSN or student id.
    Can the choice feature be extended to accommodate the inclusive or
    case, that is either A or B or both, as stated in the validation
    requirement?
    If choice cannot be used, is there another schema feature that can be
    used to accommodate this case?
    2. Is there any way to allow child elements of a group to have a
    maxOccurs greater than 1 while at the same time allowing the elements to
    occur in any order. The default, sequence, indicates that the
    sequence of elements within a group must follow the order indicated in
    the schema. The all group allows for flexibility in the order, but
    restricts maxOccurs to 0 or 1. Looking at the following example:
    <complexType name=description>
    <element name=tattoos minOccurs=0 maxOccurs=100>
    <element name= birthdate minOccurs=0 maxOccurs=1>
    <element name=nicknames minOccurs=0 maxOccurs=10>
    </complexType>
    We would like to allow multiple occurrences of tattoos and nicknames and
    also allow the three elements (tattoos, birthdate, nicknames) to be
    specified in any order.
    Is it possible to do this in XML Schema 1.0 and, if so, what is the
    correct syntax?

    1. You may use somewhat cumbersome syntax like:
    choice
    A
    B
    all
    A
    B
    /all
    /choice
    to implement inclusive or.
    2. They (W3 Schema WG) were talking about
    this but decided not to allow it (at least for now). A workaround you may use:
    all
    group ref = group1
    group ref = group2
    /all
    group name=group1
    elem ... maxOccurs = 10
    /group
    Something like that.
    null

  • JSTL - Problem parsing XML file w/ XML schema declarations

    I'm having trouble parsing an xml document that contains XML schema declarations in the root element. I've included 2 snippets, the XML files they're supposed to parse, and their output below. The first one works and the second one doesn't. Could someone please tell me why? I find it hard to believe that no one's run into this before.
    I'm running Tomcat 5.5 and I'm using JSP 2.0, jakarta standard taglibs jars (1.1.2), jdk 1.5.0_04, and the Xalan 2.7.0 jars.
    Here's the first snippet:
    <c:import url="/WEB-INF/config/schools.xml" var="xml" />
    <x:parse doc="${xml}" var="schoolList"/>
    There are <x:out select="count($schoolList//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList//school">
         <x:out select="name"/><br/>
    </x:forEach>it parses the following xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <schools>
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and it outputs:
    There are 3 schools in the file:
    Tumwater Middle School
    Garfield High School
    Tigard High School-----------------------------------------
    The second snippet:
    <c:import url="/WEB-INF/config/schools2.xml" var="xml2" />
    <x:parse doc="${xml2}" var="schoolList2"/>
    There are <x:out select="count($schoolList2//school)"/> schools in the file:<br/>
    <x:forEach select="$schoolList2//school">
         <x:out select="name"/><br/>
    </x:forEach>parses this xml file (note the xml schema declarations):
    <?xml version="1.0" encoding="UTF-8"?>
    <schools xmlns="http://www.serenus.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.serenus.com schools.xsd">
         <school id="34033">
              <name>Tumwater Middle School</name>
              <district>Tumwater</district>
              <type>middle</type>
              <active>false</active>
         </school>
         <school id="17001">
              <name>Garfield High School</name>
              <district>Seattle</district>
              <type>high</type>
              <active>true</active>
         </school>
         <school id="00023">
              <name>Tigard High School</name>
              <district>Tigard-Tualatin</district>
              <type>high</type>
              <active>true</active>
         </school>
    </schools>and its output is:
    There are 0 schools in the file:That's it! No errors at all! I'm 100% certain the variable names, filenames, etc. are correct. I've looked everywhere for an existing answer to this problem, but I can't find one. Is this a known issue? Please help.
    -Ben

    Hi Ben,
    I got exactly the same problem and also could not find any solution.
    Did you find a way out for this problem meanwhile?
    Any help is welcome!

  • XDB annotations on complex XML Schema

    I am currently testing this in 11gr2 Express, while I wait for our DBA to upgrade our main AIX dev instance to 11gr2 enterprise edition.
    I have a fairly complex xmlschema, provided by the IPTC and trying to annotate it to override some of the default sqltype mappings, but running into problems with how/where to annotate.
    From what I have learned so far, annotations to override the sqltype mappings can only be done on complexType and simpleTypes. ComplexTypes must map to a sql object type, and simpleTypes map to a basic atomic sqlType.
    How would you handle an instance where a complex type extends an xs:string.. but need to have this string map to a CLOB and not a varchar2(4000)?
    <xs:element name="inlineData">
                                                      <xs:annotation>
                                                           <xs:documentation>A rendition of the content using plain-text or encoded inline data</xs:documentation>
                                                      </xs:annotation>
                                                      <xs:complexType>
                                                           <xs:simpleContent>
                                                                <xs:extension base="xs:string">
                                                                     <xs:attributeGroup ref="newsContentAttributes" />
                                                                     <xs:attributeGroup ref="newsContentTypeAttributes" />
                                                                     <xs:attribute name="encoding" type="QCodeType">
                                                                          <xs:annotation>
                                                                               <xs:documentation>The encoding applied to the content before inclusion</xs:documentation>
                                                                          </xs:annotation>
                                                                     </xs:attribute>
                                                                     <xs:attributeGroup ref="newsContentCharacteristics" />
                                                                     <xs:attributeGroup ref="i18nAttributes" />
                                                                     <xs:anyAttribute namespace="##other" processContents="lax" />
                                                                </xs:extension>
                                                           </xs:simpleContent>
                                                      </xs:complexType>
                                                 </xs:element>Adding the xdb: mapUnboundedStringToLob annotation to element "inlineData" fails... not valid... and can't add it to the extension either.. so would a viable valid option in this case, be to create a simpleType, call it say "LargeStringToClob"..with a restriction of type xs:String... then annotate this simpleType to map it to a CLOB.
    Then change the inlineData element extension from xs:string to "LargeStringToClob" ? I plan to use an XMLType column with BinaryXML storage...
    I was hoping to not have to modify the xml schema too much, but I guess its to be expected when trying to map it into Oracle.
    I am faced with a similar issue when trying to annotate for Timestamp with time zone...
    some elements are declared as unions of other types. From what I have read, Oracle maps these to varchar2(4000)
    Example:
    <xs:simpleType name="DateOptTimeType">
              <xs:annotation>
                   <xs:documentation>The type of a date (required) and a time (optional).</xs:documentation>
              </xs:annotation>
              <xs:union memberTypes="xs:date xs:dateTime" />
         </xs:simpleType>Even though this is a simpleType... I cannot annotate it to map it to a TimeStamp with Timezone ... would I have to again... create simpleTypes for each of the memberTypes in the union, annotate each one to map to Timestampt with time zone.. then use these new simpleTypes in the union?
    Thanks for any tips or advice!

    odie_63 wrote:
    so if using Binary XML, you are stuck with what Oracle gives you? for instance, the inlineData element is an unbounded string in the schema... Oracle maps it to varchar2(4000).No, Binary XML stores data differently.
    Consider this simple example :
    SQL> begin
    2   dbms_xmlschema.registerSchema(
    3   schemaURL => 'test.xsd',
    4   schemaDoc => '<?xml version="1.0"?>
    5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
    6  <xs:element name="note" xdb:defaultTable="NOTES_TABLE">
    7    <xs:complexType>
    8      <xs:sequence>
    9        <xs:element name="content" type="xs:string"/>
    10        <xs:element name="dt" type="xs:dateTime"/>
    11      </xs:sequence>
    12    </xs:complexType>
    13  </xs:element>
    14  </xs:schema>',
    15   local => true,
    16   genTypes => false,
    17   genTables => false,
    18   enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE,
    19   options => dbms_xmlschema.REGISTER_BINARYXML
    20   );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> CREATE TABLE notes_table OF XMLTYPE
    2  XMLTYPE STORE AS binary xml
    3  XMLSCHEMA "test.xsd"
    4  ELEMENT "note"
    5  ;
    Table created
    SQL> insert into notes_table values(xmltype(
    2  '<note>
    3  <content>'||lpad(to_clob('X'),8000,'X')||'</content>
    4  <dt>2011-11-16T11:56:23+01:00</dt>
    5  </note>'));
    1 row inserted
    SQL> select x.dt
    2       , x.content
    3       , length(x.content)
    4  from notes_table t
    5     , xmltable('/note' passing t.object_value
    6       columns dt      timestamp with time zone  path 'dt'
    7             , content clob                      path 'content'
    8       ) x
    9  ;
    DT                                CONTENT                                                                          LENGTH(X.CONTENT)
    16/11/11 11:56:23,000000 +01:00   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX              8000No issue in storing large strings.Very cool... that works... .. the string limit exceeded expcetion I got earlier was no fault to Binary XML.. but me pasting in too much text in SQLDeveloper insert statement.
    I think I may have been on this for too long... brain is getting fuzzy ;-)
    The approach you outline shows promise and I will go with BinaryXML storage option.
    I need to decide whether to use virtual columns or non-trivial columns at this point, to enforce integrity constraints and possibly some partitioning. We do have a few relational lookup tables to tie into this as well... and will also need to implement VPD.

  • Creating XML Schema from tables With Constraints

    Greetings,
    I'd have an interesting question. I finally am getting familiar with the various kinds of xml solutions provided by the oracle database, but hey here I have another interesting question I can't seem to get into life. I'm currently generating XML Schemas (XSD) from the tables of my database. Its nice its cool however I'd need to have the table's constraints with the xsd:elements also. And heres my problem, I can't seem to insert the table constrains. I'll show you what I mean:
    <xsd:element name="MESSAGE_TABLE">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="MESSAGE_RECORD">
            <xsd:complexType>
              <xsd:all>
                <xsd:element name="ID" type="xsd:integer" minOccurs="1" />
                <xsd:element name="HEADER">
                  <xsd:simpleType>
                    <xsd:restriction base="xsd:string>
                      <xsd:maxLength value="255" />
                    </xsd:restriction>
                  </xsd:simpleType>
                </xsd:element>
              </xsd:all>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
      <!-- I'd need some more things here like... -->
      <!-- Primary key(s) -->
      <xsd:key name="PK_ID_PRIM">
        <xsd:selector xpath="." />
        <xsd:field xpath="ID" />
      </xsd:key>
      <!-- Foreign key(s) -->
      <xsd:keyref name="FK_HEADER_FOREIGN" refer="PK_HEADER_ID">
        <xsd:selector xpath="HEADER" />
        <xsd:field xpath="ID" />
      </xsd:keyref>
      <!-- Unique constraint(s) -->
      <xsd:unique name="UQ_..." ... />
      </xsd:unique>
    </xsd:element>That would fit my business needs, however I may be so blind that I can't see the forest from the tree. Currently I got so far that:
              xmlElement
                  "xsd:schema",
                  xmlAttributes
                      'http://www.w3.org/2001/XMLSchema'      as "xmlns:xsd"
                  xmlElement
                    "xsd:element",
                    xmlAttributes
                      target_table                            as "name"
                    xmlElement               
                      "xsd:complexType",
                      xmlElement
                        "xsd:sequence",
                        xmlElement
                          "xsd:element",
                          xmlAttributes
                            target_table || '_RECORD'         as "name",
                            'unbounded'                       as "maxOccurs"
                          xmlElement
                            "xsd:complexType",
                            xmlElement
                              "xsd:sequence",
                                xmlAgg(ELEMENT)
                    xmlElement
                      "xsd:Key",
                )As you can see this won't be good since I have put a single xml element in there. I guess I'd need something more like an xmlAgg(CONSTRAINTS), however in that case I'm wondering how will the select's FROM part look like.
      FROM
        SELECT  table_name, internal_column_id,
                CASE
                  WHEN data_type IN ('VARCHAR2', 'CHAR')
                  THEN
                    xmlElement
                      "xsd:element",
                      xmlattributes
                        column_name as "name",
                        decode(NULLABLE, 'Y', 0, 1) as "minOccurs"
                      xmlElement
                        "xsd:simpleType",
                        xmlElement
                          "xsd:restriction",
                          xmlAttributes
                            'xsd:string' as "base"
                          xmlElement
                            "xsd:maxLength",
                            xmlAttributes
                              DATA_LENGTH as "value"
                  WHEN data_type = 'DATE'
                  THEN
                    xmlElement
                      "xsd:element",
                      xmlattributes
                        column_name as "name",
                        'xsd:date' as "type",
                        decode(NULLABLE, 'Y', 0, 1) as "minOccurs"
                  WHEN data_type = 'NUMBER'
                  THEN
                    xmlElement
                      "xsd:element",
                      xmlattributes
                        column_name as "name",
                        decode(DATA_SCALE, 0, 'xsd:integer', 'xsd:double') as "type",
                        decode(NULLABLE, 'Y', 0, 1) as "minOccurs"
                  ELSE
                    xmlElement
                      "xsd:element",
                      xmlattributes
                        column_name as "name",
                        'xsd:anySimpleType' as "type",
                        decode(NULLABLE, 'Y', 0, 1) as "minOccurs"
        end ELEMENT
        FROM user_tab_cols c
        WHERE TABLE_NAME = target_table
        ORDER BY internal_column_id
      GROUP BY TABLE_NAME;Thank you very much for all your help!
    Regards,
    Joey
    Edited by: Wrath#87 on 2012.09.05. 22:15

    Thanks for that, answer. That helped me a lot managing primary constraints. However I still have problems managing foreign keys. I come up with the following formula:
              xmlElement
                  "xsd:schema",
                  xmlAttributes
                      'http://www.w3.org/2001/XMLSchema'      as "xmlns:xsd"
                  xmlElement
                      "xsd:element",
                      xmlAttributes
                          upper(target_table) as "name"
                      xmlElement
                          "xsd:complexType",
                          xmlElement
                            "xsd:all",
                                xmlAgg(ELEMENT)
                          SELECT    xmlElement
                                      "xsd:key",
                                      xmlattributes
                                        uc.constraint_name as "name"
                                      xmlElement
                                        "xsd:selector",
                                        xmlattributes
                                          '.' as "xpath"
                                      xmlAgg
                                        xmlElement
                                          "xsd:field",
                                          xmlattributes
                                            ucc.column_name as "xpath"
                                        order by ucc.position
                          FROM      user_constraints uc
                                    JOIN      user_cons_columns ucc
                                    ON        ucc.constraint_name   =   uc.constraint_name
                          WHERE     uc.table_name                   =   upper(target_table)
                          AND       uc.constraint_type              =   'P'
                          GROUP BY  uc.constraint_name
                          SELECT    xmlElement
                                        "xsd:keyRef",
                                        xmlattributes
                                            a.constraint_name as "name"
                                        xmlElement
                                            "xsd:selector",
                                            xmlattributes
                                                c.table_name as "xpath"
                                        xmlAgg
                                            xmlElement
                                                "xsd:field",
                                                xmlattributes
                                                    d.column_name as "xpath"
                                            order by  c.table_name
                          FROM      all_constraints   a,
                                    all_cons_columns  b,
                                    all_constraints   c,
                                    all_cons_columns  d
                          WHERE     a.constraint_name   =   b.constraint_name
                          AND       a.constraint_name   =   c.r_constraint_name
                          AND       c.constraint_name   =   d.constraint_name
                          AND       a.table_name        =   upper(target_table)
              )This gives me the following error message: 00937. 00000 -  "not a single-group group function"

  • Validation with jaxp 1.3 and xml-schema

    I'm totally green when it comes to xml&jaxp. Using jse 1.5 (jaxp 1.3), I'm trying
    to have my app parse and validate an xml doc with xml schema. I want the validation to
    happen using the schema specified in the xml doc. Also, I'd prefer if my application didn't have to set
    the schema to use. As far as I can make out though, it appears that I need to parse the schemaLocation when
    I want to validate using xml schema. Anyone know a way to avoid that step?
    If not, then any idea why I'm getting the following err?
    Error...
    junit.framework.AssertionFailedError: null/null:4,9: Document is invalid: no grammar found.null/null:4,9: Document root element "catalog", must match DOCTYPE root "null".
         at junit.framework.Assert.fail(Assert.java:47)
         at com.rwd.toolbox.junit.AbstractRwdTestCase.printAndFail(AbstractRwdTestCase.java:229)
         at com.rwd.util.xml.XmlUtilsTests.testXmlValidationUsingSchemaDefinedInXmlDoc(XmlUtilsTests.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Code... obviously taken from junit test case...
         DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
         documentFactory.setNamespaceAware(true);
         documentFactory.setValidating(true);
         DocumentBuilder builder = documentFactory.newDocumentBuilder();
         com.rwd.util.xml.Validator v = new com.rwd.util.xml.Validator(_validationStyle);
         builder.setErrorHandler(v);
         Document document = builder.parse(_document);
         where com.rwd.util.xml.Validator extends DefaultHandler. Note that if I add following
         code, then validation works as i expect it... but that's not really an option I care for (at least in this case).
         I would anticipate being able to have the parser see the XSD reference in the XML and
         apply it. Anyway, here's code to programmatically specify an XSD to use for validation....                    
         documentFactory.setAttribute(
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
         "http://www.w3.org/2001/XMLSchema");
         documentFactory.setAttribute(
         "http://java.sun.com/xml/jaxp/properties/schemaSource",
         "file:///C:/workspace31m4/LMSTester/testData/util/xml/o.xsd");
    Finally, the XML file... (example from onJava site)... Note that I've tried changing the URI to file:///c:/..., same result:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--A OnJava Journal Catalog-->
    <catalog
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="file://C:/workspace31m4/LMSTester/testData/util/xml/o.xsd"
    title="OnJava.com" publisher="O'Reilly">
    <journal date="April 2004">
    <article>
    <title>Declarative Programming in Java</title>
    <author>Narayanan Jayaratchagan</author>
    </article>
    </journal>
    <journal date="January 2004">
    <article>
    <title>Data Binding with XMLBeans</title>
    <author>Daniel Steinberg</author>
    </article>
    </journal>
    </catalog>
    and its XSD file (also from onJava)...
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="catalog">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="journal" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="title" type="xs:string"/>
    <xs:attribute name="publisher" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="journal">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="article" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="date" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="article">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="title" type="xs:string"/>
    <xs:element ref="author" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="author" type="xs:string"/>
    </xs:schema>
    Thanks,
    -Paul

    There are other applications using Xerces1.0 so the requirement is that I cannot replace the Xerces jar. Any suggestions.

Maybe you are looking for