I require anyones help to extract string from an html tag

I wanted to extract the strings available in the tag named html
eg.. <html> Hello </html>
I require to extract the string Hello into a string variable without using if's
Secondly,
i require to extract the name of form in the html tag ..
eg.. <form name= 'basic'> </form>
Can any one tell how can this be implemented efficiently.. and using wich concept can this be implemented easily..
Thanking you,
bye..
ur's True friend

Use a ParserCallback. It notifies you everytime it finds a new tag:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=623365
Or use the HTMLEditorKit to parse the HTML. Then use an iterator to get the tag you need. See reply 5:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=655038

Similar Messages

  • Need help in extracting value from an xml tag.

    Hi ALL,
    Good Morning to all, i have problem in fetching a value from a xml tag. I have created a xml schema based on the schema i have created a xmltype table and inserted a value to the table. When i am trying to fetch a value from a particular tag i am unable to do so.. Kindly help me to solve this. Here by i am posting all the workings i have done...
    I am using the following client:
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ////////////////////////////////// XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/chipsxml.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/chipsxml.xsd"
    xmlns:samp="http://www.oradev.com/chipsxml.xsd"
    version="1.0">
    <element name="Field1">
    <complexType>
    <sequence>
         <element name="UTI">
              <complexType>
              <sequence>
              <element name = "U01" type = "string"/>
              <element name = "U02" type = "string"/>
              <element name = "U03" type = "string"/>
              <element name = "U03a" type = "string"/>
              <element name = "U03b" type = "string"/>          
              <element name = "U03c" type = "string"/>          
              <element name = "U04" type = "string"/>                    
              <element name = "U05" type = "string"/>                    
              </sequence>
              </complexType>
         </element>
    </sequence>
    </complexType>
    </element>
    </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    ////////////////////////// Table which has multiple Column //////////////////////////
    CREATE TABLE chipsxmltable1 (
    id number, XMLDATA XmlType)
    XMLTYPE XMLDATA STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oradev.com/chipsxml.xsd"
    ELEMENT "Field1";
    ///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
    INSERT INTO chipsxmltable VALUES(
    xmltype.createxml('<?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd" >
    <UTI>
    <U01>No</U01>
    <U02>Y</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>     
    <U04>Y</U04>
    <U05>Y</U05>          
    </UTI>
    </samp:Field1>'));
    To show the data as a field with structure:
    1. Query:
    Select * from chipsxmltable1;
    Output:
    ID XMLDATA
    1 <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    2. Query: (Both the query displays the same Output)
         SELECT X.xmldata.getClobVal() "XMLDATA" FROM chipsxmltable1 X;
         select extract(XMLDATA, '/Field1').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    XMLDATA
    <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    To show the data as a single string without structure using "getstringval()":
    3. Query
         select extract(XMLDATA, '//text()').getstringval() "CHIPS - XML" from chipsxmltable1 x;
    OUtput:
    CHIPS - XML
    NoNoYYYYYY
    To show the data as a single string without structure using "getclobval()":
    4.Query
         select extract(XMLDATA, '//text()').getClobVal() "CHIPS - XML" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    NoNoYYYYYY
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACT" function:
    6.Query:
         select extract(XMLDATA, '/Field1/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    The above queries are not fetching the value.
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACTVALUE" function:
    7. Query:
         select extractValue(XMLDATA, '/Field1/UTI') "XMLDATA" from chipsxmltable1 x;
         select extractValue(XMLDATA, '/Field1/UTI/U01') "XMLDATA" from chipsxmltable1 x;
    Output:
    X
    The above queries are not fetching the value.
    My question is:
    How to fetch values from xml tag when the value are inserted through xml schema?
    Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
    Very best regards,
    Godwin Jebakumar C.V.

    Hi,
    You need to declare the namespace of each element used in the XPath expression, like this :
    SQL> select extractvalue( XMLDATA
      2                     , '/samp:Field1/UTI/U01'
      3                     , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"' ) "XMLDATA"
      4  from chipsxmltable1 x
      5  ;
    XMLDATA
    No
    SQL> select extract( XMLDATA
      2                , '/samp:Field1/UTI'
      3                , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"'
      4                ).getstringval() "XMLDATA"
      5  from chipsxmltable1 x
      6  ;
    XMLDATA
    <UTI>
      <U01>No</U01>
      <U02>Y</U02>
      <U03>Y</U03>
      <U03a>Y</U03a>
      <U03b>Y</U03b>
      <U03c>Y</U03c>
      <U04>Y</U04>
      <U05>Y</U05>
    </UTI>
    Please see EXTRACT and EXTRACTVALUE documentation :
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions051.htm#i1006712
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions052.htm#SQLRF06173
    BTW, "XMLDATA" is a pseudo-column used by Oracle. I don't know if it'll ever cause any conflict but maybe you should rename your column.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns010.htm#SQLRF00256
    Regards.

  • Can anyone help me sync calendars from my iPhone to my Mac and help me figure out how to edit or delete lists in Reminders?

    Can anyone help me sync calendars from my iPhone to my Mac and help me figure out how to edit or delete lists in Reminders?  I thought upgrading to Mountain Lion would work, but I'm having the same problem as before under Snow Leopard.  So, here's my situation. 
    I'm running 10.8.2 on a Macbook Pro.  I have a 3GS iPhone running 6.0.1.  I can make entries on my Mac Calendar and they will show up on my iPhone, but if I make an entry on my iPhone, it never makes it to my Mac.  Also, I notice that when I log in to my iCloud account on my Mac, it has a "me.com" email address as my apple i.d., but it is not my primary account i.d. and I can't figure out how to delete it.  Also, my Reminders application won't allow me to delete lists I created.  Contacts, on the other hand, work instantaneously regardless of where the change is initiated.

    On you iPhone check Settings>Mail,Contacts,Calendars>Default Calendar (in the calendars section).  Here be sure you have selected the Calendar listed under your iCloud account ID as your default.  If you haven't, make this change, then enter a new event on your phone and see if it syncs properly now.
    You should be able to delete you reminders list by, from the Lists view, tapping Edit at the top, then tapping next to the list you want to delete and tapping Delete.

  • Can anyone help me move video from Sony HDR-XR550 to ipad 3gs via camera connector kit?

    Can anyone help me move video from a Sony HDR-XR550 to ipad 3g via camera connector kit?

    You can use iPhoto for the import. iLife apps are integrated. From within iMovie you have direct access to iTunes for adding music, and iPhoto for photos and videos in the iPhoto library.
    Or you can use the Image Capture application for the import if you prefer placing such imports into manually created folders and not using iPhoto.

  • Extracting strings from binary data

    Hello,
    I am trying to extract string from a binary file.
    At the unix command line (sunos) I can just type;
    strings <filename>
    This is a nice way to get a list of the contents of a directory.
    Is there a way in pl/sql to extract strings from binary data ? An equiv to strings on unix/linux ?
    Thanks in advance.
    Ben

    Hi,
    If you do want to list the contents of a directory, there are other ways to do it. Here's a base implementation of a utility I wrote:
    create or replace and resolve java source named "Util" as
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    public class Util {
        public static void listFiles(String directory, oracle.sql.ARRAY[] names)
            throws IOException, SQLException {
            File f = new File(directory);
            if(f==null)
                throw new IOException("Directory: "+directory+" does not exist.");
            String[] files = f.list(
                new FilenameFilter() {
                    public boolean accept(File dir, String name) {
                        // List all files
                        return true;
            Connection conn = new OracleDriver().defaultConnection();
            ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("VC_TAB_TYPE", conn);
            names[0] = new ARRAY(descriptor, conn, files);
            return;
    create or replace type vc_tab_type is table of varchar2(255);
    create or replace package util authid current_user as
        function list_files(p_directory in varchar2)
            return vc_tab_type;
    end;
    create or replace package body util as
        procedure list_files (
            p_directory in varchar2
            , p_filenames out nocopy vc_tab_type
        is
        language java
        name 'Util.listFiles(java.lang.String, oracle.sql.ARRAY[])';
        function list_files(p_directory in varchar2) return vc_tab_type
        is
            l_filenames vc_tab_type := vc_tab_type();
        begin
            list_files(p_directory, l_filenames);
            return l_filenames;
        end;
    end;
    /You can then query the filesystem as follows:
      1  select column_value as filename
      2  from table(util.list_files('c:\windows'))
      3  where column_value like '%.log'
      4* and rownum <= 10
    SQL> /
    FILENAME
    0.log
    AdfsOcm.log
    aspnetocm.log
    bkupinst.log
    certocm.log
    chipset.log
    cmsetacl.log
    comsetup.log
    DtcInstall.log
    FaxSetup.log
    10 rows selected.cheers,
    Anthony

  • Every time I turn on my laptop about half a dozen previous documents open up and I have to close them before I can begin. Can anyone help me prevent this from happening as it's driving me nuts!

    Every time I turn on my laptop about half a dozen previous documents open up and I have to close them before I can begin. Can anyone help me prevent this from happening as it's driving me nuts!

    First thing to (un)check:
    When you shutdown/restart, there's a dialog box which confirms your request. In that box is a little checkbox which you should uncheck.
    charlie

  • Mac starts up by itself at 1 am some nights... Can anyone help me stop this from happening based on reading my system log messages?

    My Mac starts itself automatically around 1:00 am about ever other night. I don't want it to do that. I had a backup program installed once that was set to do the backup at that time, but I have long since uninstalled that program. Yet the computer still powers on automatically. I checked in the control panels and don't see it set to do that. I used the Console program to check my log, but I don't know how to read what it says. Here are the log messages from the last time the computer started itself automatically:
    Sep 16 00:58:00 tio-E kernel[0]: System Sleep
    Sep 16 00:58:00 tio-E kernel[0]: Enabling XMM register save/restore and SSE/SSE2 opcodes
    Sep 16 00:58:00 tio-E kernel[0]: Started CPU 01
    Sep 16 00:58:00 tio-E kernel[0]: IOBluetoothHCIController::restartShutdownWL this is a wake from sleep
    Sep 16 00:58:00 tio-E kernel[0]: System Wake
    Sep 16 00:58:09 tio-E lookupd[213]: lookupd (version 369.8) starting - Mon Sep 16 00:58:09 2013
    Sep 16 00:58:09 tio-E configd[37]: rtmsg: error writing to routing socket
    Sep 16 00:58:26 tio-E /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Could not find "CPL" on any channel (directed scan)
    Sep 16 00:58:26 tio-E /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Could not find "CPL" on channel(s) 6
    Sep 16 00:58:37 tio-E /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Could not find "default" on any channel (directed scan)
    Sep 16 00:58:37 tio-E /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Could not find "default" on channel(s) 6
    Sep 16 00:58:40 tio-E kernel[0]: WLC_E_COUNTRY_CODE_CHANGED
    Sep 16 00:58:40 tio-E kernel[0]: en1: 802.11d country code set to 'US'.
    Sep 16 00:58:40 tio-E kernel[0]: en1: Supported channels 1 2 3 4 5 6 7 8 9 10 11 5 6 7 8 9 10 11 1 2 3 4 5 6 7 36 40 44 48 52 56 60 64 149 153 157 161 165 40 48 56 64 153 161 36 44 52 60 149 157
    Sep 16 00:58:41 tio-E kernel[0]: MAC AUTH succeeded
    Sep 16 00:58:45 tio-E configd[37]: posting notification com.apple.system.config.network_change
    Sep 16 00:58:45 tio-E lookupd[218]: lookupd (version 369.8) starting - Mon Sep 16 00:58:45 2013
    Can anyone help me get to the root of this problem?

    Hi Edwardo,
    Perhaps there's remnants of that App you're not aware of... what was it?
    One way to test is to Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, Test for problem in Safe Mode...
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive
    Reboot, test again.
    If it only does it in Regular Boot, then it could be some hardware problem like Video card, (Quartz is turned off in Safe Mode), or Airport, or some USB or Firewire device, or 3rd party add-on, Check System Preferences>Accounts (Users & Groups in later OSX versions)>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Also look in these if they exist, some are invisible...
    /private/var/run/StartupItems
    /Library/StartupItems
    /System/Library/StartupItems
    /System/Library/LaunchDaemons
    /Library/LaunchDaemons

  • Anyone tried this - Extract data from HANA Live reuse views into BW?

    Hello Experts,
    I've read from this blog http://scn.sap.com/community/bw-hana/blog/2014/05/26/go-hybrid--sap-hana-live-sap-bw-data-integration that this scenario
    > "Loading of data into BW using Reuse Layer of SAP HANA Live as data source (Extract data from HANA Live reuse views into BW)" is possible.
    Does anyone has a step by step guide on how to do this? Can you please share?
    Regards,
    DaSaint

    Hi DaSaint,
    best to check the online documentation
    Notes about transferring data from SAP HANA using ODP - Modeling - SAP Library
    Best regards,
    Andreas

  • Can anyone help with reverse String?

    Hi, Can anyone help me in reversing the string?
    here is Code but it doesn't work well. it just give me the starting word of string.
    public class stringrev {
              //construct String
    private String str;          
    public String reverse (String str) {
    int len =str.length();
              if (len <=1)
              return str;
         String s1= str.substring(0,len-1);     
         return reverse(s1);
    public static void main (String [] args)     {
              stringrev str = new stringrev ();
              String reverse = str.reverse ("jinux 2000");
              System.out.println("Reversed String " +" " + reversed );
    }          

    haven't tested it, but the idea should be ok:
    public String reverseString(String s)
         String t = "";
         for(int i=s.length()-1;i>=0;i--)
              t += s.substring(i,i+1);
         return t;
    }tobias

  • TA26677 Can anyone help with transfering purchases from itunes to my ipod classic

    I have a classic ipod Model MA146LL with version 1.3 on it and cannot get my purchases from itunes to transfer to the device. itunes looks different and I cannot find how to sync from my computer to itunes. Can anyone help me out with this.

    Click here and follow the instructions; the procedure is the same on Windows.
    (79810)

  • Can anyone help with uploading photos from iPad to Facebook.  Thanks

    Can anyone help with uploading photos fom iPad to Facebook?  Thanks

    What app are you to trying to use ? You can't upload photos to Facebook via Safari, but a number of the Facebook apps support it e.g. the 'official' app : http://itunes.apple.com/us/app/facebook/id284882215?mt=8 (thought it's optimised for the iPhone/iPod Touch it does support uploading photos), Friendly For Facebook (http://itunes.apple.com/us/app/friendly-for-facebook/id400169658?mt=8)

  • Tools for extracting strings from java code for internationalization

    For legacy code with lots and lots of strings what method is typically used to extract strings for internationalization?
    Am I right in thinking you couldnt simply grep for strings, it could get pretty complitcated, especially with escape characters, escaped quotes etc.,
    -SK

    When dealing with legacy code, it is nice to have an application that queries you as it extracts the strings. You have a choice whether to accept the string as a localizable entity or not.
    There are several tools that do this...including some IDEs like JBuilder. Although it isn't a fully supported or robust tool, Sun has a utility for extracting strings in Java source files:
    http://java.sun.com/products/jilkit/.
    Regards,
    John O'Conner

  • Extract text file with HTML tags from JTextPane

    hello world
    I have a big problem !
    I am creating an applet with a JTextPane ...
    so I can write text, (bold, italic etc), i can insert images.
    Now i want to create a text file with all the HTML tags
    corresponding to what I wrote in my JTextPane.
    I want to have and save the HTML file corresponding to what i wrote ...
    Is it possible ? Help me please ....
    Jeremie

    writing to a file from an applet is going to take a fair amount of work on your part.
    in order to write to a file from your applet, you have to use servlets or jsp to write to a file on your server. if you wish to write locally, look into signing your applet or policy settings of your browser.
    for writing to a file to the server, i suggest you look into servlets and tomcat to run the servlets.
    i just finished a project that used servlets and they take some time to figure out, but its definitely worth your time.
    here are some websites...
    http://www.j-nine.com/pubs/applet2servlet/Applet2Servlet.html
    http://jakarta.apache.org
    other websites have tutorials that you can look at too
    Andy

  • Method to Format a string column containing HTML tags as simple string.

    Hello,
    I am working with formating a string column which holds Html tags.
    I want to remove these tags from the actual data which has to be shown on the BI Publisher report.
    Can you suggest how can we format this in the DataSet designer of BI publisher so that my data is recognised on the Layout designer.
    I have been trying to create an expression using the "Add Element by Expression" option to format this html tag data as normal string without the tags.
    Can you suggest if this is the correct method to do this.
    I found this below code being used in an existing DateSet but i am not able to recreate a similar formating on this kind of data column.
    <![CDATA' || '['|| TO_CLOB(SUCCESS_CRITERIA) || ']' || ']>
    Kindly suggest if you have any idea on the above mentioned issue.
    Thanks,
    Shweta

    And read this:
    Navigate yourself around pitfalls related to the Runtime.exec() method
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Extracting string from a file name

    Hello,
    I have a legacy (read: I didn't build it) SharePoint list  that includes some validation when uploading files that's giving me some trouble.
    Basically, our users are required to add files to a list in a certain filename format and based on the naming convention are approved/rejected and routed to the appropriate location.
    One of the validations looks at a section of the file name and compares it to a folder name in the library.
    For example, the file name format is XX_AAA_999_2014_05.xlsx and that matches on the folder name of /submissions/2014_05
    Currently the rule says look at the last 7 characters of the folder and the 7 characters starting at position 12 of the filename and make sure they match.
    The problem is the 999 in the example above is a sequential identifier to the project a file is associated with... e.g. they range from project 000 to project 999. We've now hit project 1000 so file being added for project 1000 (and beyond) fails because
    the starting position has shifted one spot. (Note: we have active 3 digit projects so I cannot simply change that to be position 13... not to mention what that does to my history).
    So, my task is to come up with something that can accomodate 3 or 4 digit numbers.
    I'm trying to stick as closely to the original setup so I don't mess up the history so I'm looking at other methods of getting to the same data in the string.  Another problem is that the file names include the extension and the extension can be 3 (pdf)
    or 4 (xlsx) characters long.
    I've tried this:  =LEFT([Source File Name],SEARCH(".",[Source File Name])-1)
    but that brings back everything in front of the period and I need just the 7 preceeding characters.  Is there a way to limit the number of chars a LEFT() function returns?
    In a nutshell, the 4 variations of file names are as follows of which I need to extract the
    bolded section.:
    ZZ_AAA_999_2014_05.xls
    ZZ_AAA_999_2014_05.xlsx
    ZZ_AAA_1000_2014_05.xls
    ZZ_AAA_1000_2014_05.xlsx
    Thanks!
    Kevin

    Hi,
    According to your description, you might want to retrieve the string “2014_05” from the file name.
    I would suggest you create a SharePoint Designer workflow and implement your logic of handling the filename.
    In SharePoint Designer 2010, there are already some useful utility workflow actions which can enable users to deal with the various requirements come from the business scenarios.
    For the string handling, you can consider to use the
    Utility Actions:
    http://msdn.microsoft.com/en-us/library/office/jj164026(v=office.15).aspx
    Another two links about creating SharePoint Designer workflow for your reference:
    http://office.microsoft.com/en-001/sharepoint-designer-help/introduction-to-designing-and-customizing-workflows-HA101859249.aspx
    http://www.codeproject.com/Tips/415107/Create-a-Workflow-using-SharePoint-Designer
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Ipod Stuck in "boot Loop" and itunes says I'm not connected to the internet.

    Aright well I'm having a huge problem fixing my ipod.    Let's start at the beginning, i wanted to put new music onto my ipod but itunes wasn't detecting my ipod, it said i have to restore my ipod to factory settings, so i manually did it from the ip

  • IPhone 3GS  OS 4.0.1 - *****! ruing completely my iPhone User Experience

    I just upgraded my iPhone 3GS to the new 4.0.1 OS why ? because Apple says in their site "its great". No one ever told me its going to slow my iPhone performance significantly. No one ever told me its going to consume my battery so fast, I couldn't l

  • Restriction of banks to business area in F110

    We have the following requirement. We have multiple business areas in vendor line item level & we restrict vendor open items to a particular business area when making payments (T-code F110) by using the "Free Selection" tab. Also we have assigned the

  • How to convert a csv file into excel report?

    Hello, I have a csv file, can any body help me how to convert it into an excel report. thanks in advance vakvarma

  • Connecting a MAC

    I have no problem connecting my laptop to my wireless network, but when I try to connect our mac to it, it says there is a problem connecting to the network.  Is there a setting I need to change on the router or is the problem with the Mac?  My route