Importing native xml in to semi structured storage

hello,
how store the a bibliographic data in the native xml and import or export that data into to the semi structured storage. What are the ways we query the xml database.
Eagerly waiting for the reply
Cheers
Akhil
Thank you in advance

Based on a small extension demo-ed in : http://www.liberidu.com/blog/?p=1053 (demo script demo06.sql)
-- If you can select it you can insert it...
-- drop table OGH_xml_store purge;
create table OGH_xml_store of xmltype
xmltype store as binary xml
commit;
exec get_dir_list( 'G:\OGH\xmlstore' );
set time on timing on
insert into OGH_xml_store
select XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) AS "XML"
from   dir_list dl
where  dl.filename like '%.xml';
set time off timing off
commit;
select count(*) from OGH_xml_store;
prompt pause
pause
clear screen
-- If you can select it you can create resources and files
set time on timing on
commit;
exec get_dir_list( 'G:\OGH\xmlstore' );
select count(*) from dir_list where filename like '%.xml';
set serveroutput on size 10000
DECLARE
  XMLdoc       XMLType;
  res          BOOLEAN;
  v_foldername varchar2(4000) := '/public/OGH/';
  cursor c1
  is
  select dl.filename                                                                  FNAME
  ,      XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) XMLCONTENT
  from   dir_list dl
  where  dl.filename like '%.xml'
  and rownum <= 100;
BEGIN
-- Create XDB repository Folder
if (dbms_xdb.existsResource(v_foldername))
then
       dbms_xdb.deleteResource(v_foldername,dbms_xdb.DELETE_RECURSIVE_FORCE);
end if;
res:=DBMS_XDB.createFolder(v_foldername);
-- Create XML files in the XDB Repository
for r1 in c1
loop
   if (DBMS_XDB.CREATERESOURCE(v_foldername||r1.fname, r1.xmlcontent))
   then
      dbms_output.put_line(v_foldername||r1.fname);
      null;
   else
      dbms_output.put_line('Loop Exception :'||sqlerrm);
   end if;
end loop;
EXCEPTION WHEN OTHERS THEN
  dbms_output.put_line('Others Exception: '||sqlerrm);
END;
set time off timing off
commit;
prompt pause
pause
clear screen
-- FTP and HTTP
clear screen
prompt
prompt *** FTP - Demo ***
prompt
prompt pause
pause
host ftp
-- open localhost 2100
-- user OGH OGH
-- cd public
-- cd OGH
-- ls
-- bye
clear screen
prompt
prompt *** Microsoft Internet Explorer - Demo ***
prompt
prompt pause
pause
host "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://OGH:OGH@localhost:8080/public/OGH/
prompt pause
pause
-- Accessing the XDB Repository content via Resource View
-- Selecting content from a resource via XBDUriType
clear screen
prompt set long 300
set long 300
prompt Relative Path - (path)
SELECT path(1) as filename
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OGH', 1) = 1
and rownum <= 10
prompt pause
pause
clear screen
prompt Absolute Path - (any_path)
select xdburitype(any_path).getClob() as xml
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OGH', 1) = 1
and rownum <= 1;
prompt pause
pause

Similar Messages

  • Semi structured storage

    hi,
    what are the steps to follow to store or import/ export native xml data into semistructured storage in oracle 11g?????
    how to test the performance of the semi structured data??????
    Edited by: user11269819 on Jul 17, 2009 11:00 AM

    I'm not sure which method you are referring to as "semi-structure" (hybrid?) so I'll point you to this [Oracle 11g – XMLType Storage Options | http://www.liberidu.com/blog/?p=203] which is derived from [Oracle® XML DB Developer&apos;s Guide 11g Release 1|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/toc.htm]. You can also find more storage related information on Marco&apos;s blog under the [storage category | http://www.liberidu.com/blog/?cat=23]

  • Loading XML Document into Structured Storage

    HI Everybody,
    I am confronted with a BUG in Oracle which is being fixed but will last a long time. I have a relatively complex Schema with manifold includes, imports and inheritances which I can register successfully. The object-relational table is also generated. But loading the instance document with INSERT INTO... fails due to severe internal error. I have not yet tried SQL*Loader, however.
    Please, does anyone know a safe alternative method to parse and load? Structured storage is mandatory because I need to retrieve individual elements and attributes. Instance documents are big, ca. 20 MB.
    Thanks, regards
    Miklos HERBOLY

    HI,
    Oracle version is 11.1.0.7.0.
    Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
    The bugs are:
    BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
    BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
    BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
    Well, I have to look round in XML DB Forum yet.

  • Query about XMLTYPE column structured storage in Oracle Xml db

    Dear All,
    DB Version: Oracle 11g (11.2.0.3.0)
    I have an table having one column as XMLTYPE with Structured storage.
    CREATE TABLE Orders
        Order_id NUMBER NOT NULL,
        Order_etc VARCHAR2(100),
        Order_desc XMLType NOT NULL
        XMLTYPE Order_desc STORE AS OBJECT RELATIONAL XMLSCHEMA  "http://localhost/public/xsd/order_desc_xsd.xsd" ELEMENT "OrderState";
    I have then registered the XSD with XML Db schema which is required for Structured storage.
    Before this table creation I had created a table (db_objects) of XMLTYPE and was able to use the below query to check for what all objects the XMLTYPE table got broken into when I registered its XSD.
        SELECT column_name,     
               data_type
        FROM   user_tab_cols
        WHERE  table_name = 'DB_OBJECTS';
    And used below query to look for data stored in Object-Relational structure for my table (DB_OBJECTS) created with XMLTYPE definition.
      SELECT EXTRACTVALUE(xseq.column_value, '/THISROW/OWNER')       AS owner
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_NAME') AS object_name
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_TYPE') AS object_type
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_ID')   AS object_id
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/CREATED')     AS created
        FROM   db_objects do
         ,      TABLE(XMLSEQUENCE(EXTRACT(VALUE(do), '/ROWSET/THISROW'))) xseq 
        WHERE  ROWNUM <= 10;
    Now could someone let me know, how to find how the column (Order_desc) of XMLTYPE was broken down into further objects just like I did for the Table with XMLTYPE (as shown above)?
    Many Thanks.

    First given that you are on 11.2, ExtractValue is deprecated and the documentation lists three options to use instead.  Here is one option (untested)
    SELECT owner, object_name, object_type, object_id, created
      FROM db_objects do,
           XMLTable('/ROWSET/THISROW'
                    PASSING do.object_value
                    COLUMNS
                    -- Set data types accordingly
                    owner        VARCHAR2(20) PATH 'owner',
                    object_name  VARCHAR2(20) PATH 'object_name',
                    object_type  VARCHAR2(20) PATH 'object_type',
                    object_id    VARCHAR2(20) PATH 'object_id',
                    created      VARCHAR2(20) PATH 'created');
    Second, why does column order matter?  You are storing in an object relational method.  As long as the XML is valid per the schema, the Oracle will be able to store the data and later retrieve it as well.  How that data is stored is mostly Oracle internals and should not be touched as it can be changed from version to version.  You can use schema annotation to control how Oracle maps and stores the XML, but nothing in there specifies column order that I am aware of.
    It seems additional details are missing as to what you need the information for so that would help others answer your question.

  • Apply XSLT  while importing the xml to the selected node in structure view

    Hi All,
    I would like to apply XSLT while importing the xml file to the selected node in the structure view.
    How to go about it?
    Thanks
    Sakthi

    Hi All,
       Got the solution,
                    UIDRef documentUIDRef = ::GetUIDRef(activeContext->GetContextDocument());
                InterfacePtr<IDocument> document(documentUIDRef, UseDefaultIID());
                InterfacePtr<IXMLImportOptionsPool> prefsPool( document->GetDocWorkSpace(), UseDefaultIID() );
                InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());
                InterfacePtr<IK2ServiceProvider> serviceProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLImportMatchMakerSignal Service,     kXMLThrowAwayUnmatchedRightMatchMakerServiceBoss));
                InterfacePtr<IXMLImportPreferences> prefs(serviceProvider, IID_IXMLIMPORTPREFERENCES);
                XMLImportPreferencesInitializer initializer(prefs, prefsPool);
                bool16 prefBool = prefs->GetNthPrefAsBool(0);
                prefs->SetNthPref(0, kTrue);
    The above code set the import option "Delete elements, frames, and content that do not match imported XML"
    Thanks
    Sakthi

  • Structured storage XMLType but disappointing performance

    Hi,
    This relates to Oracle 11g, but maybe the same question can be asked for 10g.
    I'm having a lot of big XML files which are structured following this xsd:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xs:schema
       xmlns="http://localhost/public/xsd/simple.xsd"
       targetNamespace="http://localhost/public/xsd/simple.xsd"
       xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:xdb="http://xmlns.oracle.com/xdb"
       elementFormDefault="qualified"
       attributeFormDefault="unqualified"
       xdb:storeVarrayAsTable="true">
      <xs:element name="root" xdb:defaultTable="simple_or" xdb:maintainDOM="false">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ea">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="c1" type="xs:double" />
                        <xs:element name="c2" type="xs:double" />
                        <xs:element name="c3" type="xs:double" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
               </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>I create a VARRAY (the order is important) based structured storage table using the following commands:
    declare
      l_bfile bfile;
      res boolean;
    begin
      l_bfile := bfilename('EXDIR', 'simple.xsd');
      dbms_lob.open(l_bfile);
      dbms_xdb.deleteResource('/public/simple.xsd',4);
      res := dbms_xdb.createResource('/public/simple.xsd',l_bfile);
    end;
    BEGIN
      DBMS_XMLSchema.deleteSchema(
        schemaurl=>'http://localhost/public/xsd/simple.xsd',
        delete_option=>DBMS_XMLSchema.Delete_Cascade_Force);
    END;
    begin
       dbms_xmlschema.registerSchema(schemaurl => 'http://localhost/public/xsd/simple.xsd',
                                     schemadoc => xdbUriType('/public/simple.xsd').getXML(),
                                     local     => true,
                                     gentypes  => true,
                                     genbean   => false,
                                     gentables => true,
                                     force     => false,
                                     owner     => user);
    end;
    CREATE TABLE simple_or_1 OF XMLType
      XMLSCHEMA "http://localhost/public/xsd/simple.xsd"
      ELEMENT "root"
      VARRAY "XMLDATA"."ea"."eb"
        STORE AS TABLE simple_nested1
            ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)))
    /And I load some XML files of the following form:
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns="http://localhost/public/xsd/simple.xsd">
    <ea>
    <eb>
    <c1>4.0</c1>
    <c2>5.0</c2>
    <c3>6.0</c3>
    </eb>
    <eb>
    <c1>7.0</c1>
    <c2>8.0</c2>
    <c3>9.0</c3>
    </eb>
    <eb>
    <c1>7.0</c1>
    ... etc ...
    </ea>
    </root>
    Every document has about 50.000 <eb> elements and I loaded 6 sample documents.
    A simple query like the following takes about 5 minutes:
    SELECT XMLQuery('
      declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
      for $i in /root
      return max($i/a/b/c2)
    ' PASSING OBJECT_VALUE RETURNING CONTENT)
    FROM simple_or_1;The explain plan shows the following:
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                |     6 |    60 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE              |                |     1 |  1901 |            |          |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| SIMPLE_NESTED1 |  1969 |  3655K|     6   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | SYS_C009750    |   787 |       |     2   (0)| 00:00:01 |
    |   4 |  SORT AGGREGATE              |                |     1 |       |            |          |
    |   5 |   FAST DUAL                  |                |     1 |       |     2   (0)| 00:00:01 |
    |   6 |  TABLE ACCESS FULL           | SIMPLE_OR_1    |     6 |    60 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_XMLCONV("SYS_ALIAS_2"."SYS_XDBPD$",0,32,'3952ABE048DCF8D6E040007F0101
                  7EA4',1,5561,1) IS NOT NULL)
       3 - access("NESTED_TABLE_ID"=:B1)I'm not understanding the low performance of 5 minutes... is there anyone who can explain and help out?

    Note with DOM Fidelity disabled on all types the SYS_XMLCONV is replaced with the more efficeint SYS_XMLGEN. However this is still not as efficient as the XMLTable approach..
    C:\Documents and Settings\Mark D Drake>sqlplus sys/oracle as sysdba
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 7 06:03:39 2007
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Beta
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> connect / as sysdba
    Connected.
    SQL> --
    SQL> drop user Tijink cascade
      2  /
    drop user Tijink cascade
    ERROR at line 1:
    ORA-01918: user 'TIJINK' does not exist
    SQL> grant connect, resource, alter session, create view to Tijink  identified by  Tijink
      2  /
    Grant succeeded.
    SQL> conn Tijink/Tijink
    Connected.
    SQL> --
    SQL> set long 10000000
    SQL> set pages 5000
    SQL> var schemaPath varchar2(256)
    SQL> var schemaURL  varchar2(256)
    SQL> var xmlSchema  clob;
    SQL> --
    SQL> begin
      2     :schemaURL := 'http://localhost/public/xsd/simple.xsd';
      3     :schemaPath := '/public/simple.xsd';
      4     :xmlSchema :=
      5  '<?xml version="1.0" encoding="ISO-8859-1"?>
      6  <xs:schema
      7     xmlns="http://localhost/public/xsd/simple.xsd"
      8     targetNamespace="http://localhost/public/xsd/simple.xsd"
      9     xmlns:xs="http://www.w3.org/2001/XMLSchema"
    10     xmlns:xdb="http://xmlns.oracle.com/xdb"
    11     elementFormDefault="qualified"
    12     attributeFormDefault="unqualified"
    13     xdb:storeVarrayAsTable="true">
    14    <xs:element name="root" xdb:defaultTable="simple_or">
    15      <xs:complexType xdb:maintainDOM="false">
    16        <xs:sequence>
    17          <xs:element name="ea">
    18            <xs:complexType xdb:maintainDOM="false">
    19              <xs:sequence>
    20                <xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
    21                  <xs:complexType xdb:maintainDOM="false">
    22                    <xs:sequence>
    23                      <xs:element name="c1" type="xs:double" />
    24                      <xs:element name="c2" type="xs:double" />
    25                      <xs:element name="c3" type="xs:double" />
    26                    </xs:sequence>
    27                  </xs:complexType>
    28                </xs:element>
    29              </xs:sequence>
    30             </xs:complexType>
    31          </xs:element>
    32        </xs:sequence>
    33      </xs:complexType>
    34    </xs:element>
    35  </xs:schema>';
    36  end;
    37  /
    PL/SQL procedure successfully completed.
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    SQL> DECLARE
      2    BINARY_XML boolean:=FALSE;
      3  BEGIN
      4     IF (BINARY_XML)
      5     THEN
      6        dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
      7                                      SCHEMADOC => :xmlschema,
      8                                      LOCAL     => TRUE,
      9                                      GENTYPES  => FALSE,
    10                                      GENBEAN   => FALSE,
    11                                      GENTABLES => FALSE,
    12                                      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
    13                                      FORCE     => FALSE,
    14                                      OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    15                                      OWNER     => USER);
    16     ELSE
    17        dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
    18                                      SCHEMADOC => :xmlSchema,
    19                                      LOCAL     => TRUE,
    20                                      GENTYPES  => TRUE,
    21                                      GENBEAN   => FALSE,
    22                                      GENTABLES => TRUE,
    23                                      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
    24                                      FORCE     => FALSE,
    25                                      OWNER     => USER);
    26     END IF;
    27  END;
    28  /
    PL/SQL procedure successfully completed.
    SQL> --
    SQL> set timing on
    SQL> set long 1000000
    SQL> set pages 50000
    SQL> set lines 200
    SQL> --
    SQL> call  dbms_stats.GATHER_SCHEMA_STATS('TIJINK')
      2  /
    Call completed.
    Elapsed: 00:00:01.67
    SQL> set autotrace on explain
    SQL> --
    SQL> SELECT XMLQuery
      2         ('
      3      declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
      4      for $i in /root
      5      return max($i/ea/eb/c2)
      6      ' PASSING OBJECT_VALUE RETURNING CONTENT)
      7    FROM "simple_or"
      8  /
    no rows selected
    Elapsed: 00:00:00.28
    Execution Plan
    Plan hash value: 3716725992
    | Id  | Operation                    | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                                |     1 |    10 |     2   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE              |                                |     1 |    23 |            |       |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== |     1 |    23 |     0   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | SYS_C009648                    |     1 |       |     0   (0)| 00:00:01 |
    |   4 |  SORT AGGREGATE              |                                |     1 |       |            |       |
    |   5 |   FAST DUAL                  |                                |     1 |       |     2   (0)| 00:00:01 |
    |   6 |  TABLE ACCESS FULL           | simple_or                      |     1 |    10 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_XMLGEN(TO_CHAR("SYS_ALIAS_1"."c2")) IS NOT NULL)
       3 - access("NESTED_TABLE_ID"=:B1)
    SQL> select max(c2)
      2    from "simple_or",
      3         xmltable
      4         (
      5           xmlnamespaces
      6           (
      7              default 'http://localhost/public/xsd/simple.xsd'
      8           ),
      9           '/root/ea/eb'
    10           passing OBJECT_VALUE
    11           columns
    12           C2 PATH 'c2'
    13         )
    14  /
       MAX(C2)
    Elapsed: 00:00:00.15
    Execution Plan
    Plan hash value: 1041340395
    | Id  | Operation                     | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                                |     1 |    33 |     0   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE               |                                |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                |                                |       |       |            |          |
    |   3 |    NESTED LOOPS               |                                |     1 |    33 |     0   (0)| 00:00:01 |
    |   4 |     INDEX FULL SCAN           | SYS_C009649                    |     1 |    10 |     0   (0)| 00:00:01 |
    |*  5 |     INDEX RANGE SCAN          | SYS_C009648                    |     1 |       |     0   (0)| 00:00:01 |
    |   6 |    TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== |     1 |    23 |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       5 - access("NESTED_TABLE_ID"="simple_or"."SYS_NC0000700008$")
    SQL> desc "simple_or"
    Name                                                                                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://localhost/public/xsd/simple.xsd" Element "root") STORAGE Object-relational TYPE "root648_T"
    SQL> desc "root648_T"
    Name                                                                                                      Null?    Type
    ea                                                                                                                 ea649_T
    SQL> desc "ea649_T"
    Name                                                                                                      Null?    Type
    eb                                                                                                                 eb651_COLL
    SQL> desc "eb651_COLL"
    "eb651_COLL" VARRAY(2147483647) OF eb650_T
    Name                                                                                                      Null?    Type
    c1                                                                                                                 NUMBER
    c2                                                                                                                 NUMBER
    c3                                                                                                                 NUMBER
    SQL>

  • How to import multiple XML files into one inDesign document without copy/paste ?

    I use InDesign CS6, and I have several XML files with the same structure. Only the data are different.
    I created  an Indesign layout with some tagged placeholder frames on merge mode, for automated layout.
    Today for each XML file I have to create a new InDesign document to import the XML. Everything works fine. Then in order to have all Indesign layouts one after the other into a single Indesign layout, I have to use the copy/paste function.
    I mean for example, copy the contents of all documents to the first one. Or add pages of other documents to the first one, then delete spaces between each page.
    So my question is the following:
    How to repeat this process without copy/paste function, knowing that the
    number of XML files could be unknown.
    Thank you very much for your answer.

    Yes, effectively I would like to catalogue the files into one collection so i can save as one PDF and Print as one.:)
    I know I could save each AI as a pdf them then merge the pdf's together in acrobat, but I have nearly 100 files so would feel more comfortable seeing them all together before print / saving.
    My concern is that if I insert them in Ai, will the file resolution reduce? and will the ai still be editable and would it update the indesign file?
    Thanks for the quick reply

  • How to convert an xml to another Xml with a different structure...

    hi
    i have an xml which should be converted to a standard xml with an entirely different structure(Different elements)....can this be done with xml,xsl alone or do we need to write an java class along with them...if there are any examples..it would be of great help...plz help me out....as this is a work stopper...
    given below is the kind i have
    <hotelinfo>
    <hotelname>RADISSON HOTEL CHENNAI </hotelname>
    <address>355 C Gst Road St Thomas Mount Chennai1 600016IN</address>     <price>90.00 - 150.00</price>
    <distance>2 (W)</distance>
    </hotelinfo>
    i need to convert it into
    <propertyName>RADISSON HOTEL CHENNAI </propertyName>
    <address>
    <addressLine>355 C Gst Road St Thomas Mount</addressLine>
    <CityName>Chennai</CityName>
    <PostalCode>600 001</PostalCode>
    <StateName>TamilNadu</StateName>
    <CountryName>India</CountryName>
    </address>
    thanks in advance

    Ok here is the code...
    package mypack;
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    * @author SM23772
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class Roopa {
         public static void main(String[] args) {
              File docFile = new File("Roopa.xml");
              Document doc = null;
              Document newDoc = null;
              String hname = null, task = null;
              try {
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   doc = db.parse(docFile); //parsing Roopa.xml
                   newDoc = db.newDocument(); //Created New document Object for new xml
                   hname = doc.getElementsByTagName("hotelname").item(0)
                             .getFirstChild().getNodeValue();
                   task = doc.getElementsByTagName("task").item(0).getFirstChild()
                             .getNodeValue();
                   Node rootNode = newDoc.createElement("property-info"); //creating root node;
                   Node pp = newDoc.createElement("name"); //creating a node called name
                   Node taskNode = newDoc.createElement("task"); //creating a node called task
                   pp.appendChild(newDoc.createTextNode(hname)); //appending a text node inisde name
                   taskNode.appendChild(newDoc.createTextNode(task)); //appending the text node inside task
                   rootNode.appendChild(pp); //asppending the nodes inside the root node                       
                   rootNode.appendChild(taskNode);
                   newDoc.appendChild(rootNode); //appending the root node to the document
                   writeXmlFile(newDoc, "Dest.xml"); //function called to write the document to Dest.xml
              } catch (Exception e) {
                   System.out.println(e);
         public static void writeXmlFile(Document doc, String filename) {
              try {
                   // Prepare the DOM document for writing
                   Source source = new DOMSource(doc);
                   // Prepare the output file
                   File file = new File(filename);
                   Result result = new StreamResult(file);
                   // Write the DOM document to the file
                   Transformer xformer = TransformerFactory.newInstance()
                             .newTransformer();
                   xformer.transform(source, result);
              } catch (TransformerConfigurationException e) {
              } catch (TransformerException e) {
    The xml files:
    roopa.xml:
    <hotel>
    <hotelname>RADISSON HOTEL CHENNAI</hotelname>
    <more-info><task>give treate to shanu</task></more-info>
    </hotel>
    Dest.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <property-info><name>RADISSON HOTEL CHENNAI</name><task>give treate to shanu</task></property-info>Please go through the code.. if u have any more concerns do let me know................
    cheers
    Shanu

  • How to import xfa(XML Forms Architecture) to indesign without losing rich text format.

    Hello All,
    i created pdf form in livecycle.i am populating this pdf form and submit.when i am submiting form ,i will get the data in xfa(xml forms architecture).now i want to import this xml to indesign.when i importing this xml to indesign,it imported without rich text format.this means in indesign formate is not preserved when importing xfa(xml forms architecture).
    how to import xfa(XML Forms Architecture) to indesign without losing rich text format.
    please help me,its urgent.
    thanks
    Humayoo

    I really have no idea what kind of file that is and how is the structure, but if it´s valid XML, I guess you could use InDesigns Tags to Styles mapping engine to format incoming stuff....

  • Conversion of ABAP struct to XML and XML back to ABAP structure in ECC

    We would like to convert many ABAP structure and internal tables into an XML string and later on convert these XML strings back to ABAP structures and internal tables. Can someone let us know if there are any function modules in ECC which can import the structures or internal tables and export the XML. Also if there are any function modules which can do the reverse i.e. import the XML string and convert it back to Structure or internal table.
    We found the some method called "Call transformation" but it gives an error such as version not active. CRM has FMs which do these functionalities.
    Any guidance would be appreciated.
    Thanks.

    If you look into the FM's BANK_API_PP_UT_DATA_TO_XML and BANK_API_PP_UT_XML_TO_DATA they again use CALL TRANSFORMATION, so probably u might have to figure how to eliminate the errors ur getting using CALL TRANSFORMATION.

  • Problems importing an XML Schema

    Hello,
    I am trying to import an XML schema using the MDM Console.
    In the Console Hierarchy tree I right-click on the MDM repository into
    which I want to import the XML schema and choose Import
    Repository Schema from the context menu and finally I choose a simple XML file.
    Then an message appears: "MDS Version mismaths. Upgrade the source repository to the latest version and import the original schema again"
    I use the SAP MDM Console for Windows, version 5.5 SP4. There is another way to import an schema in my repository? This Console version really doesn't support it?
    Thank you.
    Could I import my Schema of my repository using MDM Import manager?

    Hi Marta,
    MDM Console will not update the schema.If you select an xml schema in the import manager and try to specify an xml file with different structure,Then it will give you error and will not allow you to import.
    You define xml schema into MDM console so that u can import data into MDM repository from the xml file or files having same structure as defined into xml schema table of repository.
    The XML Schema drop-down list in Import manager includes an entry for each XML schema you define in the MDM Console. For each XML Schema defined in the console, you can select multiple XML source files, each having the same structure.
    Hope it will help you.Let me know the result and further queries if any.
    <b>
    Please remark if it helped you.</b>
    Thanks,<b>
    Shiv Prashant Dixit</b>

  • Is Oracle XML DB a native xml database?

    Hi!
    XML DB provides native data type XMLTYPE, and it can provide traditional storage for xml. So is it a enabled xml database or a native one??
    Cheers

    It is an XML enabled relational database (XMLType OR storage) but has also native XML database capabilities in the form of binary XML (XMLType Binary XML storage)

  • Piecewise Insert into structured storage

    I understand that XMLUPDATE can handle piecewise update, but what do I do for piecewise insert. I want to add a sub-tree (document fragment) conformant with the registered schema to the xml document, without re-writing the whole (possibly very, very large and growing) document, and retaining all the power and abstraction of structured storage.
    It would be nice to get an XMLType via an XPath select, get the DOM object from the XMLTYpe, operate on the DOM, and see those changes reflected in the database. I can do all that, but the changes to the DOM seem to be in-memory only.
    How do I add a sub-node to an existing structured document?
    Thanks,
    David

    HI,
    Oracle version is 11.1.0.7.0.
    Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
    The bugs are:
    BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
    BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
    BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
    Well, I have to look round in XML DB Forum yet.

  • Storing data in structured storage

    I see everywhere that storing data in stuctured storage way is the better thing to do if we want to make fast search.
    But how can I do it.
    I only see that the default storage is clob for xmltype and we also can say "stored as clob" but how do it for store it in structured storage.
    Thank you.

    You need to register an XML Schema that defines your data. You then define the type of data your XML columns will contain using XMLSCHEMA and ELEMENT clauses..
    See the XML DB demo for more info

  • How to remove override after importation of XML automatically

    Does anyone know of the best way to automate the removeoverride concept after importation of XML into an InDesign template without manually threading to a new page.
    I am trying to write a batch program that will create multiple XML files and then generate an InDesign document for each XML file from a predefined InDesign template file that is already mapped to the XML structure.

    RESOLVED

Maybe you are looking for

  • How can I load a bitmap picture to a GUI dynamically?

    Hi, I would like to load bitmap pictures of waveforms (4x2 inches) to the GUI as each waveform is invoked by the operator randomly. I tried picture control VIs, it did not work. I must be making some mistake in my code. I need a sample code example/e

  • Plugging headphones into my Mini disconnects my ATV from Netflx

    On my LAN, I have an ATV Gen2 (wifi to the LAN), an AEB connected to the router on the wired LAN, and a Mini (model 4,1) that's wired to the LAN and runs iTunes, it's the media server thingy.  There are a couple of MacBooks on the wifi LAN, but they

  • Flash 10 movie cannot Firefox 3

    Hello All, my web site http://www.aykandogac.com/ada/index.html to top menu is flash but cannot play Firefox 3. ie and chrome is ok. but firefox 3 is not runnig. please look my flash code. thank you all..

  • How to quit an app from dock that will not quit!

    I wanted to turn off my computer, but it asked me to quit mail. So i try to quit mail and it will not quit. Then i tried dragging it into trash, and onto the dock to get deleted but that would not work either. It won't delete or quit anywhere. And wh

  • My HP Officejet 7500 E910 will not print in the center of the page.

    Trying to print from AutoCad on 17 x 11 A3 paper, the print is in the upper left corner and I'm not sure which program is at fault. AutoCad seems to understand the print needs to be offset, but the printer isn't in agreement. This question was solved