How to handle include tag in xml schema

My XML schema makes reference to other schema, something like:
<xsd:include schemaLocation="../LOCCommon/LOCCommon.xsd"/>
How do I handle this when using XML DB?

XDB does currently understand relative URLs. We are looking at this since thier use is becoming more common. You will need to register both schemas under absolute URLs and then adjust the URL of the include or import statement to reflect this...
The following code sample may help...
procedure fixRelativeURLs(xmlschema in out xmltype, schemaLocationHint varchar2)
as
  cursor getImports is
    select SCHEMA_LOCATION
      from xmlTable
             xmlnamespaces
               default 'http://www.w3.org/2001/XMLSchema'
             '/schema/import'
             passing xmlSchema
             columns
             SCHEMA_LOCATION varchar2(700) path '@schemaLocation'
  cursor getIncludes is
    select SCHEMA_LOCATION
      from xmlTable
             xmlnamespaces
               default 'http://www.w3.org/2001/XMLSchema'
             '/schema/include'
             passing xmlSchema
             columns
             SCHEMA_LOCATION varchar2(700) path '@schemaLocation'
  baseURL        varchar2(700);
  schemaLocation varchar2(700);
  targetURL      varchar2(700);
begin
  if instr(schemaLocationHint,'/',-1) > 0 then
    baseURL := substr(schemaLocationHint,1,instr(schemaLocationHint,'/',-1)-1);
  else
    baseURL := '/';
  end if;
  for import in getImports loop
    targetURL := baseURL;
    schemaLocation := import.SCHEMA_LOCATION;
    -- The following are treated as relative URLs
    -- URLs with no '/' character
    -- URLs which do not start with '/' and which do not contain '://'
    if ((instr(schemaLocation,'://') = 0) and (instr(schemaLocation,'/') <> 1)) then
      if (instr(schemaLocation,'..')  = 1 ) then
        while instr(schemaLocation,'..') = 1 loop
          schemaLocation := substr(schemaLocation,4);
          targetURL := substr(targetURL,1,instr(targetURL,'/',-1)-1);
        end loop;
      end if;
      schemaLocation := targetURL || '/' || schemaLocation;
      -- dbms_output.put_line('Import : re-mapping "' || import.SCHEMA_LOCATION || '" to "' || schemaLocation || '".');
      select updateXML
               xmlSchema,
               '/xsd:schema/xsd:import[@schemaLocation="' || import.SCHEMA_LOCATION || '"]/@schemaLocation',
               schemaLocation,
              NAMESPACES
      into xmlSchema
      from dual;
    else
      dbms_output.put_line('Import : skipping "' || import.SCHEMA_LOCATION || '".');
    end if;
  end loop;
  for include in getIncludes loop
    targetURL := baseURL;
    schemaLocation := include.SCHEMA_LOCATION;
    -- The following are treated as relative URLs
    -- URLs with no '/' character
    -- URLs which do not start with '/' and which do not contain '://'
    if ((instr(schemaLocation,'://') = 0) and (instr(schemaLocation,'/') <> 1)) then
      if (instr(schemaLocation,'..')  = 1 ) then
        while instr(schemaLocation,'..') = 1 loop
          schemaLocation := substr(schemaLocation,4);
          targetURL := substr(targetURL,1,instr(targetURL,'/',-1)-1);
        end loop;
      end if;
      schemaLocation := targetURL || '/' || schemaLocation;
      -- dbms_output.put_line('Include : re-mapping "' || include.SCHEMA_LOCATION || '" to "' || schemaLocation || '".');
      select updateXML
               xmlSchema,
               '/xsd:schema/xsd:include[@schemaLocation="' || include.SCHEMA_LOCATION || '"]/@schemaLocation',
               schemaLocation,
               NAMESPACES
        into xmlSchema
        from dual;
    else
      dbms_output.put_line('Inlcude : skipping "' || include.SCHEMA_LOCATION || '".');
    end if;
  end loop;
end;
--

Similar Messages

  • How to handle tables data in XML schema based adobe form

    Hi all,
    I am working on the CRM business partner creation by using Interactive adobe form with following steps:
    1) Uploaded the offline Interactive adobe form  to online interactive adobe form via WebDynpro ABAP;
    2) Capture XML data into corresponding BAPI structures;
    3) Save all the changes to database via BAPI.
    The adobe form contains customer information as well as several table views which are bind with the context created in WebDynpro: Node NEW_BP_NODE cardinality 1:1 with single attributes and table type attributes (1:n): COLOUR_COMP, MEN_COMP etc.
    While converting the xml format data to SAP context format, It is fine to use following routine to find the single attribute and map to the BAPI structure to do the database update.
    NODE = DOCUMENT->FIND_FROM_NAME( NAME = 'XYZu2019).
    XYZ = NODE->GET_VALUE( ).
    Question: how to convert the xml table data to SAP context format in WebDynpro ABAP?
    The XML table data looks like below.
    <?xml version="1.0" encoding="UTF-8" ?>
    <NEW_BP_NODE>
    <COLOUR_COMP>
    <DATA>
    <ZZTFLD0W2AQW />
    <ZZTFLDRZ2AQX>000</ZZTFLDRZ2AQX>
    <ZZTFLDVD2TQW />
    <ZZTFLDQK2HQX />
    <ZZTFLDEL2XQX />
    <ZZTFLDTC2DQX>000</ZZTFLDTC2DQX>
    <ZZTFLDOR2UQX />
    </DATA>
    <DATA>
    <ZZTFLD0W2AQW />
    <ZZTFLDRZ2AQX />
    <ZZTFLDVD2TQW />
    <ZZTFLDQK2HQX />
    <ZZTFLDEL2XQX />
    <ZZTFLDTC2DQX />
    <ZZTFLDOR2UQX />
    </DATA>
    <DATA>
    <ZZTFLD0W2AQW />
    <ZZTFLDRZ2AQX />
    <ZZTFLDVD2TQW />
    <ZZTFLDQK2HQX />
    <ZZTFLDEL2XQX />
    <ZZTFLDTC2DQX />
    <ZZTFLDOR2UQX />
    </DATA>
    </COLOUR_COMP>
    <MEN_COMP>
    <DATA>
    <ZZTFLD4V2V7V />
    <ZZTFLDYD2N7W>000</ZZTFLDYD2N7W>
    <ZZTFLDX32I7W />
    <ZZTFLD2D2W7W />
    <ZZTFLDGD2A7W />
    </DATA>
    <DATA>
    <ZZTFLD4V2V7V />
    <ZZTFLDYD2N7W>000</ZZTFLDYD2N7W>
    <ZZTFLDX32I7W />
    <ZZTFLD2D2W7W />
    <ZZTFLDGD2A7W />
    </DATA>
    </MEN_COMP>
    Thanks in advance for your help.
    Michelle

    Hi,
    Just follow these steps:
    1. Create interactive form UI element in your view.
    2. Now provide Datasource and PDFSOURCE to it in form properties.
    3. Now give a template name prefix with 'Z' or 'Y'.
    4. Double click on it. It will prompt for interface name.
    5. Provide interface name prefixed with 'Z' or 'Y'.
    6. Click on Context button in the Pop up window and provide the node you have selected as DATASOURCE.
    7. Click ok and it will open the form designer.
    8. In this way you can create a XML Schema based Form.
    9. Activate the interface and design the form providing layout type and other details.
    Hope it will help.
    Regards,
    Vaibhav

  • How can we get  tag of XML file using SAX

    Hi ,
    I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
    XML file is
    <DFProperties>
    <AccessType>
    <Get/>
    </AccessType> <Description>
    gdhhd
    </Description>
    <DFFormat>
    <chr/>
    </DFFormat>
    <Scope>
    <Permanent/>
    </Scope>
    <DFTitle>gsgd</DFTitle>
    <DFType>
    <MIME>text/plain</MIME>
    </DFType>
    </DFProperties>
    I want out like GET and Permanent... means this one tag which is present inside of another tag.
    Handler class like
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if(_ACCESSTYPE.equals(localName)){
                   accessTypeElement=ACCESSTYPE;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_ACCESSTYPE.equals(_accessTypeElement)) {
                   String strValue = new String(ch, start, length);
                   System.out.println("Accestype-----------------------------> " + strValue);
                   //System.out.println(" " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_ACCESSTYPE.equals(localName)) {
                   _accessTypeElement = "";
    . please any body help me

    Hi ,
    I have one problem,Please help me.
    1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
    <Node> .............starttag1
    <NodeName>Test</NodeName>
    <Node>................starttag2
    <nodeName>test1</NodeName>
    </Node>..................endtag2
    <Node>.....................starttag3
    <NodeName><NodeName>
    <Node> .........................starttag4
    <NodeName>test4</NodeName>
    </Node>.......enddtag4
    </Node>...........end tag3
    </Node>............endtag1
    my code is below
    private final String _NODENAME = "NodeName";
    private final String _NODE = "Node";
    private String _nodeElement = "";
         private String _NodeNameElement = "";
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    if(_NODE.equals(localName)){
         System.out.println("start");
         if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_NODENAME.equals(_NodeNameElement)) {
                   String strValue = new String(ch, start, length);
                   String sttt=strValue;
                   System.out.println("NODENAME: ************* " + strValue);
    if(_NODE.equals(_nodeElement)){
                   if (_NODENAME.equals(_NodeNameElement)) {
                        String strValue = new String(ch, start, length);
                        String sttt=strValue;
                        System.out.println("nodevalue********** " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_NODENAME.equals(localName)) {
                   _NodeNameElement = "";
    if(_NODE.equals(localName)){
                   System.out.println("NODENAME: %%%%%%%%%");
    please help me. How can I figure node ending for particular nodename

  • Question about how ExifMeta handles multivalued tags

    Hi,
    I have tested the ExifMeta (Great work, just what I needed!) to read face recognition data written by Picasa to RegionName, RegionType etc. fields in jpg metadata. Everything seems to work fine if there is only one name in the field but Picasa writes several values separated with commas like this:
    RegionName     John Doe, Jill Doll
    RegionType     Face, Face
    etc.
    In that case, the corresponding fields remain completely empty. So is this convention of writing several values separated by commas "standard" way of doing this? Is there any way to fix this?
    Additionally, three Region category tags refuse to load giving the following error:
    "Not updating due to error getting property, id: XMPmwgrs_RegionAppliedToDimensionsUnit, from: nil, to: pixel, err-msg: Attempt to access property "XMPmwgrs_RegionAppliedToDimensionsUnit" not declared in com.robcole.lightroom.ExifMeta's Info.lua"
    This is minor problem but it would be nice to know how to handle this kind of error in the future. Do I need to declare these in the lua-code if I need them?
    Looking forward to replies,
    Mikko

    Mikko,
    In future, please direct exif-meta specific questions to the exif-meta forum, or me personally.
    But a quick answer: exif-meta doesn't (by default) parse ("interpret") text values, so commas shouldn't be handled differently than any other text.
    The best way to find out what's going on is to invoke exiftool from the command line and inspect the output.
    My hunch is there is a zero character in there representing end-of-string, which can cause problems for lua code (e.g. Lightroom).
    If you send me one of your files which includes the face data, I'll have a look.
    PS - No clue about the 3 region tags (might be worth trying it with the latest version of exiftool) - please send me a file for inspection - thanks.
    Rob

  • Append new tag in xml schema

    Hi,
               I have created a local varibale and stored my xml schema (xml structure) in it. I am using a sql query to fetch the records from databae and populating it to the schema using Assignment action block. But I have a requirement that one of the tag in the xml schema should be added dynamicaly according to the result of the query. Can anyone help me on this? . In the Linktype I saw one option as Append xml. How can we use that option
    Please let me know if you have any thoughts on this
    Thanks in advance
    Shaji

    Hi Shaji,
    Please find the below link: It explains all the XML functions in MII Workbench.
    http://wbhelp.sap.com/manufacturing/xmii_120/en/44/7ca00d32406572e10000000a11466f/content.htm
    "Calculated Columns" can be useful here as per your requirements.
    For help on Link Types, go through the following link:
    http://wbhelp.sap.com/manufacturing/xmii_120/en/44/89aa7088cc6fb5e10000000a155369/content.htm
    Hope this will help you.
    Best regards,
    Kedar

  • How to make the tags in XML file case insensitive

    Hi,
    I have a ReadXML class which reads an xml file. This class also has a method which receives a string-child from another class and uses this string-chile to match it with the child tag in the xml file, and returns the child tag's value.
    Now, my problem is this, the child tag in xml may be in a case different from the case of the string-child received from another class.
    How do I modify it, so the program does not return a null pointer exception because the strings did not match for want of uppercase or lowercase letters.
    Thanks
    Sangeetha

    I'm not sure what you are getting at. Is a string child the contents of a node treated as text?
    If you are trying to match a child node regardless of case I doubt this is possible as the XML standard says an XML document is case sensitive so if your parser ignored case it would not be XML complient.
    Hope this helps.

  • How to create default column in XML schema ?

    Hi All,
    I would like to define a default column let's say Run_Date as Date datatype in XML schema definition (XSD) and would like to populate SYSDATE to the column Run_Date, When XML records are parsed to that schema.
    Please let me know, how we can achieve?
    Thanks in Advance.

    Hi,
    Thanks for the update. Please find below my responses and let me know your thoughts.
    The Existing schema definition is as follows
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The sample XML file is as follows
    <?xml version="1.0"?>
    <Emp xsi:noNamespaceSchemaLocation="EMP.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <EmpNo>1001</EmpNo>
    <FirstName>William</FirstName>
    <LastName>Don</LastName>
    <EmployeeType>Permanent</EmployeeType>
    <EmpLocation>NewYork</EmpLocation>
    <EmpExperience>10</EmpExperience>
    </Emp>
    The modified schema definition is as follows
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WorkHrs" maxOccurs="100" xdb:SQLName="WorkHrs" xdb:propNumber="3280" xdb:global="false" xdb:SQLType="WorkHrs_T" xdb:SQLSchema="APPS" xdb:memType="258" xdb:SQLInline="true" xdb:MemInline="false" xdb:JavaInline="false" xdb:SQLCollType="WORKHRS330_COLL" xdb:SQLCollSchema="APPS">
    <xs:complexType xdb:SQLType="WORKHRS_T" xdb:SQLSchema="APPS">
    <xs:attribute name="Day" xdb:SQLName="DAY" xdb:propNumber="3273" xdb:global="false" xdb:SQLType="VARCHAR2" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="Hrs" xdb:SQLName="HRS" xdb:propNumber="3274" xdb:global="false" xdb:SQLType="NUMBER" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:decimal"/>
    </xs:simpleType>
    </xs:attribute>
    </xs:schema>
    The sample XML file is as follows
    <?xml version="1.0"?>
    <Emp xsi:noNamespaceSchemaLocation="EMP.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <EmpNo>1001</EmpNo>
    <FirstName>William</FirstName>
    <LastName>Don</LastName>
    <EmployeeType>Permanent</EmployeeType>
    <EmpLocation>NewYork</EmpLocation>
    <EmpExperience>10</EmpExperience>
    <WorkHrs Day="Monday" Hrs="8.0"/>
    <WorkHrs Day="Tuesday" Hrs="6.5"/>
    <WorkHrs Day="Wednesday" Hrs="8.5"/>
    <WorkHrs Day="Thursday" Hrs="10.5"/>
    <WorkHrs Day="Friday" Hrs="5.5"/>
    </Emp>
    The Copy Evolve Procedure is as follows (I have added attributes to the above schema definition)
    DECLARE
    SCHEMA_TO_EVOLVE     XDB$STRING_LIST_T;
    NEW_SCHEMA               XMLSEQUENCETYPE;
    OLD_SCHEMA_URL          VARCHAR2(100) := 'EMP.xsd';
    V_NEW_XML_DOC          CLOB := '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="Emp" type="EmpType" xdb:defaultTable="EMPLOYEES" xdb:columnProps="CONSTRAINT emp_pk PRIMARY KEY (XMLDATA.EMP_NO)" />
    <xs:complexType name="EmpType" xdb:SQLType="EMPLOYEES_T">
    <xs:sequence>
    <xs:element name="EmpNo" xdb:SQLName="EMP_NO">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName" xdb:SQLName="FIRST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="LastName" xdb:SQLName="LAST_NAME">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmployeeType" xdb:SQLName="EMPLOYEE_TYPE">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="25"/>
    <xs:enumeration value="Permanent"/>     
    <xs:enumeration value="Consultant"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpLocation" xdb:SQLName="EMP_LOCATION">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="25"/>
    <xs:enumeration value="NewYork"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmpExperience" xdb:SQLName="EMP_EXPERIENCE">
    <xs:simpleType>
    <xs:restriction base="xs:positiveInteger">
    <xs:totalDigits value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WorkHrs" maxOccurs="100" xdb:SQLName="WorkHrs" xdb:propNumber="3280" xdb:global="false" xdb:SQLType="WorkHrs_T" xdb:SQLSchema="APPS" xdb:memType="258" xdb:SQLInline="true" xdb:MemInline="false" xdb:JavaInline="false" xdb:SQLCollType="WORKHRS330_COLL" xdb:SQLCollSchema="APPS">
    <xs:complexType xdb:SQLType="WORKHRS_T" xdb:SQLSchema="APPS">
    <xs:attribute name="Day" xdb:SQLName="DAY" xdb:propNumber="3273" xdb:global="false" xdb:SQLType="VARCHAR2" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="Hrs" xdb:SQLName="HRS" xdb:propNumber="3274" xdb:global="false" xdb:SQLType="NUMBER" xdb:memType="2">
    <xs:simpleType>
    <xs:restriction base="xs:decimal"/>
    </xs:simpleType>
    </xs:attribute>
    </xs:schema>';
    BEGIN
    DBMS_OUTPUT.PUT_LINE('B4 GETTING FILE FROM OS');
    EXECUTE IMMEDIATE 'DROP TABLE EMPLOYEES_TEMP';
    -- Getting file from the file system
    --V_NEW_XML_DOC           := XXTIF_EDI_UTL.GET_CLOB_DOCUMENT('COIL_1.1.xsd','UTF8');
    SCHEMA_TO_EVOLVE     := XDB$STRING_LIST_T(OLD_SCHEMA_URL);
    NEW_SCHEMA           := XMLSEQUENCETYPE(XMLTYPE(V_NEW_XML_DOC));
    DBMS_XMLSCHEMA.COPYEVOLVE(SCHEMA_TO_EVOLVE,NEW_SCHEMA, preserveOldDocs => TRUE, mapTabName => 'EMPLOYEES_TEMP', generateTables => FALSE);
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('SUCCESSFULLY COPIED');
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('THE ERROR IS '||SQLERRM);
    END;
    The Table Creation is as follows
    CREATE TABLE EMPLOYEES (XMLDOC XMLTYPE,
                   CREATE_DATE DATE DEFAULT SYSDATE NOT NULL ,
    CONSTRAINT emp_pk PRIMARY KEY (XMLDOC."XMLDATA".EMP_NO)
    XMLTYPE COLUMN XMLDOC STORE AS OBJECT RELATIONAL
    XMLSCHEMA "EMP.xsd" ELEMENT "Emp"
    DECLARE
    TABLENAME VARCHAR2(2000) := 'EMPLOYEES1128';
    BEGIN
    SELECT TEMP_TABNAME
    INTO TABLENAME
    FROM EMPLOYEES_TEMP
    WHERE TABLE_NAME = USER || '.' || UPPER('RELATIE_DOCUMENTEN');
    EXECUTE IMMEDIATE 'INSERT INTO EMPLOYEES(XMLDOC) SELECT XMLTYPE(DATA) FROM ' || TABLENAME;
    COMMIT;
    END;
    When I executed the above SQL, It only populates main data(Perosnal Details such as EmpNo,FirstName,LastName) but not attributes (Workhrs.Day,WOrkhrs.Hrs).
    Please let me know, how can I move those attributes data?
    Again Oracle & XML versions are as follows
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    Oracle XML Database 10.2.0.3.0
    Thanks in Advance.

  • How to read data with different XML schemas within the single connection?

    I have Oracle 11g database
    I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
    I have several tables, each has one XMLType column, all schema-based.
    There are three different XML schemata registered in the DB
    I may need to read the XML data from several tables.
    If all the XMLTypes have the same XML schema ,there is no problem,
    If the schemata are different, the second read throws BindXMLException.
    If I reset the connection between the reads of the XMLType column with different schemata, it works.
    The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
    The code to get the XMLType data is textbook implementation:
    1   ResultSet resultSet = statement.executeQuery( sql ) ;
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • How to enhance the fields into xml schema?

    Hi Expert,
    We are at SRM-MDM Catalog 3.0 SP02, we enhanced two fields in the contract data which were transfered from the SRM via xml.  But when the MDM import manage do the mapping between the xml file and MDM catalog items automatically, it will bring a exception with the mapping error. The error message is "Logon Error: Source file dose not conform to XML schema. Element <field name> not found in the xml schema."
    How could I add these fields to xml schema?
    The problem is resolved.
    Edited by: Wendrin Duan on Nov 5, 2009 5:01 AM

    Hi
    Did changing the Name of the Schema in the console to be the same as the Name of the Schema file solve the problem.
    I take it you used the output file with the custime fields to create the Schema file so as to have a consistent structure.
    REegards,
    Iggy

  • How to generate XSD file for XML schema adobe form

    Hi,
    I want to generate XSD file for XML schema interfaces adobe forms. How can I do it. Where I can do it..or who will provide this file..
    Thanks
    Ram
    Edited by: Ramesh ram on Feb 23, 2010 6:33 PM

    Aaaaah, my mistake, sorry for that. Of course you should use the XML interface and I forgot it is not described in this tutorial. You can easily find another one where the XML based interface is used. But... you won´t need any tutorial. just create a WD context. Place a Interactive form element on your WD app screen, in the attributes you need to maintain the form template name. If you write a name suitable for you which no existing forms uses, the system will offer you to generate a XML based interface and right after that it will "send" you to the SFP transaction. That means you can like skipi the step defining the interface because it it is generated automatically and you only draw the layout for this generated interface.
    You should use XMl based interface for your WD app, because when using the ABAP dic based, some features are not available (I am not sure, but ABAP based works only for print form or something).
    Hope it is all clear now,
    have a nice day,
    Otto

  • How can I modify a registered XML-Schema?

    Hi
    I have registered a XML-Schema document. Is it possible to modify it?
    Here is an example of an registered XML-Schema. What I have to do if I would like to change for example the MA_NR, without to delete and recreate the XML-Schema?
    DECLARE
    xml_schema VARCHAR2(1000) :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:adr="http://www.ordix.de/mitarbeiterAbteilung4.xsd"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="MitarbeiterType">
    <xs:sequence>
    <xs:element name="Ma_Nr"/>
    <xs:element name="Ma_Vorname"/>
    <xs:element name="Ma_Nachname"/>
    <xs:element name="Ma_Abteilung">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Abteilung_NR"/>
         <xs:element name="Abteilung_Name"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="Mitarbeiter" type="MitarbeiterType"/>
    </xs:schema>';
    BEGIN
    DBMS_XMLSCHEMA.registerSchema('http://www.ordix.de/mitarbeiterAbteilung4.xsd',xml_schema);
    END;

    I believe you want CopyEvolve

  • How to remove empty tags respecting the schema contraints?

    Hi,
    I'm generating an XML document with XSLT. This document have some empty tags. My question is about to remove all empty tags only if they are defined as optionnals in the schema.
    Is this possible with the DOM?
    Thanks in advance,
    Philippe

    With DOM3 validation api, elements/attributes may be checked if they may be removed.
    -Check if the element is empty; getFirstChild() method returns null.
    -Check if the element may be removed with DOM 3 Validation API.

  • How to remove empty tags from XML

    Hello,
    I have a XML file which contains some empty tags and some values with "?". I need to remove all empty tags and tags which have a value "?".
    Sample Data:
    <a>
    <b></b>
    <c> Hello </c>
    <d>world ?</d>
    <e>oracle</e>
    </a>
    Expected result:
    <a>
    <c> Hello </c>
    <e>oracle</e>
    </a>
    Thank you for your time.
    Thanks,
    Edited by: 850749 on Apr 7, 2011 6:25 PM

    Dear Odie,
    May I make your example a bit more complicated by adding an additional complexType, please:
    ---Original ----
    <DEPT>
    <EMPID>1</EMPID>
    <EMPNAME>Martin Chadderton</EMPNAME>
    <SALARY>??</SALARY>
    <SALARYq></SALARYq>
    </DEPT>
    ----- New ----
    <DEPT>
    <EMPID>1</EMPID>
    <EMPNAME>Martin Chadderton</EMPNAME>
    <SALARY>??</SALARY>
    <SALARYq></SALARYq>
    <EMPLMNT_HISTORY>
    <DEVISION>1</DEVISION>
    <FROM_DATE>2011-01-01 </FROM_DATE>
    <TO_DATE></TO_DATE>
    </EMPLMNT_HISTORY>
    </DEPT>
    Your solution works perfectly for <SALARY>, but how would you suggest also to deal with <TO_DATE> ?
    Massive thanks for your help!
    N.B. Just to emphasise, in my case I have 3 levels (complexType > complexType > complexType) and many elements and I would like to know if there is any generic option to say
    to remove all the empty elements from the result, as it causes to the SSJ (Systinet) Webservice to crash.

  • How to handle external tag-libraries in JSPs using Oracle Stellent?

    I have already started the execution of JSP engine in Oracle Stellent, and also could run the sample Tomcat web-application and basic JSPs in Oracle UCM. What I need to do, is to customize my JSP to be able to show/hide some content using Oracle Stellent.
    I have a JSP, from web application, which is using some some tag-libraries from spring, etc.
    +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>+
    +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>+
    +<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>+
    +<%@ taglib prefix="security"+
    uri="http://www.springframework.org/security/tags"%>
    +<%@taglib uri="http://www.springframework.org/tags" prefix="s"%>+
    +<%@ page import = "idcserver.*" %>+
    +<jsp:useBean id="sb" class="idcserver.ServerBean" />+
    +<%+
    sb.init(request);
    ....and so on
    I have checked in the above file, and when trying to preview in Oracle UCM, I get the following error:
    Content Server Request Failed
    +!csStellentTomcatErrorWhileProcessing,/idca/groups/jsp/documents/pix/11.jspThe absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application:org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application+
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(Unknown Source)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(Unknown Source)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(Unknown Source)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(Unknown Source)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(Unknown Source)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Unknown Source)
    at org.apache.jasper.compiler.Parser.parseDirective(Unknown Source)
    at org.apache.jasper.compiler.Parser.parseElements(Unknown Source)
    at org.apache.jasper.compiler.Parser.parse(Unknown Source)
    at org.apache.jasper.compiler.ParserController.doParse(Unknown Source)
    at org.apache.jasper.compiler.ParserController.parse(Unknown Source)
    at org.apache.jasper.compiler.Compiler.generateJava(Unknown Source)
    at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
    at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
    at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
    at org.apache.jasper.JspCompilationContext.compile(Unknown Source)
    at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
    at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
    at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardValveContext.invokeNext(Unknown Source)
    at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(Unknown Source)
    at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardValveContext.invokeNext(Unknown Source)
    at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
    at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardValveContext.invokeNext(Unknown Source)
    at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardValveContext.invokeNext(Unknown Source)
    at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
    at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
    at org.apache.catalina.core.StandardValveContext.invokeNext(Unknown Source)
    at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
    at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(Unknown Source)
    at tomcatprovider.StellentProtocol$StellentWorkThread.runIt(StellentProtocol.java:304)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:595)
    Edited by: 980473 on Jan 8, 2013 2:01 AM

    Hi ,
    Check if you have jstil.jar in WEB-INF/lib location , if missing manually add jstl.jar into WEB-INF/lib restart UCM Managed server .
    Hope this helps.
    Thanks,
    Srinath

  • How to delete empty tags after xml-import

    Hello collegues,
    I'm totally new in this forum so excuse me if I make a mistake, but I've a little question.
    I've imported text and images with a xml-import but sometimes empty tags (the colored invisible blocks) are in my text, with the result that I can't Find/Change on double-returns.
    Does anybody know an awnser to this matter? I would love to write an apple-script that will find/change this so i don't have to look after all my pages.
    Thank you very much in advance.

    ThePictureCreator wrote:
    ...I can't Find/Change on double-returns.
    What's your search query? I think you should be able to, with either a grep find of "\r+" or a normal text find of "^p^p". InDesign pretends like the tag-holding characters aren't there for the purpose of search. But you will lose the empty elements along with the extra returns. Maybe that is the problem?
    Jeff

Maybe you are looking for