How do i iterate through this html document.

I trying to read in an html file which looks like this
<ID>1</ID>
<BODY>blah bal blah
blah bal blah.
</BODY>
<ID>5</ID>
<BODY>blah bal blah
blah bal blah.
</BODY>
<ID>7</ID>
<BODY>blah bal blah
blah bal blah.
</BODY>
Problem is i need to record the id numbers and do stuff with the text in the body.
So my final result should be one file with each id # followed by the manupulated text in each body. so far i cant find any examples on iterating through html docs.
...ANY IDEAS??
tx in advance :)

I used the tokens....
FileReader file = new FileReader("problemFile.txt");
StreamTokenizer inputStream = new StreamTokenizer(file);
// read into Vector caled vec.
int tokenType = inputStream.nextToken();
for(int index = 0; tokenType != StreamTokenizer.TT_EOF;)
AStrVarable = inputStream.sval;
if (name != null)//ommiting the numbers.numbers returns null for sval
vec.add(AStrVarable);
tokenType = inputStream.nextToken();
but this just treats the file as one big block. im need to loop through all instances of "<ID>1</ID>" ids, return the id number and then for each id process the contents (bla bla bla)of the "<BODY>bla bla blah </BODY>" bodies.
thanks for ur suggetions

Similar Messages

  • HELP:script that iterates through all opened documents and rezise them to match the biggest one.

    Hi,
    I'm making a batch processing action and I really need a script that iterates through all open documents, finds the one with the biggest image size and then iterates one more time to change the rest of the documents to the same image size dimensions. At the end all documents must share identical image size.  I'll really  appreciate if someone can put a quick script for doing this. Thank you !

    I think should do…
    #target photoshop
    if (documents.length > 1) {
         var smallest = 1000000; // Set beyond any size you may be expecting this should do?
         for (var a = 0; a < documents.length; a++) {
              smallest = Math.min(smallest,documents[a].width.as('px'));
         for (var b = 0; b < documents.length; b++) {
              if (documents[b].width.as('px') != smallest) {
                   app.activeDocument = documents[b];
                   var newWidth = new UnitValue(smallest, 'px');
                   documents[b].resizeImage(newWidth,undefined,undefined,ResampleMethod.BICUBICSMOOTHER);
    }else{
         alert("NOT enough docs to resize?");

  • How do you iterate through a string?

    Hi! How do I loop through a string of characters. My program needs to iterate through a string in order to do some calculations. Here is an example:
    <item>1</item>
    <description>This is an example.</description>
    How I iterate through description one character at a time.
    Thanks for your help!

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    <xsl:template name="add-X">
    <xsl:param name="string" select="." />
    <xsl:if test="$string">
    <xsl:text>X</xsl:text>
    <xsl:value-of select="substring($string, 1,1)"/>
    <xsl:call-template name="add-X">
    <xsl:with-param name="string"
    select="substring($string, 2)" />
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Create an file named TEST.xsl with the above code.
    <aaaa>ABCDE</aaaa>
    Create an file named TEST.XML with the above code.
    Create an RTF template with form field valus as
    <?import: file:///C:\Desktop\Sample RTF\TEST.xsl?>
    Note : here you have to point the xsl path where your TEST.xsl is located.
    Then create another form field with value
    <xsl:call-template name="add-X"> <xsl:value-of select="." /> </xsl:call-template>
    When you merge the xml and RTF , you will find the no of "X" equivalent to length of the string in <aaaa> tag in xml

  • How can I disable the "this PDF document might not be displayed correctly" notification?

    Almost all PDF files produce the "this PDF document might not be displayed correctly" message when viewed with the built-in PDF viewer.
    This message does not convey useful information. It appears on almost all PDF files (even though they usually work correctly after all); it sometimes fails to appear even on files that don't work (so it does not accurately predict whether a given file will work); when a file doesn't work, there is no way to make it work short of using an external viewer (so the error I'm being warned about is not something I can fix); and it demands a user action to dismiss it EVERY TIME it appears (so it places a disproportionate demand on my attention). How can I disable it?
    Please note that I am not looking for instructions on how to disable the built-in PDF viewer. I just want to turn off the warning message.

    The only way to stop this message is to disable the built-in PDF Viewer and use another viewer.<br />
    On Linux you only have an older version of the Adobe Reader available, so you may have to open the PDF files in an external viewer like evince.
    You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer.
    You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu if you want to display PDF documents in Firefox with another application (i.e. not the built-in PDF Viewer).
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them
    The latest stable version of the PDF Viewer (pdfjs) extension:
    *PDF Viewer: https://addons.mozilla.org/firefox/addon/pdfjs/
    Latest development version of the PDF Viewer (pdfjs) extension:
    *http://mozilla.github.io/pdf.js/extensions/firefox/pdf.js.xpi

  • How to insert Transition object into html document

    Hello Friends,
    I am trying to insert Transition object ( downloaded from
    Extension) into HTML document.
    I tried Insert -> HTML -> Head Tags -> Transitions,
    but after doing all this I am not able to insert
    this extension in my document.
    As I am beginner to Dreamweaver, Can anyone pls. help me out?
    I am using Dreamweaver 8.
    Do I need to select <img> tag before inserting
    Transition Object?
    Pls. pls. help me out.....
    Waiting for reply.
    Thanks in advance for your help.

    When I used to do tabs I would set up a page that was as wide as the tab sheet including the tab, then add text frames in each tab position.

  • HT1766 My iPad hasn't been backed up and it's displaying the msg but will not let me get rid if the msg so that I can get it backed up. How do I get through this

    My iPad hasn't been backed up and it's displaying the msg but will not let me get rid if the msg so that I can get it backed up. How do I get through this

    Try this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up

  • How do I iterate through a subform structure ?

      I have subforms which have individual fields which I have to set access either open or protected.  Instead of listing each single field, is there a way I can use a for loop to iterate through the subform and set each field access as needed?

    That’s unfortunate because we aren’t using Acrobat/Reader to read the forms.  We’re using a product called FormStream Filler.  Anyway, I stumbled onto a technique used in a previous form here.  I don’t understand everything about it, but I was able to replace enough code to get it to work with my form.  Suffice to say it has a lot to do with nodes. 
    Thanks for  answering.

  • How to extract content from a html-document

    Hi!
    I need to display the content of a news-feed
    like: http://news.bbc.co.uk/go/rss/-/1/hi/sci/tech/7662565.stm
    I'd like to display this in a JEditorPane with only the relevant content without the banner, menu and so on.
    Any idea on how I can do this?
    Cheers

    In this particular case, you don't want to parse the HTML but the RSS feed used to build this this page. The feed for this page is [http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/sci/tech/rss.xml]
    RSS feeds are XML based so it's easy to parse them. You can do it by hand or use a specialized library. One of the well-known library is ROME ( [http://wiki.java.net/bin/view/Javawsxml/Rome] ).
    Example : [Parse a RSS XML file|http://www.rgagnon.com/javadetails/java-0557.html]
    Bye.

  • How can I search through a scanned document?

    I often have hundreds of pages to read through for my job and I get the files in paper format and in PDF scans.  Is there an adobe program that will allow me to search a scanned document for a key word or name?  It would save me so much time.

    Hi td1137,
    If the document is scanned pdf document, you may run OCR feature in Adobe Acrobat to make the text searchable. http://www.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe-acrobat-xi-scan-pape r-to-pdf-and-apply-ocr-tutoria…
    Then save the document and you may use Acrobat or Reader to search keyword in same pdf document.
    How to create a searchable text document from a scanned page | Acrobat X Tips & Tricks | Adobe TV   check how to make scanned document searchable.
    Regards,
    Ajlan Huda.

  • How do i tab through all open documents

    Alt + Tab on a windows machine will tab through all open windows and documents.  Command + Tab on my IMAC will only tab through the open applications.  Is there a way I can set up the IMAC to work like to windows machine in this case?

    four finger swipe upwards will show you everything thats open. its not the same as on a pc where it shows each program in a rotating type of display... but it does show each program and the windows within that program that are open.

  • How can I iterate through the TextObjects of a Report object?

    Post Author: EMoscosoCam
    CA Forum: Other
    Hello(Using Crystal Reports XI Release 2 and Visual Basic 6)I have the name of a TextObject as a string. I would like to make something like this:Dim objReport As CRAXDRT.Report' once initialized from an RPT fileobjReport.TextObjects(strName).Supress = TrueOf course, there is not such a thing as a TextObjects collection. Is there a similar way to do what I want? Consider that the TextObject's name to be supressed is a string, and that I do not have it before-hand.Thanks a lot.

    Post Author: JonathanP
    CA Forum: Other
    Hi;
    You can loop through every section, then through every object, and check to see if it is a TextObject or not.
    ie:
    Dim I As IntegerDim X As IntegerFor I = 1 To Report.Sections.Count    For X = 1 To Report.Sections.Item(I).ReportObjects.Count        If Report.Sections(I).ReportObjects.Item(X).Kind = crTextObject Then            Report.Sections(I).ReportObjects.Item(X).TextColor = vbRed        End If    Next XNext I
    Regards,
    Jonathan

  • How do I insert images in HTML document?

    I'm working on an old site and I want to use Dreamweaver to build new pages.
    That site was not built with Dreamweaver.
    I just want to open a new HTML page, build that page then copy and paste the code.
    I have no problem with the text, but I have to insert graphics using their URL, not their location on my computer. I've tried, but I don't understand how it works.
    Thank you.
    Gina

    cookscornerblog wrote:
    Mr. Powers, I'm 69 years old, so maybe I'm just senile.
    I certainly hope not, Gina. You're only a few years older than me, and roughly the same age as Murray. Neither of us comes from a computing background, but our age hasn't stopped us from learning new technologies.
    You'll find most people here, including me, are very helpful. You got the first answer from me within six minutes of posting your question. When you asked for step-by-step instructions, I gave you a direct link to the Help pages, which give step-by-step instructions.
    Help is given here willingly, regardless of age or experience. But you're more likely to get the assistance you need if you show that you have at least made some effort to solve the problem yourself. I honestly cannot believe that an 80-hour course on Dreamweaver did not cover the insertion of images. It might not have covered the insertion of remote images, but the method is exactly the same as inserting a local image.

  • How Do I iterate through a TIFF image in an ImageField?

    Does anyone know of a method to iterate tiff images inside an ImageField?
    If I load a Tiff image which constitute of multiple pages/images only the first image available on the imageField.

    In JavaScript you'd do something like:
    var nodeList = xfa.resolveNodes("MytxtBox[*]");
    for (i = 0; i < nodeList.length; i++) {
    xfa.host.messageBox(nodeList.item(i).access);
    I haven't tried the script, so there may be some syntax errors, but that's how you do it.
    FormCalc would be something like:
    for i = 0 upto 2 do
    $host.messageBox(MytxtBox[i].access)
    endfor
    Chris
    Adobe Enterprise Developer Support

  • How can I get through this Adobe Elements 9 error message

    It's been perfectly installed and I'm using a serial number. Everytime I try to go to an old project or create a new one it says "Sorry, a serious error has occured that requires Adobe Premiere Elements to shut down. We will attempt to save your current project." The full layout can't even show because of this. It's just a grey screen and you cannot access the options on the bar they are non clickable expect for New, Open Project, Recent Project, or exit. It's very annoying and I can't even do anything because of this..Does anyone have any solutions or has encountered this? I'm running on a Dell Inspiron which came with the double disk of this and Photoshop Elements 9 which I have no problems with whatsoever.

    Hi Oppositeofhood,
    Welcome to Adobe Forums.
    Please navigate to the below path and rename the syles folder to styles.old
    For Windows: C:\Users\bahl\Documents\Adobe\Premiere Elements\9.0
    For mac: Open the finder, go to documents>Adobe>Premiere Elements\9.0
    Then try to re-launch Premiere Elements and check if the issue persists.
    Thanks

  • After recently moving my keyboard broke,I've now replaced this but have now forgotten my password so can't access anything on my computer,anyone know how I can get through this?It dosent give me the option of forgotten password!

    After recently moving I broke my keyboard,this has now been replaced but I've forgotten my password so can't access anything on the computer.anyone know what I can do?It dosent give me the option of forgotten password!

    I'm totally confused, since keyboard and password are mutually exclusive items. In other words, use what you used with the broken keyboard.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

Maybe you are looking for

  • Why is the SSD on 2011 Macbook Air much slower then 2010 Macbook Pro with Samsung 830 SSD (less then half the speed) ?

    Why is a laptop designed from ground up to use flash slower then a older laptop with a upgraded SSD from a 3rd party? My old MBP is more then 2x the speed (read/write) with a SSD upgrade (Samsung 830) then my Air. Any fixes or mods to boost the flash

  • Error code:-1967362023(0x8abc 7019)

    Hi everyone, When I run the VILogger software using a NIPCI6221 and a CB-68LPR terminal block appears the following error: Engine Error! Error code = -1967362023(0x8abc 7019) Description=Error -19637362023 ocurred at an unidentified location. Possibl

  • Transferring AE CS6 file to CS5.5?

    Hi I have a file that opens only in CS6 and I need to open the same file in CS5.5, is it possible to save the file in CS6 as a format that will open in CS5.5? This is urgent as my cs6 trial will run out soon. The file was oroginally started in cs5.5

  • Captivate 7 - Copying slides with Advanced Actions

    Hello, I have a number of slides that I want to copy and paste into a new project. Many of these slides have click to display type advanced interactions.  When I copy and paste the slides into a new project, the advanced interactions don't seem to co

  • Exported 4:3, looks like 16:9 in iDVD

    I finished a project in FCP in 4:3, burned a QT that is 4:3 (720x480), and brought it into iDVD. I tried using an iDVD theme that is widescreen (and keeping my 4:3 aspect ratio when prompted to choose 4:3 or 16:9), and I made sure that 4:3 was select