ID and IDREF in XSU

Hi,
How does XSU deal with ID and IDREF in XML document? Are they treated as normal attributes?
null

Do you mean XML Parser? To my knowledge the XML SQL Utility (XSU) does not do anything with ID and IDREF's since it's producing XML from SQL statement result sets.

Similar Messages

  • SAXException2 with ID and IDREF

    Have an XSD that declares an object with an ID and another object with an IDREF as follows:
    <xs:element name="subject" maxOccurs="unbounded">
    <xs:complexType>
    <xs:attribute name="id" type="xs:ID" use="required"/>
    <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="subjectRelationship" minOccurs="0" maxOccurs="unbounded">
    <xs:complexType>
    <xs:attribute name="parentSubject" type="xs:IDREF" use="required"/>
    <xs:attribute name="childSubject" type="xs:IDREF" use="required"/>
    </xs:complexType>
    </xs:element>
    Using JAXB, I instantiate and add two "subject" objects. The first has attribute id of "z1_id" and attribute name of "z1_name". The second has attribute id of "z2_id" and attribute name of "z2_name".
    Again using JAXB, I instantiate and add one "subjectRelationship" object. It has attribute parentSubject of "z1_id" and attribute childSubject of "z2_id".
    When I attempt to marshal the above, I get the following exception:
    com.sun.istack.SAXException2: Object "z1_id" is found in an IDREF property but this object doesnt have an ID.
    I presume that I am guilty of some misunderstanding of the ID and IDREF mechanism, but what? I cannot find any example on the web of a proper ID and IDREF implementation. Thanks.

    Thanks for reply. I have done almost similar thing in my code, but I get below exception.
    javax.xml.bind.MarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-minLength-
    valid?&0&1&null]
    XSD
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:complexType name="noteType">
            <xs:simpleContent>
                <xs:extension base="xs:IDREFS">
                    <xs:attribute name="att1" type="xs:int"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
        <xs:complexType name="noteType1">
            <xs:simpleContent>
                <xs:restriction base="noteType">
                    <xs:enumeration value="ID1001"/>
                    <xs:enumeration value="ID1002"/>
                    <xs:enumeration value="ID1003"/>
                    <xs:enumeration value="ID1004"/>
                </xs:restriction>
            </xs:simpleContent>
        </xs:complexType>
        <xs:element name="child" type="noteType1"/>
        <xs:element name="root">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="child"/>
                    <xs:element name="refId" type="xs:ID"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:schema>
    XML
    <?xml version="1.0" encoding="Shift_JIS" standalone="yes"?>
    <root>
         <child att1="0">ID1001</child>
         <refId>ID1001</refId>
    </root>
    Java code
    SchemaFactory scf = SchemaFactory
    .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = scf.newSchema(new File("text.xsd"));
    JAXBContext jc = JAXBContext.newInstance("generated");
    ObjectFactory obj = new ObjectFactory();
    Root root = obj.createRoot();
    NoteType1 note1 = obj.createNoteType1();
    note1.setAtt1(0);
    root.setRefId("ID1001");
    root.setChild(note1);
    Marshaller m = jc.createMarshaller();
    m.setSchema(schema);
    m.setProperty("jaxb.formatted.output", Boolean.TRUE);
    m.setProperty("jaxb.encoding", "Shift_JIS");
    m.setEventHandler(new ErrorHandler());
    m.marshal(root,new FileOutputStream("test.xml"));

  • ID and IDREF attributes in an XSD

    Does anybody know if the ID and IDREF attributes within an XSD schema are implied when inserting an XML document or do I have to invoke an XML parser and do it via a DTD?
    When I test the XSD no validation is being performed on the ID and IDREF attributes. Yet when I use the parser the document raises the required errors.
    Regards
    Andrew
    Schema extra:
    <xs:complexType name="PAYMENT" xdb:SQLType="XML_PAYMENT">
    <xs:sequence>
         <xs:choice>
    <xs:element name="USER_ID" type="xs:integer" nillable="false" xdb:SQLType="NUMBER" />
    <xs:element name="SERVICE_ID" type="xs:integer" nillable="false" xdb:SQLType="NUMBER" />
         </xs:choice>
         <xs:element name="CHARGE" type="CHARGE_TYPE" />
    </xs:sequence>
    <xs:attribute name="PAYMENT_ID" type="xs:ID" use="required" />
    <xs:attribute name="PAYMENT_IDREF" type="xs:IDREF" />
    </xs:complexType>

    Mark,
    I tried this with a valid schema and the function returns zero - false. Yet when I query the table the function says it is valid.
    SQL
    SELECT x.charge_doc.isSchemaValid('http://otn.oracle.com/ServiceCharge.xsd','SERVICE_CHARGE')
    FROM service_charge x;
    returns 1 (valid).
    CREATE OR REPLACE TRIGGER validate_service_charge
    before insert on service_charge
    for each row
    declare
    begin
    if :new.charge_doc.schemavalidated() = 1 then
         dbms_output.put_line('Data is valid');
    else
         dbms_output.put_line('Data is invalid');
    end if;
    end;

  • How To Install and run XML/XSU/XDK?

    Hello,
    I have installed Oracle 8.1.7, have downloaded the utilities
    and xdk but how to get all this integrated so I can work with
    the sample codes?
    I dont see the $ORACLE_HOME/rdbms/admin/dbmsxsu.sql -- this is
    the SQL script which builds the XSU's PL/SQL API. xsu12.jar
    need to be loaded into the database before dbmsxsu.sql is
    executed. This script is automatically ..Nor do I see catxsu.sql.
    I assume this creates the xdkdemo/xdkdemo (user/password)? I
    also re-run the runInstaller and attempt to see on the list any
    XSU related installed or to be installed and not seeing it on the
    list. What do I need to download?
    A nice step by step how to install and test the install would
    be nice.
    Thanks in advance for any response.

    I entered "install XSU" into the "search" box and got the
    following back:
    http://www.oracle.com/pls/use/use_query_html_v3.submit_query_inpu
    t?p_adv_query_text=install+XSU&p_origin=OTN&p_person_id=100081&p_
    community=technet_adv&p_doc_location_array=Place+Holder&p_doc_loc
    ation_array=document&p_location_array=&p_keyword_array=100017&p_v
    alue_array=technet.oracle.com%2C+Discussion+Groups&p_date_begin=q
    date&pdate_end=q_date&p_max_return=200
    (GOD I hope that worked!)
    In any case, 2 documents came back. I think this one is probably
    what you want.
    http://download-east.oracle.com/otndoc/oracle9i/901_doc/appdev.90
    1/a88894/appgxsu.htm
    Mike

  • Managing commit and rollback via XSU

    Hi there
    I am using the XSU for Java version 8.1.7. on an Oracle 8.1.7 database.
    I am managing updates on multiple tables from a single XML document, by splitting the XML into sections and calling insertXML, updateXML and deleteXML for each table requiring changes.
    I would like to know how I can manage any commits on the database, so that the whole batch may be rolled back if some data is not committed. Is there a call in the XSU to handle this, or should it be done on the JDBC connection? I have looked at the setBatchSize and setCommitBatch functions, but they seem to be dependent on the number of rows of XML being processed, and I just want to commit after all calls to the XSU have completed successfully.
    Can anyone help or enlighten me?
    TIA
    Tim McMaster

    Trouble using forums?
    Can this be solved
    Still having problems!
    Why would you want to start a new thread?
    This just makes it harder for people to help you because all of a sudden they have to
    * ask you lots of questions because you don't really provide enough info, or
    * search for the old threads and read through what happened so far.
    Have you done basic troubleshooting?
    [ like making a test table with all the same columns [b]except that infamous 'Postco' column - and test inserting into this test table? ]

  • Cross-reference between structured and unstructured FM documents

    Hello,
    Is it possible to retain FM cross-references from structured to unstructured FM documents during an XML round trip?
    From what I know, cross-references between or inside structured documents form pairs of ID and IDREF, while cross-references to unstructured documents are dumped as normal text and lose their functionality.
    The unstructured target documents might be converted to Structured FM at some point, but for the time being I'd like to find another solution. Do you know any solution to this?
    Thanks,
    Johannes

    Johannes,
    This is just a guess, because I do not do this.
    First, of course, you cannot export the unstructured file to XML, because it is unstructured.
    Second, IF the cross-reference from the structured file to the unstructured file were done via your cross-reference ELEMENT, then the cross-reference element should export to XML as an XML element with one of its IDref attribute set to the ID of something in the unstructured file. When you open the XML file in FrameMaker, the cross-reference is re-established.
    In other words, when exporting to XML, FrameMaker does not care to what you are referencing. It just converts the cross-reference element into an element with an attribute in the XML file. So, it should work as expected when opened in FrameMaker. Of course, I am assuming your read-write file is set up to handle cross-references.
    On the other hand, IF you are creating your cross-reference from the structured file by simply inserting a cross-reference, that is NOT as an element, then I do not know what happens. If it is being exported as text, then I am not sure FrameMaker will know what to do with it when you reopen the XML file.
    Hope this helps,
    Van

  • Using XSU to process multiple record sets

    Have a design question about XML, Java and Oracle's XSU. This is a common task when importing external data that should be of general interest.
    I have an incoming XML document with multiple records with a known DTD. Before the records can be inserted into the database, part of
    the record must be used to do a lookup for a foreign key. The resulting foreign key is then combined with the other part of the
    record to create a valid input record for the database.
    My question is what's the most efficient way to do this? I assume the general approach must go something like:
    begin
    while (records in xml doc)
    1. parse the incoming XML to extract the next record
    2. if the lookup data change, do a lookup for this record using XSL
    3. combine the resulting foreign key with the data to create
    an insert query
    4. add the insert query as a document fragment to a second XML document.
    use XSU to insert the second XML doc with multiple records.
    end
    I've figured out how to do most of this, except for step 1 above: is there an easy way to extract the next record from an XML doc if I know the row nodes and the DTD? Or do I just have to traverse all the XML nodes until I hit my next row tag?
    Appreciate any suggestions; this is a handy discussion list!
    --Rick Casey
    Rick Casey, Graduate research assistant CADSWES, http://cadswes.colorado.edu
    University of Colorado at Boulder [email protected] 303.492.0892
    null

    Yes, typical behavior is that when you have multiple outputs it will create a one row IllumDoc to wrap them all together with OuputParameter=* (and the xml will be ignored unless it is the only output property or you've requested it by name).
    How about just using "/Lighthammer/Illuminator?QueryTemplate=xxxx/yyyy&Content-Type=text/xml" or "/Lighthammer/Runner?Transaction=xxxx/yyyy&OutputParameter=OutputXML" which will both return your multi-rowset output?
    I may be mistaken, but I believe the XacuteResponse was simplified to not include the Rowsets outer node because certain systems had problems digesting the layers, in fact you don't get the <Columns/> section either in the single Rowset.
    Rick - any feedback to this SOAP simplification from Xacute?

  • Conditional validation of documents (ignoring IDREFs)

    I am storing one large XML file in a dbxml container adding and modifying its parts. Every part can be considered a stand-alone document with references to other parts (IDs and IDREFs). I would like to be able to validate every such part against a DTD but ignoring errors which arise from broken references. Is it possible with dbxml or should I do it externally?
    Thanks in advance!

    DB XML can't do that for you - you will need to find a way to do that before putting your documents in to DB XML. However, using the events API (new to 2.3), you should be able to streamline the document validating and adding process using a pipeline of events.
    John

  • Database mapping to XML

    Hi all...
    I have 6 tables in an Oracle DB that I want to export to XML. 4 of these tables have relationships (primary key - foreign key). As a result, I want to have all related objects mapped as child elements of their respective parent.
    So the result should look like this:
    <root>
      <table1>
        <field1/>
        <field2/>
        <table2>
          <field2_1>
          <field2_2>
        </table2>
      </table1>
    </root>
    How can I achieve this?
    Any suggestion is welcome...
    thx in advance...
    sj

    You can create object view on top of the tables and then use XSU.

  • Delimited file to xml

    Delimited file to xml
    Does anyone have a quick way to convert a delimited file stored as a CLOB into a another CLOB as an XML datagram?
    Thanks

    The simplist way is that you to write a program to do the conversion using the SAX/DOM API.
    Or you probably can write the delimitated file, create a temporary table, modify the file and using SQL*Loader to load to the table, and then use XSU to generate the XML document.
    You may also write the file out and use the external table...

  • "Invalid UTF8 encoding" troubleshooting

    How can I troubleshoot the error message "Invalid UTF8 encoding" ?
    I get this every now and then from oraxml command line utility and also from XSU (xsql pages and command line utility).
    Thanks,
    Peter.
    null

    Thanks for the replies.
    I'm using entities all the time, so that's not the problem.
    The encoding tip was definately usefull. With one of my problem files, I could parse it after adding encoding="ISO-8859-1". However I would still like to know exactly what and where the problem was. Are there any tools that can tell me i.e. if non-ISO characters are used ?
    I dont have control over how theese files are produced, I'm just recieving them from another source and told they are validated in a program called XmlSpy.
    I do have a related issue about storing unicode characters i CLOB columns in a WE8ISO8859P1 database. I've posted a question about this under a seperate topic.
    -- Peter
    null

  • JDBC equivalent of OracleXMLSave.setDateFormat()?

    The Orace XSU class OracleXMLSave has a method setDateFormat().
    How can I accomplish the equivalent in JDBC?
    The NSL_DATE_FORMAT of my server "RRRR-MM-DD HH24:mm:ss"
    I have a bunch of ASCII files I'm trying to load which have "MM/DD/YYYY" format.
    In PL/SQL and/or Oracle XSU I just set the date format and then execute something like
    insert into myfile columns ( mydatecol ) values '01/01/1999' )
    However, when using JDBC I haven't figured out how to set the date format for the session/connection/whatever globally.
    I know I can use JDBC date escaping BUT that requires I know which columns are dates. If I can just set the format for the session to match the load file I only have to provide columns names and values (as strings).
    R.Parr
    Temporal Arts

    None by default.
    You could use REF CURSOR as an OUT parameter of a stored procedureCREATE OR REPLACE PACKAGE myPkgGetCursor IS
        TYPE recSet IS REF CURSOR;
        PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER);
    END myPkgGetCursor;
    CREATE OR REPLACE PACKAGE BODY myPkgGetCursor AS
        PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER) IS
        BEGIN
            OPEN recList FOR <queryStatement>;
        END getList;
    END myPkgGetCursor;Use CallableStatement and specify myPkgGetCursor.getList

  • XMLReader ArrayOutOfBoundsException

    I have written a java program which takes in an XML string and uses the XSU (XML SQL Utility for Java, version 1.2.0) to parse it and insert it's data into a database. The problem is, I keep getting two ArrayOutOfBoundsExceptions, thrown from the XMLReader and XMLUTF8Reader code. Strange thing is, the code actually works fine and the data is inserted.
    Has anyone else had problems with the XSU throwing out of bounds exceptions?
    P.S. I've used this XML SQL utility before and it has worked fine.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    [b]XMLReader and XMLUTF8Reader are not part of XML SQL Utility, but rather classes in the XML Parser v2 code.
    You must be running this in a debugger that is showing you "All handled exceptions" because the XML Parser uses an optimization that it catches an ArrayOutOfBoundsException and handles it as a performance optimiation.
    This is intended and would not show up as part of running the utility outside a debugger environment.<HR></BLOCKQUOTE>
    - Excelent. I am extremely grateful.
    null

  • Loading xml data into table

    When I try to load data following the document
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=121405.1&p_showHeader=1&p_showHelp=0
    I get these messages:
    SQL> exec loadxml;
    ERROR:
    ORA-06550: line 1, column 29:
    PLS-00553: character set name is not recognized
    ORA-06550: line 0, column 0:
    PL/SQL: Compilation unit analysis terminated
    I have created example.xml file from the example shown in the above document, as well as procedule loaxml from the document. I would appreciate if you could point out what could be wrong. How do I verify that jserver and XML-SQL (XSU) Utility is installed?

    I did some basic testing. I logged in as SYS-user.
    SELECT directory_name,directory_path
    FROM all_directories where directory_name like 'XML%';
    gives the directory in db-server ok:
    DIRECTORY_NAME ...... DIRECTORY_PATH
    XML_FILES ................... D:\OWB_Files
    If i run this:
    SELECT DBMS_LOB.getLength( BFileName('XML_FILES','asi.xml'))
    AS length FROM dual;
    i get this:
    ERROR at line 1:
    ORA-22288: file or LOB operation GETLENGTH failed
    The system cannot find the file specified.ORA-06512: at "SYS.DBMS_LOB", line 566
    I made a copy of one xml-file to name asi.xml and grated to USER all priviledges in Windows Explorer. I also run this in SQL*Plus: grant all on directory XML_FILES to public;
    If i made a typo to directory name 'XML_FILES' -> 'XML_zzzFILES' i get different error message: ORA-22285: non-existent directory or file for GETLENGTH operation.
    So, directory is okay? But all the files are some in the shadows? Once again - run out of ideas.

Maybe you are looking for

  • Final Cut Studio 2 Vs 3

    I wanted to look at getting something more then iMovie and saw the Final Cut Studio 2 is for sale this week for $50 while Final Cut Studio 3 is still $300 at my campus bookstore (education licenses). Is there a $250 difference between the two version

  • No video output to 23" Apple from Windows XP

    I just built a new computer with; Intel E6400 CPU, Asus P5W DH Deluxe motherboard and an EVGA 8800GTS video card. This setup will not give me any video output to my 23" Apple display that was working fine before. It will not post into the BIOS. I hav

  • Mapping idoc to Record

    Hi experts! My scenerio is to get an idoc from r/3 mapp that idoc to required required and then store it as an xml i ftp folder. i got the idoc from r/3, converted that idoc to idoc structure, data is coming into the structure but whenever i am tryin

  • Checkbox focus

    Hi i am using Jdev 11.1.1.4 i am working on skins where i faced a problem for checkbox focus when"keyborad Tab" is used. i want to change the colour of the checkbox on focus when the user uses keyboard to move to the checkbox. i tried several things

  • Syncing iPhoto Albums With My Video iPod

    Using OS X.3.9 and iPhoto 6.x: When I sync iPhoto with my new iPod (video), will I be able to browse the photos on the iPod by the same Album names used in iPhoto? Will the iPod list my Albums? For example, can I present a slideshow of a certain Albu