How to extract a tags content using DOMParser in PL/SQL

The structure of my xml-document is as below:
<Reply>
<Errors>
<Error Number="0">No Error Occured</Error>
</Errors>
</Reply>
Using DOMParser in PL/SQL iam able to extract the value associated with the 'Number' attribute in the <Error> tag, but i am unable to extract the text (error message => "No Error Occured") embedded in the <Error> tag.
How should i go about? Provide any hints, if possible sample code.
Thanks in Advance.
RamPrasad.

In order to get the text, you need to check the child node, as the text really lives by itself.
For example I modified the DOMSAMPLE to dislay the text not just the attributes. I have included the code below.
I hope that this helps you.
for i in 0..len-1 loop
n := xmldom.item(nl, i);
dbms_output.put(xmldom.getNodeName(n) || ' ');
n := xmldom.getfirstchild(n);
IF xmldom.getnodetype(n) = xmldom.Text_Node THEN
v_val := xmldom.getnodevalue(n);
dbms_output.put_line(v_val);
END IF;
end loop;
I really think that the XML tools in Oracle would be much more useful, is they were accompanied by complete documentation.
The structure of my xml-document is as below:
<Reply>
<Errors>
<Error Number="0">No Error Occured</Error>
</Errors>
</Reply>
Using DOMParser in PL/SQL iam able to extract the value associated with the 'Number' attribute in the <Error> tag, but i am unable to extract the text (error message => "No Error Occured") embedded in the <Error> tag.
How should i go about? Provide any hints, if possible sample code.
Thanks in Advance.
RamPrasad.

Similar Messages

  • How to extract a tagged string using XML in sql server 2014?

    A column stores the string data with tag as below.I have to retrieve the value of ATRB_C1 as val1234 through xml
    Query:
    CREATE TABLE #test (col varchar(500))
    INSERT INTO #test VALUES('< ATRB_C value ="val1" />< ATRB_C1 value ="val234" />')
    SELECT * FROM  #test FOR XML RAW
    Output:
    <row col="&lt; ATRB_C value =&quot;val1&quot; /&gt;&lt; ATRB_C1 value =&quot;val234&quot; /&gt;" />
    Since the format is incorrect, not able to extract using xml.value
    Any help would be appreciated!!

    CREATE TABLE #test (col xml)
    INSERT INTO #test(col) VALUES('<ATRB_C value ="val1"/><ATRB_C1 value ="val234" />')
    SELECT * FROM #test
    Select Col1.value('(@value)[1]','varchar(20)') as [tab1_col1],col2.value('(@value)[1]','varchar(20)') as [tab2_col2]
    from #test cross apply col.nodes('/ATRB_C') as tab1(col1)
    cross apply col.nodes('/ATRB_C1') as tab2(col2)
    drop table #test
    Hope it Helps!!

  • How to extract HTML table contents

    Does someone know how to extract HTML table contents? I want to download a html file which contains table from internet and extract the table contents. Finally, insert the table contents into database.

    To do this you have to user a Parser to parse your html file and retrieve the information you want.
    Please have a look at the following classes:
    HTMLEditorKit.ParserCallback
    ParserDelegator()
    Here is an example which retrives the FRAMSET src of an html file. The purpose here is to find if the html file describes a multi-frame page or not. If so it add the frame src name to a Vector
    HTMLEditorKit.ParserCallback callback =
    new HTMLEditorKit.ParserCallback() {                      public void handleSimpleTag(HTML.Tag t,      MutableAttributeSet a, int pos)
         if (t.equals(HTML.Tag.FRAME))
    {                                          Logger.debug(this, "Frame tag found in "+f.getURL());                      Enumeration e = a.getAttributeNames();
    while (e.hasMoreElements())
                             Object name = e.nextElement();
                             if (name.toString().equals("src"))
                                  Object ob = a.getAttribute(name);                     
                                  Logger.debug("found an src "+ob);
                                  currentFrameSrc.add(new String(ob.toString()));
                   Reader reader = new FileReader(aFile);
                        new ParserDelegator().parse(reader, callback, false);
    It's not clean but I hope it will help :-)
    Stephane

  • How to extract xml tag name contains dashes

     
    Hi, How to parse XML file to extract root tag contains dashes in Flex,for example
    XML Input is: <regular-body>Text of my post...</regular-body>
    expected output is : regular-body
    I appreciate any of your suggestions or inputs

    Do you want to get the name of the XML ELEMENT regular-body, or the value in the XML file "Text of my post...".
    If its the latter, then you could use the bracket/quote notation for extracting the value, like in the following example:
    image = xmlWeather[0]..parameters["conditions-icon"]["icon-link"][idx]
    I use this when parsing weather information from a 3rd party in which their XML is loaded with dashes.
    If you are looking to get the actual element name, not sure how to do that.  I would think that if you are using an XML file, you would have at least the high level element known.

  • How to extract original file contents from content server

    Hi,
    1)How can we extract original file contents from the content server (which in our case is SAP database itself)...
    2)What exactly is PHIO_ID and LOIO_ID?
    Thanks and regards,
    Santhosh Kumar U.P

    Hi,
    concerning your first question - please decribe, what you are trying to do.
    Question 2:
    LOIO_ID is the ID of the Logical Information Object. A LOIO is not a real document, but kind of a virtual document, a containerfor all "real" versions of a document. A PHIO (physical info object) is a real document.
    you can read more at http://sercie.sap.com/Kpro
    Kind regards,
    Carl

  • How to display html tags content in flex

    hi all,
    It would be great if any one can lead me to a tutorial of
    integrating html tags content in flex. Actulay i have to insert and
    series to table in flex
    thanks

    The Flash Player has a very limited number of HTML tags it
    can handle - table is not one of them. Since Flex is just a way to
    build Flash Player content you are limited by what the Flash Player
    can do.
    We don't supply a full browser/HTML rendering engine in the
    Flash Player because it would make the Flash Player a
    multi-megabyte download (eg, 11-12 MBytes); right now the Player
    has a small footprint which enables it to be downloaded by
    virtually everyone.
    The Adobe AIR player (see labs.adobe.com) does have a full
    HTML component and can run Flex programs. The caveat is that the
    apps are not run in the browser, but on the local machine. The
    end-user has to download the AIR player in order to use it.
    You can also check out Alex's blog (
    http://blogs.adobe.com/aharui/)
    and scroll down to "HTML and Flex"

  • How to read repeated tag values using sql query

    Database version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Question
    How to get repeated tag values?
    <TXLife>
    <TXLifeRequest>
    <TransRefGUID>10bc80e7d60e59b0:a134d0:10d7c4674ad:-7ffd</TransRefGUID>
    <TransType tc="1203">OLI_TRANS_TRNHLD</TransType>
    <TransExeDate>2011-02-27</TransExeDate>
    <TransExeTime>15:06:35</TransExeTime>
    <InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
    <InquiryView>
    <InquiryViewCode>PLANUPDATE_CHBM_1203A</InquiryViewCode>
    </InquiryView>
    <OLifE>
    <SourceInfo>
    <SourceInfoName>CHBM Admin Tool</SourceInfoName>
    </SourceInfo>
    <Activity id="Activity1" HoldingID="Holding1">
    <UserCode>User123</UserCode>
    <LastUpdate>2011-02-27</LastUpdate>
    <ActivityCode>CHBM10001</ActivityCode>
    <OLifEExtension VendorCode="0098" ExtensionCode="Activity">
    <ActivityExtension>
    <SubActivityCode>CHBM20002</SubActivityCode>
    <LastUpdateTime>15:06:35</LastUpdateTime>
    </ActivityExtension>
    </OLifEExtension>
    </Activity>
    <Holding id="Holding1">
    <HoldingTypeCode tc="6">Group Master Contract</HoldingTypeCode>
    <Purpose tc="36">Business Protection and Preservation</Purpose>
    <Policy>
    <CarrierAdminSystem>CHBM</CarrierAdminSystem>
    <PolNumber>CHB0001234</PolNumber>
    <OLifEExtension VendorCode="0098" ExtensionCode="Policy">
    <PolicyExtension>
    <BillingDetail>
    <PaymentMode tc="3">Quarterly</PaymentMode>
    <BillingOrder tc="1009800002">Employee ID</BillingOrder>
    </BillingDetail>
    <SalaryAllotment>12354333</SalaryAllotment>
    </PolicyExtension>
    </OLifEExtension>
    </Policy>
    <Attachment id="Attach1">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>System</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Event 4</Description>
    <AttachmentData>Event Log</AttachmentData>
    <AttachmentType tc="1009800001">Transaction Log</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>2</Sequence>
    <CreationTime>16:05:45</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    <Attachment id="Attach2">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>System</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Event 3</Description>
    <AttachmentData>Event Log</AttachmentData>
    <AttachmentType tc="1009800001">Transaction Log</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>1</Sequence>
    <CreationTime>16:01:54</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    <Attachment id="Attach3">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>P62350</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Note 2</Description>
    <AttachmentData>Enter notes on changes or edits to plan</AttachmentData>
    <AttachmentType tc="14">Note</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>2</Sequence>
    <CreationTime>16:02:23</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    </Holding>
    </OLifE>
    </TXLifeRequest>
    </TXLife>
    Expected output shoulb be like this
    Description AttachmentType AttachmentData
    Event 4 Transaction Log Event Log
    Event 3 Transaction Log Event Log
    Note 2 Note Enter notes on changes or edits to plan
    Please help me any one on this
    Edited by: LRAJESH on Apr 20, 2011 8:27 AM

    SELECT
    t2. Description des,
    t2.AttachmentType attty,
    t2.DateCreated DateCreated,
    t2.UserCode UserCode,
    t1.Planid Planid,
    t2.createdtime,
    t1.Ausercode Ausercode
    FROM (
    SELECT xData doc
    FROM dual
    ) temp_table,
    XMLTable ( '/TXLife/TXLifeRequest/OLifE' passing doc
    COLUMNS
    Planid varchar2(20) path 'Holding/Policy/PolNumber',
    AttachmentType xmltype path 'Holding//Attachment' ,
    Ausercode varchar2(20) path 'Activity/UserCode'
    ) t1,
    XMLTable
    '/Attachment'
    passing t1.AttachmentType
    columns
    Description varchar2(1000) path 'Description',
    AttachmentType varchar2(1000) path 'AttachmentType/@tc',
    DateCreated varchar2(20) path 'DateCreated',
    createdtime varchar2(20) path 'OLifEExtension/AttachmentExtension/CreationTime',
    UserCode varchar2(200) path 'UserCode'
    ) t2

  • How to Extract All KM Content?

    Hi experts,
    I would like to seek your advice how I can extract all the KM content in a readable format, outside of any SAP application. The SAP application will be decommissioned, but the requirement is to preserve any discussions and files that have been uploaded by users into KM, for their future reference.
    From my own research, I have only managed to find information on the ICE protocol, which can be used to perform a dump of all the data in KM, and then restored onto another server. However, this does not fit my requirements as content exported using ICE protocol will become XML files, and cannot be consumed in its original form (e.g. as plain text, or PDFs) until restored onto a SAP application server.
    I have provided some screenshots of the data I'm talking about.
    Thank you!
    Best regards,
    Kwong How

    Hi Steffi,
    Thanks for your reply!
    When you say "portal drive", do you mean to access the directories on the portal server drive (perhaps via Putty or FTP to the UNIX server)? Or are you referring to some virtual directory structure within the SAP Portal itself at the application level?
    Could you point me to any resources or screenshots where I can learn more about the creation of network sharing to the KM structure?
    For the discussion contents, I am guessing that they would be stored in some database table at the backend. Would you happen to have any idea what tables are used by KM? I was unable to find any results when searching for the info on Google.
    Thanks so much for your help!
    Best regards,
    Kwong How

  • How to extract the excel file using web dynapro

    Hi Expert,
       I want to know how to generate an excel file to extract the internal  data. Please give me your help.
      Thanks in advance.

    I think you you can use File download UI element. Refer following link for more info:
    [FileDownload|http://help.sap.com/saphelp_tm60/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    Regards,
    Saket

  • How to Extract the Business content Master Data

    Hello,
    I activated  Master Data Business content  0NOTIFICATION_ATTR and 0NOTIFICATION_TEXT on ECC6.0. these are belongs to "Quality Management Master Data"
    How to fill the data right now it had 0 records
    Do we need to fill the setup tables?
    Thanks

    hi roshan,
    if u r loading from a flat file ,do follow thw below steps
    Uploading of master data
    Log on to your SAP
    Transaction code RSA1u2014LEAD YOU TO MODELLING
    1. Creation of Info Objects
    u2022 In left panel select info object
    u2022 Create info area
    u2022 Create info object catalog ( characteristics & Key figures ) by right clicking the created info area
    u2022 Create new characteristics and key figures under respective catalogs according to the project requirement
    u2022 Create required info objects and Activate.
    2. Creation of Data Source
    u2022 In the left panel select data sources
    u2022 Create application component(AC)
    u2022 Right click AC and create datasource
    u2022 Specify data source name, source system, and data type ( master data attributes, text, hierarchies)
    u2022 In general tab give short, medium, and long description.
    u2022 In extraction tab specify file path, header rows to be ignored, data format(csv) and data separator( , )
    u2022 In proposal tab load example data and verify it.
    u2022 In field tab you can you can give the technical name of info objects in the template and you not have to map during the transformation the server will automatically map accordingly. If you are not mapping in this field tab you have to manually map during the transformation in Info providers.
    u2022 Activate data source and read preview data under preview tab.
    u2022 Create info package by right clicking data source and in schedule tab click star to load data to PSA.( make sure to close the flat file during loading )
    3. Creation of data targets
    u2022 In left panel select info provider
    u2022 Select created info area and right click to select Insert Characteristics as info provider
    u2022 Select required info object ( Ex : Employee ID)
    u2022 Under that info object select attributes
    u2022 Right click on attributes and select create transformation.
    u2022 In source of transformation , select object type( data source) and specify its name and source system Note: Source system will be a temporary folder or package into which data is getting stored
    u2022 Activate created transformation
    u2022 Create Data transfer process (DTP) by right clicking the master data attributes
    u2022 In extraction tab specify extraction mode ( full)
    u2022 In update tab specify error handling ( request green)
    u2022 Activate DTP and in execute tab click execute button to load data in data targets.
    4. Monitor
    Right Click data targets and select manage and in contents tab select contents to view the loaded data. Alternatively monitor icon can be used.
    Regards
    Ani

  • How to Extract Paragraph from Pdf using Adobe Pdf Library in C# or Java

    By Using This library I extracted Content of Pdf File.
    I got Content Line by Line(by using Last wordOnline )
    <Line> Content </Line>
    But I want to Extract Content Paragraph by Paragraph Like
    <Paragrph> Content </paragraph>

    Thanks for reply.
    Here I have used "Y" co -ordinate of line to find paragraph.But I can not get expected Output.
    Can you please explain me the logic of Find paragraph usnig Co-ordinates.?
    Here I am pasting my Code.
                    double PreY2=0;
                    double   Result2=0;
                    foreach (DataRow oRow in dtLineMaster.Rows)
                              double Result1 = Math.Round(PreY2 - Convert.ToDouble(oRow["Y2"].ToString()));
                         if (Result1 > Result2)
                            MessageBox.Show("" + oRow["LineText"].ToString());
                            Result2 = Result1;
                    PreY2 = Convert.ToDouble(oRow["Y2"].ToString());
    I have already extracted Pdf file in databse with lineId and X and Y co-ordinates.On this I am  implementing above code.

  • How to extract the data by using function module?

    hi experts,
    what are the steps i have to fallow to extract the data from R/3 by using FUNCTION MODULE.
    thanks & regards
    venkat

    Hi,
    Extracting data from R/3 extract structure thru function modules
    You can proceed with create function module using SE37, thereu2019s sample in system RSAX_BIW_GET_DATA_SIMPLE,
    You need to know the logic how to populate the structure,
    after that RSO2, create datasource specify extract structure and
    function module,
    activate and replicate to bw.
    Chheers
    Raj

  • How to extract Subtitles from DVD using Snow Leopard?

    Hey there,
    this may be off-topic, but I don't know where to ask. Anyone know how I can extract Subtitltes and create an .srt File from a Movie DVD using Snow Leopard?

    I too have been looking diligently for something I can use to glean .srt files from DVD's.  Secondarily, .sub/.idx files.  I didn't quite realize how much software would be made useless by my shift to Lion.  Amazing amounts!
    Is there any other product, commercial or otherwise that is known to accomplish this task?
    If one is found, please update the discussion here!  Thanks.
    -- Gerry

  • How to login and download content using the Dreamweaver FTP

    Hi ya,
    I'm fairly new to Dreamweaver, and currently working my way through tutorials.
    I have be given details for my company website and told to login via the Dreamweaver FTP and download all the files for Dreamweaver from there.
    The details I have been given are:
    IP Address
    User Name
    Password
    I have been looking in Dreamweaver as to where to type in this info. (Guessing its somewhere in the 'Manage Sites' tab), but can't seem to find the correct place to login.
    All the tutorials I find seem to be about how to upload through the FTP not download.
    How do I go about using the FTP details given to download the Dreamweaver content to manage my website?
    Thanks

    Which version of Dreaamweaveer?
    CS4
    http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WSBE25912D-A9DE-4ba1-9F85-4C692F5C14ADa .html
    CS5
    http://help.adobe.com/en_US/dreamweaver/cs/using/WSee8adad8a8c1990b-6cb1a36e1266d204f20-80 00.html#WS269BF2C1-74ED-4797-9D9D-6EC283FE7645a

  • How does apple TV cache content, + use with imac

    I am thinking about buying an apple TV, but have some questions
    -does the Apple TV only stream content in real time, or can it store content e.g If I want to watch a film with the family, can I download the full film to the apple tv in advance, or does it just stream in real time, with a buffer? I am slightly concerned about internet issues interrupting a film.
    -If I have an Itunes rental film on an Imac, I understand the Apple TV will stream it. Wont the film be the wrong size if its on the Imac e.g formatted for the Imac, but not a 720P TV? Will there be some loss of quality?

    Yes, the ATV2 only streams. It has an 8gb cache that stores the film as you watch it but you cannot use it as a hard-drive.
    I believe you can rent HD movies on the computer, albeit a more limited selection. Even so you won't have any format issues.

Maybe you are looking for