Detecting Change in Elements between Versions of XML Doc

Hi There
I have a structured XML Schema based table in XMLDB 9.2.0.4 and am trying to detect when a non-repeating element off the root element changes (audit).
I have created a row level update trigger and each time one element is changed via UPDATEXML two or three other elements are detected as changed. I am wondering if I have some sort of DOM fidelity issue here and perhaps my trigger is not the best for detecting this. we use XS:ANY elements in the XML schema and I know that there appears to be space injection into the element tag content and also extraneous namespace tags on tags in the XS:ANY elements.
Can you give me any advice on my schema XSD and perhaps my trigger. Maybe what I am trying to do is not possible until 10g version of XMLDB.
XSD
====
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Martyn J Ricks (University of Tasmania) -->
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Grant John Hyland (University of Tasmania) -->
<xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns="http://www.utas.edu.au/cu" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.utas.edu.au/cu" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
     <xs:element name="UnitSetYear" type="UnitSetYearType" xdb:defaultTable="CU_UNIT_SET_YEARS_XML">
          <xs:annotation>
               <xs:documentation>Comment describing your root element</xs:documentation>
          </xs:annotation>
     </xs:element>
     <xs:complexType name="OfferedInCoursesType" xdb:SQLType="CU_UN_OFFEREDINCRSS_TYP">
          <xs:sequence>
               <xs:element name="Course" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="OFFERED_IN_COURSE" xdb:SQLType="VARCHAR2" xdb:SQLCollType="CU_UN_OFFERED_IN_CRS_COLTYP">
                    <xs:annotation>
                         <xs:documentation>Unit set is involved in these courses, as specified in the quality assurance manual.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:length value="3"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RecommendedTextType" mixed="true" xdb:SQLType="CU_UN_RECOMMENDEDTEXT_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RecommendedTextsType" xdb:SQLType="CU_UN_RECOMMENDEDTEXTS_TYP">
          <xs:sequence>
               <xs:element name="RecommendedText" type="RecommendedTextType" minOccurs="0" maxOccurs="unbounded" xdb:SQLCollType="CU_UN_RECOMMEND_TEXT_COLTYP" xdb:SQLName="RECOMMENDED_TEXT"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RequiredTextType" mixed="true" xdb:SQLType="CU_UN_REQUIREDTEXT_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RequiredTextsType" xdb:SQLType="CU_UN_REQUIREDTEXTS_TYP">
          <xs:sequence>
               <xs:element name="RequiredText" type="RequiredTextType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="REQUIRED_TEXT" xdb:SQLCollType="CU_UN_REQUIRED_TEXT_COLTYP">
                    <xs:annotation>
                         <xs:documentation>Prescribed texts</xs:documentation>
                    </xs:annotation>
               </xs:element>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="BAMajorsType" xdb:SQLType="CU_UN_BAMAJORS_TYP">
          <xs:sequence>
               <xs:element name="BAMajor" maxOccurs="unbounded" xdb:SQLName="BA_MAJOR" xdb:SQLType="VARCHAR2" xdb:SQLCollType="CU_UN_BA_MAJORS_COLTYP">
                    <xs:annotation>
                         <xs:documentation>Majors that this unit applies to in the BA degree course</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:maxLength value="20"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="AssessType" mixed="true" xdb:SQLType="CU_UN_ASSESS_TYPE">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="ReqTextType" mixed="true" xdb:SQLType="CU_UN_REQTEXT_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RequisiteType" xdb:SQLType="CU_UN_REQUISITE_TYP">
          <xs:sequence>
               <xs:element name="ReqType" xdb:SQLName="REQUISITE_TYPE" xdb:SQLType="VARCHAR2">
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:maxLength value="6"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="ReqText" type="ReqTextType" xdb:SQLName="REQUISITE_TEXT"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="RequisitesType" xdb:SQLType="CU_UN_REQUISITES_TYP">
          <xs:sequence>
               <xs:element name="Requisite" type="RequisiteType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="REQUISITE" xdb:SQLCollType="CU_UN_REQUISITE_COLTYP"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="TeachPatternType" mixed="true" xdb:SQLType="CU_UN_TEACHPATTERN_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="DescType" mixed="true" xdb:SQLType="CU_UN_DESC_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="SpecialNoteType" mixed="true" xdb:SQLType="CU_UN_SPECIALNOTE_TYP">
          <xs:sequence>
               <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
          </xs:sequence>
     </xs:complexType>
     <xs:complexType name="UnitSetYearType" xdb:SQLType="CU_UN_UNITSETYEAR_TYP">
          <xs:sequence>
               <xs:element name="UnitSetID" xdb:SQLName="UNITSET_ID">
                    <xs:simpleType>
                         <xs:restriction base="xs:integer">
                              <xs:minInclusive value="10000000"/>
                              <xs:totalDigits value="8"/>
                              <xs:fractionDigits value="0"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="Year" xdb:SQLName="YEAR">
                    <xs:annotation>
                         <xs:documentation>The academic year of the unit set</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:integer">
                              <xs:totalDigits value="4"/>
                              <xs:fractionDigits value="0"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="UnitSetLabel" xdb:SQLName="SET_LABEL" xdb:SQLType="VARCHAR2">
                    <xs:annotation>
                         <xs:documentation>The label that will be used as terms of reference for the unit set</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:maxLength value="20"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="UnitSetTitle" xdb:SQLName="UNIT_TITLE" xdb:SQLType="VARCHAR2">
                    <xs:annotation>
                         <xs:documentation>The Unit Set Title for the Year</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:maxLength value="100"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="Offered" xdb:SQLName="OFFERED" xdb:SQLType="VARCHAR2">
                    <xs:annotation>
                         <xs:documentation>Is the unit on offer this year (Y/N). Defaults to Y.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:length value="1"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="SpecialNote" type="SpecialNoteType" xdb:SQLName="SPECIAL_NOTE"/>
               <xs:element name="InWeb" xdb:SQLName="IN_WEB" xdb:SQLType="VARCHAR2">
                    <xs:annotation>
                         <xs:documentation>Should this Unit Set appear on the web.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:length value="1"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="Desc" type="DescType" xdb:SQLName="DESCRIPTION" xdb:SQLType="CLOB">
                    <xs:annotation>
                         <xs:documentation>Short description of Unit content</xs:documentation>
                    </xs:annotation>
               </xs:element>
               <xs:element name="Staff" xdb:SQLName="STAFF" xdb:SQLType="VARCHAR2">
                    <xs:annotation>
                         <xs:documentation>Staff teaching this unit.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:maxLength value="500"/>
                         </xs:restriction>
                    </xs:simpleType>
               </xs:element>
               <xs:element name="TeachPattern" type="TeachPatternType" xdb:SQLName="TEACHING_PATTERN">
                    <xs:annotation>
                         <xs:documentation>Number of lectures , tutorials, laboratories and workshops</xs:documentation>
                    </xs:annotation>
               </xs:element>
               <xs:element name="Requisites" type="RequisitesType" xdb:SQLName="REQUISITES"/>
               <xs:element name="Assess" type="AssessType" xdb:SQLName="ASSESSMENT">
                    <xs:annotation>
                         <xs:documentation>Mode of assessment and percentages</xs:documentation>
                    </xs:annotation>
               </xs:element>
               <xs:element name="BAMajors" type="BAMajorsType" minOccurs="0" xdb:SQLName="BA_MAJORS"/>
               <xs:element name="RequiredTexts" type="RequiredTextsType" xdb:SQLName="REQUIRED_TEXTS"/>
               <xs:element name="RecommendedTexts" type="RecommendedTextsType" xdb:SQLName="RECOMMENDED_TEXTS"/>
               <xs:element name="OfferedInCourses" type="OfferedInCoursesType" xdb:SQLName="OFFERED_IN_COURSES"/>
          </xs:sequence>
     </xs:complexType>
</xs:schema>
Trigger
========
CREATE OR REPLACE TRIGGER CU_UNITSETYR_XML_AUDR_TRG
AFTER DELETE OR UPDATE
ON CU_UNIT_SET_YEARS_XML
FOR EACH ROW
DECLARE
v_user VARCHAR2(30);
v_old_xml_doc xmltype;
v_new_xml_doc xmltype;
v_old_unitset_id cu_unit_sets.unitset_id%TYPE;
v_old_offered VARCHAR2(1);
v_new_offered VARCHAR2(1);
v_old_inweb VARCHAR2(1);
v_new_inweb VARCHAR2(1);
v_old_title VARCHAR2(100);
v_new_title VARCHAR2(100);
v_old_staff VARCHAR2(500);
v_new_staff VARCHAR2(500);
v_old_special_note xmltype;
v_new_special_note xmltype;
v_old_unit_desc xmltype;
v_new_unit_desc xmltype;
v_old_teach_pattern xmltype;
v_new_teach_pattern xmltype;
v_old_assess xmltype;
v_new_assess xmltype;
v_old_offered_in_courses xmltype;
v_new_offered_in_courses xmltype;
v_old_BA_Majors xmltype;
v_new_BA_Majors xmltype;
v_old_req_texts xmltype;
v_new_req_texts xmltype;
v_old_reco_texts xmltype;
v_new_reco_texts xmltype;
v_old_year INTEGER;
v_mod_type VARCHAR2(1);
BEGIN
-- Establish the username from the CUM_PORTAL_APP context
v_user := sys_context('CUM_PORTAL_APP','CURRENT_USER');
IF (v_user IS NULL) THEN
-- Means that CUM Portal App did not make the change
v_user := USER;
END IF;
-- Determine modification type
IF (updating) THEN
v_mod_type := 'U';
ELSIF (deleting) THEN
v_mod_type := 'D';
END IF;
v_old_xml_doc := :OLD.sys_nc_rowinfo$;
v_new_xml_doc := :NEW.sys_nc_rowinfo$;
SELECT extractvalue(v_old_xml_doc, '/UnitSetYear/UnitSetID'),
extractvalue(v_old_xml_doc, '/UnitSetYear/Year'),
extractvalue(v_old_xml_doc, '/UnitSetYear/Offered'),
extractvalue(v_new_xml_doc, '/UnitSetYear/Offered'),
extractvalue(v_old_xml_doc, '/UnitSetYear/UnitSetTitle'),
extractvalue(v_new_xml_doc, '/UnitSetYear/UnitSetTitle'),
extract(v_old_xml_doc, '/UnitSetYear/SpecialNote'),
extract(v_new_xml_doc, '/UnitSetYear/SpecialNote'),
extract(v_old_xml_doc, '/UnitSetYear/Desc'),
extract(v_new_xml_doc, '/UnitSetYear/Desc'),
extractvalue(v_old_xml_doc, '/UnitSetYear/Staff'),
extractvalue(v_new_xml_doc, '/UnitSetYear/Staff'),
extractvalue(v_old_xml_doc, '/UnitSetYear/InWeb'),
extractvalue(v_new_xml_doc, '/UnitSetYear/InWeb'),
extract(v_old_xml_doc, '/UnitSetYear/TeachPattern'),
extract(v_new_xml_doc, '/UnitSetYear/TeachPattern'),
extract(v_old_xml_doc, '/UnitSetYear/Assess'),
extract(v_new_xml_doc, '/UnitSetYear/Assess'),
extract(v_old_xml_doc, '/UnitSetYear/OfferedInCourses'),
extract(v_new_xml_doc, '/UnitSetYear/OfferedInCourses'),
extract(v_old_xml_doc, '/UnitSetYear/BAMajors'),
extract(v_new_xml_doc, '/UnitSetYear/BAMajors'),
extract(v_old_xml_doc, '/UnitSetYear/RequiredTexts'),
extract(v_new_xml_doc, '/UnitSetYear/RequiredTexts'),
extract(v_old_xml_doc, '/UnitSetYear/RecommendedTexts'),
extract(v_new_xml_doc, '/UnitSetYear/RecommendedTexts')
INTO v_old_unitset_id,
v_old_year,
v_old_offered,
v_new_offered,
v_old_title,
v_new_title,
v_old_special_note,
v_new_special_note,
v_old_unit_desc,
v_new_unit_desc,
v_old_staff,
v_new_staff,
v_old_inweb,
v_new_inweb,
v_old_teach_pattern,
v_new_teach_pattern,
v_old_assess,
v_new_assess,
v_old_offered_in_courses,
v_new_offered_in_courses,
v_old_BA_Majors,
v_new_BA_Majors,
v_old_req_texts,
v_new_req_texts,
v_old_reco_texts,
v_new_reco_texts
FROM dual;
IF (v_old_unitset_id IS NOT NULL AND v_old_year IS NOT NULL) THEN
-- Had to do this to avoid problems with create resource statement which on insert appears
-- to manifest itself as an update of a null document????
IF (updating OR deleting) THEN
-- Audit the XML document
INSERT INTO cu_unit_set_years_xml_audit
(unitset_id, YEAR, xml_doc, mod_type, mod_by, mod_date)
VALUES
(v_old_unitset_id,
v_old_year,
v_old_xml_doc.getclobval(), -- convert to clob
v_mod_type,
USER,
SYSDATE);
END IF;
IF (updating AND v_old_offered != v_new_offered) THEN
cu_events_pkg.log_event(p_event_type => 'USOFF',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Offered">'||v_old_offered||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_inweb != v_new_inweb) THEN
cu_events_pkg.log_event(p_event_type => 'USINWEB',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Publish on Web">'||v_old_inweb||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_title != v_new_title) THEN
cu_events_pkg.log_event(p_event_type => 'USTIT',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="UnitSet Title">'||v_old_title||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_special_note.getClobVal() != v_new_special_note.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USSPECN',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Special Note">'||NVL(v_old_special_note.getStringVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_unit_desc.getClobVal() != v_new_unit_desc.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USDESC',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Description">'||NVL(v_old_unit_desc.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_staff != v_new_staff) THEN
cu_events_pkg.log_event(p_event_type => 'USSTAFF',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Staff">'||NVL(v_old_staff,'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_teach_pattern.getClobVal() != v_new_teach_pattern.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USTEACHP',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Teaching Pattern">'||NVL(v_old_teach_pattern.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_assess.getClobVal() != v_new_assess.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USASSESS',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Asessment">'||NVL(v_old_assess.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_offered_in_courses.getStringVal() != v_new_offered_in_courses.getStringVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USOFFCRS',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Offered in Courses">'||NVL(v_old_offered_in_courses.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND ((v_old_BA_Majors IS NULL) OR (v_old_BA_Majors.getStringVal() != v_new_BA_Majors.getStringVal()))) THEN
-- Special Treatment here because the BAMajors tag is optional.
-- If missing this causes an error with the getClobVal() method.
IF (v_old_BA_Majors IS NULL) THEN
cu_events_pkg.log_event(p_event_type => 'USBAMAJ',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="BAMajors">NULL</Col>
</Row>
</RowSet>'));
ELSE
cu_events_pkg.log_event(p_event_type => 'USBAMAJ',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="BAMajors">' || v_old_BA_Majors.getStringVal() ||'</Col>
</Row>
</RowSet>'));
END IF;
END IF;
IF (updating AND v_old_req_texts.getClobVal() != v_new_req_texts.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USREQTXT',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Required Texts">'||NVL(v_old_req_texts.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
IF (updating AND v_old_reco_texts.getClobVal() != v_new_reco_texts.getClobVal()) THEN
cu_events_pkg.log_event(p_event_type => 'USRECOTXT',
p_enacted_by => v_user,
p_subject_type => 'UNITSETX',
p_subject_id => to_char(v_old_unitset_id),
p_subject_year => v_old_year,
p_previous_values =>
xmltype('<RowSet>
<Row>
<Col ColName="Recommended Texts">'||NVL(v_old_reco_texts.getClobVal(),'NULL')||'</Col>
</Row>
</RowSet>'));
END IF;
END IF;
END;

Be aware that you could also do an ALTER SESSION instead of a ALTER SYSTEM. This would prevent to shutdown the database to make the change, within the session, active.
M

Similar Messages

  • How to use Xpath to query elements loaded from different xml docs?

    I have a big DBLP XML doc (95mb), to load into the container, i splitted the doc into many small xml docs by the publication types, such as articles, books, inproceedings, etc.
    I tried to use xpath query such as
    query 'collection()/dblp[article/author]/book[title]'
    I got empty answers.
    but if i use XQuery such as
    query 'let $r:=collection()/dblp,$a :=$r/inproceedings/author
    for $l2 in $r/book
    where $a and $l2/title
    return <result> {$l2}{$a}</result>'
    i got answers. However, if i remove {$a} from the return clause, i still got empty answers.
    is there any problem with my Xpath query and flwor Xquery?
    regards,
    xiaoying

    Hi John,
    Following is the procedure i have used to load the xml docs (after the indexes have been created):
    private static void loadXmlFiles(File path2DbEnv,String theContainer, File file) throws Throwable {
         //Open a container in the db environment
              XmlManager theMgr = null;
              XmlContainer openedContainer = null;
              myDbEnv env;
              try {
              env = new myDbEnv(path2DbEnv);
         theMgr = new XmlManager(env.getEnvironment(), new XmlManagerConfig());
         //use node container
         theMgr.setDefaultContainerType(XmlContainer.NodeContainer);
                   try{
                   openedContainer = theMgr.createContainer(theContainer);
                   }catch (XmlException e){
                        //if the container alreay exist, then open it;     
                        openedContainer = theMgr.openContainer(theContainer);
              //Get an update context.
              XmlUpdateContext updateContext = theMgr.createUpdateContext();
                   String theFile = file.toString();
                   String docName=file.getName();
              //Get the input stream.
              XmlInputStream theStream = theMgr.createLocalFileInputStream(theFile);
              System.out.println("Adding " + theFile + " to container " +
                             theContainer);
         //     Do the actual put
              openedContainer.putDocument(docName, // The document's name
              theStream, // The actual document.
              updateContext, // The update context
         //     (required).
              null); // XmlDocumentConfig object
              System.out.println("done.");
              //XmlException extends DatabaseException, which in turn extends Exception.
              // Catching Exception catches them all.
              } catch (XmlException e){
                   System.err.println("Error loading files into container " + theContainer);
                   System.err.println(" Message: " + e.getMessage());
                   //In the event of an error, we abort the operation
                   // The database is left in the same state as it was in before
                   // we started this operation.
                   throw e;
              finally {
              cleanup(theMgr, openedContainer);
    Unfortunately, i waited for around 20 hours 148mb doc was not loaded; so i gave up.
    Could you please give me some suggestions on how to load the large doc efficiently ? thanks.
    regards,
    xiaoying

  • Error in Adobe form based in a xml interface when changing data element

    The adobe form is called from a web dynpro.
    The adobe form contain a page and subforms (positioned y flowered).
    The form worked out perfectally.
    Then edited a descriptive text in a data element, from se11.  The form continues worked out correctelly.
    Then modify a fixed text from the form.  The form is activated.
    Since this modification, the form stopped to work out, informing the following message:
    "WebDynpro Exception: The ADS call has failed. You can find information about the cause in the error.pdf on the application server".
    I have updated the nodes of the web dynpro, the xml interface of the form, is all activated and this is still not working.
    Someone could help me? Does anyone know what it could be happened?
    Is there a way to re-generate the form?
    Thanks you very much.
    Regards,

    The data element is char 4.  I have only changed descriptive texts.
    I have take take all the objects to the previous version (data element, wd view, interface xml, adobe form), and the form is still not working.
    Do you have another posible solution for this?
    Thanks you for your answer.
    Kind regards,

  • Detecting changes in XML in oracle XML DB

    Is there a utility, function etc., in Oracle XML DB that checks the changes between two stored XML in XMLType table?

    This feature is introduced in 11g. See XMLDIFF and XMLPatch

  • I have an old version of itunes installed in my iPod.I had a syncronize mistake and I tried to change iTunes to 10.4.1. Now iTunes doesn't recognizes my ipod because of the difference between versions. What can I do?

    I have an old version of itunes installed in my iPod.I had a syncronize mistake and I tried to change iTunes to 10.4.1. Now iTunes doesn't recognizes my ipod because of the difference between versions. What can I do?

    I reinstalled the current version of iTunes, 8.2.1.
    Current version?? Did this post appear out of a time warp?  The current version is 10.7!
    http://www.apple.com/itunes/download/

  • Elements Agent stuck on Detecting Changes in PSE13

    I am running PSE13 on a Windows 8.1 desktop.
    My photo catalogue has about 40K pictures, but only 3K have been uploaded from PSE13 to Revel.  The Elements Agent is stuck on "Detecting Changes" and not synchronizing with Revel.
    I have signed out/in within PSE13 and turned the Elements Agent off and then on.  Still no changes.
    On my desktop, I have turned off all services and startup programs except for Adobe programs.
    Looking for help.

    Thanks a lot for replying, your example is being of help but
    i think you misunderstood my post and i still have some doubts.
    More than one item can be a winner, not just one, so i will
    have to call an update for each item.
    On my fill method i have something like this:
    public List fill(List fillParameters){
    List results = new ArrayList();
    results = dao.getBids();
    results = checkWinners(results); //this function checks each
    item and sets the winner porperty to true or false.
    return results;
    So when i call on Flex DataService.fill() it obtains the list
    of bids and each has its winner property to true or false. Then i
    insert a new item and the fill method is executed again (due to
    autoRefreshFill) and winner properties is set again but the
    updateCollection message only includes the new added item, it
    doesn't check for updates.
    So now, the real deal is where would i call the updateItem to
    push the changes? Should i call the updateItem inside the
    createItem function? on the refreshFill function? inside the fill
    function?
    I have checkWinners() function which is the one i call inside
    the fill function and that sets the winner property of each item,
    should i call the DataServiceTransaction.updateItem from there? I
    have my doubts because i am calling this function inside the fill
    method.
    So it all sums up in "where should i call the updateItem?"
    Thanks for you help, hope you can help me out with this last
    issue :)

  • Changing the active JRE version between several available paths

    Hello, I need help with a rather risque subject.
    I know it isn't recommended, or preferable, but I need to upgrade the Java on a server that has to be maintained at as close to 100% availability as possible. Now, I can allow for the post-upgrade reboot time, but I can't afford to have the server be up, but none of the programs working because of the switch in java for any extended length of time.
    For this reason, I need to know how I can switch between versions which are installed in different directories (be it via registry or anything else).
    There must be some way to do this, and, tedious though it may be, I need to know it.
    Can anyone help?

    Now, I can allow for the post-upgrade reboot time, What is it? Why should the system be rebooted because a new program was installed? Is it vindoze?

  • What is the difference between version 4.7 EE and ECC 6.0 in SD module.

    Hi SAP Gurus,
    what are the features in 4.7 EE version in general.
    what are the features in ECC 6.0  version in general.
    then give me the exact difference between version 4.7 EE and ECC 6.0 in SD module.
    if u give the information, then u will get the rewards.
    Regards,
    somu.

    Hi Somu,
             These are additional enhancements avialble in ECC6.0 other than that remaining same as 4.7E
    1.E-Commerce:- SAP ERP provides powerful e-commerce capabilities that can be expanded in an easy, cost-effective manner in line with business growth. Organizations can run a complete sales process on the Internet, and provide business-to-business (B2B) and business-to-consumer (B2C) customers with personalized and interactive online self-services.
    2.Mobile Sales for Handhelds:-SAP ERP enables sales professionals to access front- and back-office business processes and to manage critical sales activities in the field using standard PDAs or other handheld devices (including those with bar code scanners). In this area, SAP ERP provides the following functions:- Customer managementWith SAP ERP, sales professionals may enter, view, and modify detailed customer information, and view sales order history for each customer.- Sales order managementSAP ERP enables sales staff to take sales orders via bar code scanners; search, create, and modify sales orders; and list or sort sales order partners.- Material managementSupport for material management for mobile sales enables staff to view material lists or details for a specific material, search material, and display customer-specific prices.
    3.Resource-Related Down Payments and Billing:-- Supports creation of down-payment requests analogous to the functions offered by resource-related billing- Enables organizations to bill the requesting company code for services provided via a resource-related billing document.
    4.SAP Beverage Functions Available for the Consumer Products Industry:- As of SAP ERP Central Component (SAP ECC) 5.00, the following functions from the SAP beverage industry solution are available for the consumer products industry:* SAP ECC 5.00, consumer products (EA-CP 500)- Material sorting- Extra charge- Empties management- Part load lift orders- Pendulum list indirect sales- Sales returns- Excise duty* SAP ECC 5.00, supply chain management extension (EA-SCM 500)- Direct store delivery back-end- Master data- Visit control- Transportation planning (including loading units, aggregation categories)- Vehicle space optimization- Output control (including valuated delivery note)- Route accounting (including tour data entry, cash payer, route settlement)* SAP ECC 5.00, industry-specific sales enhancements (EA-ISSE 500)- Extended rebate processing.
    5.Credit Management:-Integrating sales and distribution (SD) credit management with SAP Credit Management application:With SAP ERP 6.0 application, you can also use SAP Credit Management in SAP Financial Supply Chain Management set of applications (FIN-FSCM-CR) to perform all credit checks and commitment updates for all areas of sales (SD-BF-CM). In SAP Credit Management, you can update the data from multiple systems. This enables you to execute credit checks with consistent data in distributed systems, too. Furthermore, you can connect to external credit information providers by extensible markup language (XML) interfaces. Alternatively, you can continue to use SD Credit Management (SD-BF-CM).
    6.E-Commerce: Catalog Management :-As of SAP ERP 6.0 application, you must carry out product catalog replication from your ERP solution to the Text Retrieval and Information Extraction (TREX) server for use in the Web shop, using the report ISA_CATALOG_REPLICATION.
    7.E-Commerce: Quotation and Order Management:- Order creation with reference to a contract that has been displayed* Lock of sales documents to avoid concurrent access during the order change process* Display of bills of material in the shopping basket* Free goods processing* Processing of grid products for the SAP Apparel and Footwear application* One-step business order processing* Selection of multiple transaction types in the shopping basket* Credit card support in business-to-business (B2B) Web shop* Material number format conversion* Maintenance of delivery priority in the shopping basket (B2B)* Document search for all documents across all sales areas* Interprocess communication-characteristic value display in basket and order confirmation
    8.E-Commerce: Selling Over eBay:-Creation and management of product listings on eBay leverages the e-commerce order management and fulfillment capabilities of the SAP ERP application by easily tying existing tax, pricing, shipping, and payment configurations to post-auction processing. Enhancements in 2005: * You can use the business-to-consumer (B2C) checkout instead of the eBay checkout. With the B2C checkout, you can maximize cross-selling and up-selling opportunities by leveraging B2C functionality, determine tax and shipping using the elaborate methodologies available through condition techniques in SAP ERP 6.0. * E-mail notification scenario: winner notification to keep the auction winner updated with the status of the auction and of his or her order * Monitoring through features such as single-activity trace (SAT), heartbeat, and logging * Creation and publishing of multiple-item auctions and manual retraction of winners
    9.E-Commerce: User Management:-- Web-based user management for business-to-business internet users - Assignment of authorization roles to users in web-based user management - Automatic migration of SU05 to SU01 internet users
    10.Enterprise Services in Sales Order Management:-Please check in the Enterprise Services Workplace site which enterprise services are available for sales order management on the SAP Developer Network site (www.sdn.sap.com).
    11.Internet Pricing and Configurator (IPC):-The IPC is enhanced and integrated to allow configuration within the sales documents of the SAP ERP application reusing existing model data while leveraging its improved functionality and advanced user interface within SAP ERP.
    12.Price Catalog (PRICAT): – Inbound Processing (Retail):-Inbound message processing of PRICAT essages:As of SAP ERP Central Component enterprise extension retail 6.0 (EA-RET 600) component, you can create and change article data automatically, or in an interface for mass data handling. The system takes both single and generic articles and bills of material and prices into account.
    13.Rebate Condition Records Using Scales:-As of SAP ERP 6.0 application, you can set up rebate agreements so that the scale base value and the rebate scale level is derived from the total sales volume of multiple condition records. You do this by grouping condition records in the rebate agreement.
    14.SAP Role: – Internal Sales Representative:-SAP role – internal sales representativeThis role delivers all the functions to fulfill the requirements of an internal sales representative. This includes tasks such as answering phone calls from customers and prospective customers, processing incoming inquiries and sales orders, and preparing quotations and sales contracts.Target groupThe responsibilities of an internal sales representative (or customer service representative) include the following:- Answering phone calls from customers and prospective customers- Answering product, price, and order status related questions- Processing incoming inquiries and sales orders- Preparing quotations and sales contracts- Taking sales orders and ensuring successful order processing – for example, taking care of the completeness of sales documents, releasing delivery-blocked orders, and so on - Support for the outside sales force – for example, checking on quotations, updating customer master data, and so on- Preparing reports and sales analyses for the sales manager and the sales teamWork overview This work center gives you an overview of your daily work and gives you easy access to your most important tasks. Sales documents This work center allows you to work on all your sales documents. You can create and maintain inquiries, quotations, sales orders, sales contracts, scheduling agreements, and billing documents. Order fulfillment This work center allows you to monitor order fulfillment. You can display deliveries, backorders, and shipments, and can check product availability.Master data This work center enables you to work on all your master data. You can create and maintain business partners, customer agreements, prices and conditions, and products.
    I hope it will help you
    Regards,
    Murali.

  • Difference between versions

    hi ,
    I want to know the difference between versions of 5.0 and ECC 6.0 .any information is rewarded.

    Hi,
    Please check these information from other thread.
    ECC 5.0 is based on WAS 6.40 and ECC 6.0 is based on WAS 7.00.
    From functional point of view there are some minor differences, as the core functionalities are not changed a lot. However there is Industrial Solutions intergarated to ECC 6.0 by default.
    From ABAP point of view you have the following new elements/components:
    - New ABAP editor /meanwhile it's available via downport for lower releases as well/
    - ABAP WebDynpro
    - Enhancement framework
    - Regular experssion support
    Also check this link for functionality differences.
    http://solutionbrowser.erp.sap.fmpmedia.com/
    Regards,
    Ferry Lianto

  • How to update Elements value inside existing xml file

    Hi Gurus,
    Am somehow new to java and working on xml with java, i have a scenario where i want to update the elements of my existing xml file, i know its possible as i have posted one code on this forum which updates the values of the arrtibutes of existing xml file. Ref :
    http://forum.java.sun.com/thread.jsp?forum=34&thread=186091&start=15&range=15&hilite=false&q=
    But am not able to use the same code to update the vlaues of the attribute.
    if i have this xml file :
    <?xml version="1.0"?>
    <RootElement>
    <Transaction>
    <Task9>
    <TaskID>Task9</TaskID>
    <Description>My Test Case</Description>
    <Time>12/12/2004</Time>
    </Task9>
    </Transaction>
    <Transaction>
    <Task2>
    <TaskID>Task2</TaskID>
    <Description>Testing my xml</Description>
    <Time>12/12/2004</Time>
    </Task2>
    </Transaction>
    </RootElemen>
    Now i want to update teh </Description> and </Time> field using the code that i have given above in the link.
    If any one can help me ill really appreciate.

    The value of an element is stored in a child node of that element. For example, let's say that "e" references the node <Description> then:
    e.getFirstChild().getNodeValue() => "My Test Case"

  • Ignoring the DOCTYPE element while parsing the xml

    I am using JAXB parser to read from and write into my xml file using java code. My xml file contains a DOCTYPE element pointing to a .dtd file which does not exist, due to which I get a FileNotFoundException when JAXB tries to read the xml file. Hence, after unmarshalling the xml file using jaxb, I use a SAXParser to get an XMLReader which removes this DOCTYPE element as given below -
    SAXParserFactory parserFactory = SAXParserFactory.newInstance();
    parserFactory.setValidating(false);
    XMLReader reader = parserFactory.newSAXParser().getXMLReader();
    reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    After making the required changes to the xml file and marshalling it back, I then use an XMLWriter to add the DOCTYPE element back to the xml file as given in the code snippet below -
    SAXReader saxReader = new SAXReader();
    Document document = saxReader.read(_file);
    document.addDocType(rootElement, publicUri, systemUri);
    XMLWriter output = new XMLWriter(new FileWriter( _file ));
    output.write( document );
    output.close();
    Right now I am using both, the JAXB parser to read from and write into the xml file and SAXParser/SAXRader just to delete/add the DOCTYPE element. I want to avoid using two different parsers in my class and want to know if JAXB provides any mechanism to delete and then add this element while parsing the xml file.

    Standard answer for this FAQ: set an EntityResolver on your parser that sends an empty string instead of the DTD. The API docs have an example that you could modify to do that.

  • Map several records to different elements in the same xml node

    Hi,
    I am trying to map data from relational tables to elements as per my xml schema. One of my tables has several records that I need to map to different elements in the same xml node.
    For example:
    Customer_Id | Param_Id |Param_Name
    212 | 1 |State
    212 | 2 |Country
    212 | 3 |ZipCode
    I can not change the structure of this existing table and need to work with it.
    How do I map the different params for a specific customer to my Customer node in the schema?
    One option is to join on the parameters table several times, but there ought to be a better way!
    PLEASE HELP!!!
    Thanks,

    First I question the design that contains/allows 600 attributes on an element. They sound like they really should be elements in the XML.
    Regardless, the following (NOT TESTED) should work for you (assuming you want to write one SQL with 600 columns)
    CREATE OR REPLACE VIEW APPLICATION_XML
    OF XMLTYPE
    Element "LOAN_APPLICATION"
    with object ID
    substr(extractValue(object_value,'/LOAN_APPLICATION/APPLICATION_DATA/@CallID'),1,5)
    AS
    WITH parm_tb AS
    SELECT MAX(DECODE(prv_valu, 1, prv_value)) BusinessType,
           MAX(DECODE(param_id, 2, prv_value)) Product,
           MAX(DECODE(param_id, 3, prv_value)) SomethingElse
      FROM parameter_details
    WHERE prv_pmh_header_id = 1
    SELECT xmlElement
       ("APPLICATION_DATA",
         xmlAttributes
          p.prv_detail_id as "CallID",
          p.PRV_PRM_PARAM_ID as "RandomID",
          p.prv_value as AppInitDate
         xmlElement
         ("PRODUCER_DATA",
           xmlAttributes
            parm_tb.BusinessType as "BusinessType" ,
            parm_tb.Product as "Product"
      FROM parameters_table p
    WHERE p.PRV_PMH_HEADER_ID = 1

  • Event Structure's value change, not detecting changes when tabbing thru array of clusters

    Hi!  I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it.  I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return).  I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
    Thanks!

    mfitzsimons wrote:
    altenbach
    Tried Value Change with my example done in 7.1 and it doesn't trgger an event.  That is why I suggested Mouse Down.
    Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time.  Strange....
    Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
    LabVIEW Champion . Do more with less code and in less time .

  • How to show an XML doc's node?/element in a dynamic textbox?

    Hello!
    I would like to show an XML doc's node?/element in a textbox. I am importing the XML data from a PHP page. My code looks like this:
    var xmlRequest:URLRequest = new URLRequest("adatatvitel.php");
    var xmlLoader:URLLoader = new URLLoader(xmlRequest);
    xmlLoader.addEventListener(Event.COMPLETE, init);
    function init(e:Event):void{ 
      var xmlDoc:XMLDocument = new XMLDocument();
      xmlDoc.ignoreWhite = true;
      var datasXML:XML = XML(xmlLoader.data);
      xmlDoc.parseXML(datasXML.toXMLString());
    This program would be a quiz. First I would like to write out the first data: Question with the appropriate Answers. If the player's answer is correct, the program would show the second set.  Thanks in advance!
    Here is my PHP code:
    <?php
    require("db.php");
    $sql = "SELECT * FROM kerdesvalasz";
    $result = mysql_query($sql) or die(mysql_error());
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    echo "<datas>";
    while($row = mysql_fetch_array($result))
      echo '<data>';
      echo '<question>'.$row['kerdes'].'</question>';
      echo '<answer1>'.$row['valasz1'].'</answer1>';
      echo '<answer2>'.$row['valasz2'].'</answer2>';
      echo '<answer3>'.$row['valasz3'].'</answer3>';
      echo '<answer4>'.$row['valasz4'].'</answer4>';
      echo '<correct>'.$row['helyes'].'</correct>';
      echo '</data>';
    echo "</datas>";
    ?>

    Hi Taly,
    Florian is right, you need to knwo / set a maximum columns ( i assumed he actually mean column) so that content being displayed will be visible on form.
    I would suggest you to reaccess to your solution again if this design and think what if you have 999 columns, how do you want to display the content in form .
    I would suggest to transpose your content to display as row in form, and let the content to flow.
    This should solve your issue.
    Hope this helps.
    regards,
    Xiang Li

  • env-entry element in ejb-jar.xml

    I just started to create my ejb-jar.xml (deployment descriptor file) manually so
    that I won't depend on those generated by proprietary IDEs.
    The ejb-jar_2_0.dtd specifies that env-entry is used in
    entity, message-driven, and session elements.
    My question is - When do we use the element <env-entry>? Under what
    circumstances that ejb-jar_2_0.dtd necessitates its provision in the ejb-jar.xml
    in relation to entity, message-driven, and session elements?

    Hi,
    I've same prob here
    <env-entry>
    <env-entry-name>config.file.location</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>C:/bea/ITReportingConf.xml</env-entry-value>
    </env-entry>
    Right now config file is out side of my EAR, How can i put it within the EAR I tried with changing the
    <env-entry-value>/ITReportingConf.xml</env-entry-value> Value
    But i dont know which dir it is refering to and where should i put "ITReportingConf.xml" File
    Thanks

Maybe you are looking for