5 Replies Latest reply: May 10, 2007 12:41 AM by Marco Gralike RSS

    how to associate other file extension with text/xml

    68212
      Hi,
      I found that I could only load files into XDB via ftp when they had the file extension ".xml". Why is this?

      Thanks

      Pete
        • 1. re:how to associate other file extension with text/xml
          3004
          The information as to which file extensions are associated with which mime-types is stored in the xdbconfig.file. You can add an entry using the following code
          connect system/oracle as sysdba
          call dbms_xdb.cfg_update
               (
                 updatexml 
                 (
                   dbms_xdb.cfg_get(),
                   '/xdbconfig/sysconfig/protocolconfig/common/extension-mappings/mime-mappings',
                   xmlelement
                   (
                     "mime-mappings",
                     xmlconcat
                     (
                       extract
                       (
                         dbms_xdb.cfg_get(),
                         '/xdbconfig/sysconfig/protocolconfig/common/extension-mappings/mime-mappings/mime-mapping'
                       ),
                       xmltype
                       (
                         '<mime-mapping xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">
                      <extension>rdf</extension> 
                      <mime-type>text/xml</mime-type> 
                      </mime-mapping>'
                       )
                     )
                   )
                 )
               )
          /
          commit
          /
          call dbms_xdb.cfg_refresh()
          /
          set long 1000000
          set pagesize 0
          select dbms_xdb.cfg_get() from dual
          /
          quit
          • 2. Re: re:how to associate other file extension with text/xml
            494187
            I tried to run this code to add a mime-type, but I keep getting the following error:
            ============
            ORA-30937: No schema definition for 'mime-mappings' (namespace '##local') in
            parent 'extension-mappings'
            ============

            Any clues?

            I am using Oracle 9.2.0.8.0.

            Leigh.
            • 3. Re: re:how to associate other file extension with text/xml
              Marco Gralike
              Cross reference your xdbconfig.xsd under path /sys... Anyway it should just work dropping (via WebDay) or making use of ftp to upload files in the repository...
              • 4. Re: re:how to associate other file extension with text/xml
                494187
                Finally worked it out by adding
                XMLATTRIBUTES('http://xmlns.oracle.com/xdb/xdbconfig.xsd' AS "xmlns"),
                to the mime-mappings element.

                Result is this:
                ==========
                ...
                xmlelement
                (
                "mime-mappings",
                XMLATTRIBUTES('http://xmlns.oracle.com/xdb/xdbconfig.xsd' AS "xmlns"),
                xmlconcat
                ...
                ==========

                Ultimately it was just easier to download the xdbconfig.xml file by FTP, edit it with a
                text editor, then upload it again -- as you hinted to do!

                Leigh.
                • 5. Re: re:how to associate other file extension with text/xml
                  Marco Gralike
                  Duh,.

                  It wouldn't have been so confusing if you just had created a new forum post... Apparently (not reading correctly and or checking dates) I tried to figure something for a question posted in 2002?