Parsing XML and HTML

Is there any way to parse a XML file and covert it to a result set using SQL and PLSQL?

Yes. Oracle SQL and PL/SQL can use the Oracle supplied XML Parser to create XML and to extract attributes and rows from XML.
Refer to [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14259/toc.htm]Oracle® XML DB Developer's Guide.

Similar Messages

  • Parsing XML and pulling out results rows only

    All,
    I need a bit of direction here, hopefully someone can help.
    Here is the situation..
    I have a Web Template that has the XML dataprovider only. Meaning, when I execute it, I get a blank screen because I am not using any other item. This is expected.
    The query works as designed and the XML data in the source of the web page is correct.
    Now, I want to be able to read (loop thru the XML data) and display the data in an HTML table for display to the end user. (Actually, I would like to only keep the "REsults Rows" from the XML data)
    Does anyone have any javascript/XSL/etc that takes the data from a web template, via the XML dataprovider function, and is able to process the data (XML data) and display as an HTML table on the same page?
    I am having a hard time finding any information on reading an XML dataset from the WAD and displaying it with any sort of success.
    I found lots of weblogs and threads about some similiar functionality, but it wasn't exactly what I was looking for.
    Here are some of the links I found..
    Re: XML Data Provider - Information
    I also found other threads from here, but none of them was exactly what I was looking for...(They were along the same lines as the first link!)
    I hope someone can help me out. Due points and my ever gratitude to whomever can help me on this one!
    Cheers!
    /smw

    1. Learn basic web service interfacing. The type of data is irrelevant.
    2. Learn how to parse XML.
    3. Learn how jdbc works.
    4. Learn how the protocol of your actual hosting company works.
    5. Put the above steps together to create your app.
    Steps 1, 2 and 3 are independent from each other.

  • Help for Parsing XML like HTML Document

    I have documents that start with
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    I want to process these documents with a XML Parser.Microsoft XML Parser works well with it.Can I use DOM parser in Java to process such kind of documents?
    What Jar file I need to use to access such APIs?

    Yes, XHTML is XML so you can read it with any XML parser.
    And Java already has XML parsers built in. You don't need any jar files.

  • Problem: FlashPlayer 10.1 XML and HTML-Entity Rendering problem

    Hi,
    I have some problems using
    childNode[0].nodeValue
    and HTML Entities since updating my FlashPlayer from version 10.0 to 10.1
    First some information about my system:
    FlashPlayer: WIN 10,1,53,64
    OS: WinXP (32bit)
    Browser: Firefox 3.6.6; IE 7.0.5730.13
    I am handling XML data which contains for example some HTML Entities like "&lt;" or "&gt;". A XML-Parser reads the nodeValue and puts the text into a HTML enabled textfield. Now FlashPlayer Version 10.1 does not display the text after "&lt".
    For example the following text in XML:
    <![CDATA[<ul><li>pressure &lt; 250bar</li>
    is rendered as "pressure". Debugging the application shows, that after getting the Text with
    childNode[0].nodeValue
    returns "pressure < 25bar" so HTML textfield interprets the "<" as a HTML Tag.
    Possible Workaround: Using
    <![CDATA[<ul><li>pressure %30C; 250bar</li>
    and replacing it after reading the nodeValue with "&lt;" solves the problem.
    Ist there any other solution without changing my XML Contents? Can I tell Flash or my XMLParser that HTML Tags must not be replaced?
    Thank's for any idea and help.

    Investigate the problem, but did not become easier.
    When calling external function used method "<invoke name="function" returntype="xml"><arguments><string>.....</string></arguments></invoke>" flashplayer remove from string value tag "CDATA".
    This is as in 10.0 player so and in 10.1.
    But after install 10.1 version string exposed decoding. All escape symbols convert to real char data.
    Example:
    "and WELL-FORMED&lt;/b&gt;&lt;/font&gt; HTML"
    =>
    "and WELL-FORMED</b></font> HTML"
    So as CDATA deleted is abnormal decoding XML data in the AS code.
    Who ever can help overcome this unnecessary effect?

  • PDF output does not refresh data in BI Publisher, XML and HTML do refresh

    I just upgraded to BI Publisher 10.1.3.4.0 and I noticed that the PDF format of the reports does not reflect recent changes in data, while XML data and HTML output do reflect changes in data immediately.
    I'm using BI Publisher to print APEX applications reports. When I change some data in APEX forms, I click again in the Print button and the data remains unchanged. I made some testing inside Oracle BI Publisher, and noticed that XML data and HTML output do reflect changes, but PDF output remains with the old data for some unknown amount of time. I cannot identify a method to force the PDF to refresh, just un-log and log in again several times until the data appears updated. This is serious because when users change data and print again, they expect the changes to be reflected in the new printable report, and may not notice that the data is the old version.
    OS is Oracle Enterprise Linux.
    Any help on this will be very welcome.
    Francisco

    Open the report in Edit Mode Click on the reports and in the properties section Uncheck the
    Enable Document Cache Property and your issue should be resolved.

  • Parsing XML and Storing values in instance variable

    hi,
    i'm new to XML.
    here i'm trying to parse an XML and store their element data to the instance variable.
    in my main method i'm tried to print the instance variable. but it shows "" (ie it print nothing ).
    i know the reason, its becas of the the endElement() event generated and it invokes the characters() and assigns "" to the instance variable.
    my main perspective is to store the element data in instance variable.
    thanks in advance.
    praks
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class mysax extends DefaultHandler
         String ctelement;
         CharArrayWriter contents;
         String vname1,vrcbreg1,vaddress1,vcountry1,vtelephone1,vfax1;
         String vname,vrcbreg,vaddress,vcountry,vtelephone,vfax;
         public mysax()
              vname1 = null;
              vrcbreg1 = null;
              vaddress1 = null;
              vcountry1 = null;
              vtelephone1 = null;
              vfax1 = null;
              contents= new CharArrayWriter();
         public void doparse(String url) throws Exception
              SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser sp = spf.newSAXParser();
    ParserAdapter pa = new ParserAdapter(sp.getParser());
    pa.setContentHandler(this);
    pa.parse(url);          
         public void startElement(String namespace,String localName,String qName,Attributes atts)
              ctelement = localName;     
         public void endElement(String uri,String localName,String qName) throws SAXException
         public void characters(char[] ch,int start, int length) throws SAXException
              try
                   if(ctelement.equals("name"))
                        vname = new String (ch,start,length);
                        System.out.println("The method "+vname1);
              }catch (Exception e)
                   System.out.println("The exception "+e);
         public static void main(String args[])
              try
              mysax ms = new mysax();
              ms.doparse(args[0]);
              System.out.println("the contents name "+ms.vname1);
              catch(Exception e)
                   System.out.println("this is exception at main" +e);
    my XML looks like
    <coyprofile_result>
    <company>     
    <name>abcTech</name>
    <rcbreg>123456789</rcbreg>
    <address>Singapore</address>
    <country>sg</country>
    <telephone>123456</telephone>
    <fax>123155</fax>
    </company>
    </coyprofile_result>

    I believe that the problem has to do with the value you assign to ctelement. You are assigning the value of localName to ctElement, however for the element: <name>...</name> the localname is empty string i.e. "", but qName equals "name". Because you are assigning empty string to ctElement, when you do the comparison in characters of ctElement to "name" it will always be false. So in startElement change it to ctElement = qName; Try it and see if it works. I have produced similar programs and it works for me.
    Hope this helps.

  • XML parser to parse XML inside HTML file

    Hi,
    I wish to know is there any other parsers apart from JAXP to parse xml content present inside HTML file. For example,
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    </head>
    <body>
    <form id="j_id_jsp_1394907664_1" name="j_id_jsp_1394907664_1" method="post" action="/msaiphoneportal1.1c/pages/xmlchech.faces;jsessionid=5666F0E1CF0E44B978940F021012AA41" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="j_id_jsp_1394907664_1" value="j_id_jsp_1394907664_1" />
    <?xml version="1.0" encoding="UTF-8"?>
    <hospital>
    <Users>
    <User id="1" password="x" type="staff" username="x"/>
    <User id="2" password="y" type="staff" username="y"/>
    <User id="3" password="z" type="staff" username="z"/>
    </Users>
    <Survey/>
    <Patients>staaatus</Patients>
    </hospital>
    <input type="hidden" name="j_id_jsp_1394907664_1:j_id_jsp_1394907664_2" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-4298162632826268059:-1507671971163298623" autocomplete="off" />
    </form>
    </body>
    </html>
    I need to read the XML content inside. Is there any way please let me know
    Edited by: DHURAI on Jul 22, 2010 12:59 AM

    DHURAI wrote:
    while reading, we can fetch the starting of XML through <?xml> tag, but how we know the ending of the XML as it seems to be dynamic.1) Extract the document root element which follows the <?xml ... ?>
    2) From this root element , construct the associated root element terminal by inserting a / after the <.
    3) Search for the terminal.
    If the root name can also be the name of an enclosed element then you will have to count the number of terminals.

  • Parse XML and Output to JSP page

    I have a number of XML documents which are all formatted in the same way, just with different information in the fields.
    I wish to parse the XML documents using DOM and output them to an XML page.
    How would i go about doing this?
    If you could write a small example or any websites that you think might help.
    Thanks.

    I have the parsing working but i cant seem to figure out how to get information out of the parsed document and into variables.
    This is a sample of my XML file
    <?xml version="1.0"?>
    <product code="QB-1226-AB">
         <productName>Professional Floodlights</productName>
         <description>PIR floodlights that are designed for professional installation. A faulty light requiring a return visit will cost far more than a quality light does in the first place. 3 year guarantee.</description>
         <price>120</price>
         <manufacturer>Black and Decker</manufacturer>
    </product>I can get the productCode value out without any problems using
    String name = attrs.getValue("code");
    But if i try the same for any of the others i get null. I can accomplish this using DOM easily but i cant find anything at all about getting values out of it using SAX.
    Any help would be greatly appreciated.

  • How to parse xml and import to execel

    pls let me know how to parse XML file and import all data to execel sheet.

    Hi Mandya,
    This is outside of the normal use case for TestStand. It would be best to use a code module (developed in LabVIEW, C, or any other language) to accomlish this and then call it from a step in TestStand. You can find examples on ActiveX here:
    http://forums.ni.com/t5/NI-TestStand/Controlling-Excel-from-TestStand-with-Activex-Automation/td-p/1...
    I hope this helps.
    Frank L.
    Software Product Manager
    National Instruments

  • How to parse XML and store the data in  tables using sql or plsql?

    I want to parse the xml
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xmlListWrapper>
        <size>2</size>
    <AppTypeID>10</AppTypeID>
    </xmlListWrapper>
    and store in a table
    |pk|apptypeid|
    1     10

    You can extract data from your XML along these lines...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select xmltype('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      2  <xmlListWrapper>
      3    <size>2</size>
      4    <AppTypeID>10</AppTypeID>
      5    <AppTypeID>20</AppTypeID>
      6  </xmlListWrapper>') as xml from dual)
      7  --
      8  -- end of example data
      9  --
    10  select x.*
    11  from   t
    12        ,xmltable('/xmlListWrapper/AppTypeID'
    13                  passing t.xml
    14                  columns pk for ordinality
    15                         ,apptypeid number path '.'
    16*                ) x
    SQL> /
            PK  APPTYPEID
             1         10
             2         20
    SQL>
    Inserting it to a table is obviously achieved using an INSERT ... SELECT ... where the SELECT is extracting the data from the XML.

  • Parsing XML with html tags for style

    I'm using flash to pull in XML data, but I want to use html
    tags to be able to style the text. When I add any html, it treats
    it as a sub-node and ignores the data. Also, line breaks in the xml
    are being converted to double spaced paragraphs? The relevant code
    is basically this:
    if (element.nodeName.toUpperCase() == "TEXT")
    {//add text to text array
    ar_text[s]=element.firstChild.nodeValue;
    textbox1.text = ar_text[0];

    try to use htmlText instead text... like this:
    textbox1.htmlText = ar_text[0]
    adam

  • Generating 2 test reports for the same test - XML and HTML

    Hi All,
    I have a special test requirement.
    Need to generate 2 test reports for the same test. One in HTML and the other in XML format.
    Is there any direct method for that?
    How it can be implemented?
    Thanks in advance.
    SajK

    Hi SajK,
    To accomplish this task, you will need to modify the process model. For example, if you are using the sequential process model, you can concentrate on the TestReport sequence call and the various report related steps in the Single Pass and Test UUTs sequences.
    The TestReport sequence (also a callback) relies on Parameters.ReportOptions.Format to decide which of the following sequences to use when generating the report:
    <TestStand>\Components\NI\Models\TestStandModels\reportgen_txt.seq
    <TestStand>\Components\NI\Models\TestStandModels\reportgen_html.seq
    <TestStand>\Components\NI\Models\TestStandModels\reportgen_xml.seq
    In your case, instead of choosing one of the sequences, you could hard code it to use both the html and xml sequences. Be aware that for this to work, you must also modify and/or duplicate most of the report related steps in the Single Pass and Test UUTs sequences. For instance, the Set Report Format step becomes unnecessary since you are hard-coding the report format. On the other hand, the Write UUT Report step needs to be duplicated, one step to write to an html file location, and another to write to the xml file location.
    Please note that modifying the process mode in this way will deprecate some of the settings in the report options dialog box (such as the report format). For more information on TestStand report generation, please refer to the following DevZone article:
    Report Generation Explained
    Regards,
    Message Edited by James M on 05-29-2007 03:08 PM

  • Render xml and html content type in single jsp

    I have 2 jsps, one jsp(a.jsp) is throwing content-type as HTML and other JSP(b.jsp) is throwing content-type as xml. I am making use of xsl to render the xml content in html format. But the problem is that i want to include b.jsp in a.jsp, and when i do so b.jsp doesn't make use of xsl for its rendering rather it displays the contents haphazardly.
    Plese help if somebody knows the solution.

    Below the following line ..
    <html:form action="addContact">Add this new form field..
    <html:hidden name="flag" value="0"/>Needless to say that this String variable flag should be defined in your ActionForm.
    Next, instead of ...
    <html:submit property="parameter"><bean:message key="ok.company" /></html:submit>Put this ...
    <input type="button" name="xyz" onClick="callSubmit(1);" value='<bean:message key="ok.company" />'>Then add a JS function as below ...
    <script>
    function callSubmit(flg)
         document.forms[0].flag.value=flg;
         document.forms[0].submit();
    </script>Finally in your ActionServlet, you need to find the value of the ActionForm variable flag via request.getParameter("flag").
    In case the value is set to 1, then it means that you need to send the particular row to DB. You may add additional flag values to correctly identify theparticular row which you may want to send to DB.
    Hope you got it.
    -Rohit

  • Would you put XML and HTML files stored in the database as files?

    Hi,
    Basically that is my question. My criteria is that I will be given some XML files, I need to save the XML file somewhere for future reference. However I also have to store when it was registered and so on.
    Would you install this in the database? Or you would just store the path where it is deployed?
    Regards,
    Sim085

    Hi,
    Basically that is my question. My criteria is that I
    will be given some XML files, I need to save the XML
    file somewhere for future reference. However I also
    have to store when it was registered and so on. So the XML won't be changing unless the registration date is updated?
    A file modification time could give you the same effect.
    Would you install this in the database? Or you would
    just store the path where it is deployed?I'd favor the latter for the sake of an argument.
    If you put it in the database, you wouldn't be able to query for the XML except by ID or registration date. Not much point in having it there.
    %

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

Maybe you are looking for

  • How to add a Field to the Result List in Activity

    Hello Experts ! We are on CRM 7.0. I want to add a field to the Result List of Activity (Component: BT126S_APPT / View: ApptSR). This field is the address of the "Employee Responsible". So, how can I add a field to the Result List? AET is not a relev

  • How to make an ibook a pdf file

    for an assessment i have to submit a pdf version of an ibook how to i turn an ibook into a pdf file so i can upload it

  • How to determine maximum field size?

    Hello! Here's my problem... I have a rather large CSV file which I have loaded into Numbers, but now i need to work out what the maximum size of each field is. There are far too many rows for me to just look through the CSV file (it's got a few hundr

  • Zen Vision:M 1.40 Firmware.. Probl

    I was really pleased to see the new f/w, and downloaded and installed it right away. But now, I regret it. There is a strange noise that really disturbs me when the volume is high. This wasn't an issue in the older f/w's. It happens on all tracks, al

  • BATE STAMPING

    I have a trial version of XI. I was able to add Bate Stamping to a PDF doc that I already had. But I was unable to remove the bate stamping. Error message said bate stamping was not placed by using acrobat but it was.