Xml reading specific node and putting them in hashtable

Hi Friends
I have to create program to print xml filenames and the id (which is a tag) inside the xml file.
the filenames i have to print are the names of xml files themselves and then
they have id taginside the file and there can be more then one id now I have
to add all the id names and filenames to a hashtable. I don't know how to do this. Any help would be great.
Hashtable should be like this
id filename
012125 hbn.xml
012567 hbn.xml
345669 xsf.xml
Till now I hace made the code to create DOM for the files abd I can read the ID'd inside the files, But i do not know how to add id's with their files names in the hashtable.
Part of my code lokks like this::
NodeList idList = currDom.getElementsByTagName("ID");
if( idList == null && idList.getLength() == 0 ) {
System.out.print("LIST is empty ,return bad... " );
} else {
for(int i=0; i< idList.getLength(); i++ ){
String strval = idList.item(i).getFirstChild().getNodeValue();
int nodeval = Integer.parseInt(strval);
System.out.println("grant id value is " + nodeval);
any sample code will be great.
Regards Preeti

use put method of HashTable class.
hashTable.put(key,value);
here key and value both should be objects.
so u can make id as key(u have to wrap it with Integer),and file name as the value.
-seenu_ch

Similar Messages

  • Db services find and put them back after node is up

    version 10203
    We have 3 node RAC, if one node goes down how i can find out what services failed over to remaining nodes and put them back after take 3rd node up? any metalink notes# would help too , just to clear my concepts.

    Hello,
    Take a look on gv$services dictionary view
    Use the srvctl relocate service command with the following syntax:
    srvctl relocate service -d db_unique_name -s service_name -i old_inst_name -t new_inst_name [-f]
    srvctl relocate service -d crm -s crm -i crm1 -t crm3
    See it on http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/srvctladmin.htm#RACAD5051
    Cheers,
    Rodrigo Mufalani
    http://mufalani.blogspot.com

  • Has anyone got a script to read a list of email addresses from a Mail message and put them into a group in Contacts?

    Has anyone got a script to read a list of email addresses from a Mail message header and put them into a group in Contacts?

    Now Tony, I know you can't hear my tone on a forum post but I was not complaining, simply stating facts . This change brought several people in my office to a grinding halt in a long established workflow that is really rather simple (and I thought was already assumed from the original post above ):
    1) Select a set of records in FileMaker Pro 12 and export only their e-mail addresses as a CSV file.
    2) Open that CSV file in Excel.
    3) Copy the column of e-mail address.
    4) paste into the appropriate recipient field in Mail.
    5) Send
    If I were to complain it would be about Apple's typically opaque approach to updates. There is no granular explanation of why changes were made or even "what" changes were made.
    Complaining is futile since Apple is Apple and is unlikely to change, but sometimes it is cathartic to "shout into the void" .
    I had thought about doing something with a formula in Excel and your suggestion was simple and helpful. Again, however, it is only a workaround for a long established helpful behavior that Apple has inexplicably broken/removed in Mavericks Mail.
    I, and the other posters here, would love to have the capability back rather than have to add previously unneeded steps to our workflows.
    Ultimately we may add scripting steps to the FileMaker side to export the address lists with commas inserted already if Apple ends up having permanently removed this feature.

  • Xsl for removing specific nodes and modifying one node.

    Hello,
    i have the urgent need to remove specific nodes
    and modify one node in my XML.
    the xml as input :
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
           </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
              <LAYERDEF id="0" visible="false" query="" />
              <LAYERDEF id="1" visible="false" query="" />
              <LAYERDEF id="2" visible="false" query="" />
              <LAYERDEF id="3" visible="false" query="" />
              <LAYERDEF id="4" visible="false" query="" />
              <LAYERDEF id="5" visible="false" query="" />
              <LAYERDEF id="6" visible="false" query="" />
              <LAYERDEF id="7" visible="false" query="" />
              <LAYERDEF id="8" visible="false" query="" />
              <LAYERDEF id="9" visible="false" query="" />
              <LAYERDEF id="10" visible="false" query="" />     
            </LAYERLIST>
            <MAPSERVICELIST>   
              <MAPSERVICEDEF  service="BASEMAP" >
                <LAYERLIST>
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
              <MAPSERVICEDEF service="MAP1">
                <LAYERLIST>
                  <LAYERDEF id="4" visible="True" query="" />
                  <LAYERDEF id="3" visible="True" query="" />
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
            </MAPSERVICELIST>
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    what i want to have is:
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
          </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
       <LAYERDEF id="6" visible="True" query="" />
                <LAYERDEF id="5" visible="True" query="" />
                <LAYERDEF id="4" visible="True" query="" />
                <LAYERDEF id="3" visible="False" query="" />
    <LAYERDEF id="2" visible="True" query="" />
    <LAYERDEF id="1" visible="False" query="" />       
            </LAYERLIST>
            <MAPSERVICELIST/>   
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    as you see, <MAPSERVICELIST/>   is empty and <LAYERLIST> contains all <LAYERDEF> of <MAPSERVICEDEF>/<LAYERLIST> 
     The ones  of BASEMAP  are kept unchanged  but the ones of MAP1 are having a new attribute value for id.
    Thanks four your help.
    Regards.

    You can implement very straightforward map in BizTalk like below:
    If you are interested in XSLT of this map, I copied below which visual studio gave me when i validated the map:
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/PLOT" />
    </xsl:template>
    <xsl:template match="/PLOT">
    <PLOT>
    <REQUEST>
    <GET_LAYOUT>
    <PROPERTIES>
    <MAPNAME>
    <xsl:if test="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name">
    <xsl:attribute name="name">
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name" />
    </xsl:attribute>
    </xsl:if>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/text()" />
    </MAPNAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/text()" />
    </PROPERTIES>
    <DATAFRAME>
    <xsl:if test="REQUEST/GET_LAYOUT/DATAFRAME/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/@id" />
    </xsl:attribute>
    </xsl:if>
    <LAYERLIST>
    <xsl:for-each select="REQUEST/GET_LAYOUT/DATAFRAME/MAPSERVICELIST/MAPSERVICEDEF">
    <xsl:for-each select="LAYERLIST/LAYERDEF">
    <LAYERDEF>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@id">
    <xsl:attribute name="id">
    <xsl:value-of select="@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@query">
    <xsl:attribute name="query">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@query" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@query">
    <xsl:attribute name="query">
    <xsl:value-of select="@query" />
    </xsl:attribute>
    </xsl:if>
    </LAYERDEF>
    </xsl:for-each>
    </xsl:for-each>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/LAYERLIST/text()" />
    </LAYERLIST>
    <MAPSERVICELIST>
    <xsl:text> </xsl:text>
    </MAPSERVICELIST>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/text()" />
    </DATAFRAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/text()" />
    </GET_LAYOUT>
    <xsl:value-of select="REQUEST/text()" />
    </REQUEST>
    </PLOT>
    </xsl:template>
    </xsl:stylesheet>
    You can highlight the issue if you have any specific one.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    I am so sorry for you and your situation. Were you using iCloud photostream?
    Otherwise I do not see any chance for your precious photos.
    Congrats anyway on the little darling!

  • Get All images from a website and put them in a listbox.

    Hi Everyone, I am new to Java Programming.
    I wanted to know if there is a way to get all the images in a website and put them in a listbox. And if an item is clicked in list box, view it in a picturebox.

    Harsimran_Singh wrote:
    what is the whole idea about .Net vs. Java...guys, .NET users are so friendly and helpful, they don't even judge english
    This is not putting a good impression of Java Users on me.good luck with .net. im sorry that things didnt work out with java.
    unfortunately, .net is essentially a clone of java so you may find that you will be looking
    to learn exactly the same things but for an expensive propriety platform.
    if you change your mind, read:
    [swing tutorials|http://java.sun.com/docs/books/tutorial/uiswing/]
    jlist
    listcellrenderer
    [list tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]
    [advanced list programming|http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html]
    on your way out thank the moderators : )

  • I made 2 playlists on Itunes and put them on my Ipod.  How do I get the songs to play consecutively and not keep playing the same song over and over again???

    I'm a new Zumba instructor and have to come up with playlists for my routines.  I made 2 playlists on ITunes and put them on my Ipod.  Everytime I want to play it, only one song from the list plays over and over.  The other songs do not.  How do I get the songs to play the way I have them set up??

    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    For other music you need to get them from where you got them before.

  • I have a windows computer. How can I create apps and put them on itunes?

    I have a windows computer. How can I create apps and put them on itunes?

    You can't. The iOS SDK requires Mac OS X and an Intel Mac; Windows applications can't be put on either the iOS or Mac OS X App Stores.
    (82889)

  • I want to take the photos off my iPhone and put them directly onto an external hard disk. I want to bypass iPhoto altogether. When I link my iPhone to my computer, it only opens in iTunes, which only gives me the option to save my photos to iPhoto. Help!

    I want to take the photos off my iPhone and put them directly onto an external hard disk - I don't have any room left on my computer. I want to bypass iPhoto altogether. When I link my iPhone to my computer, it only opens in iTunes, which only gives me the option to save my photos to iPhoto. Help!  This is seriously frustrating!.
    Additionally, I'd like to be able to take the 2000+ photos out of iPhoto and put them on a disk in a folder. I have managed to export them to the hard disk but it's just plonked all 2000+ photos in a list - not ideal if I want to use it for anything else. And then I have to manually delete the photos from iPhoto. Is there not a quick and easy way of dealing with this? 
    Anyone got any bright ideas? Thanks for your help!

    I too would like to be able to do this. Just put them where i want the. IFTT a scripting app will put the images in dropbox for you , but its been pretty iffy.

  • How do i get my contacts off my iphone and put them in iCloud?, how do i get my contacts off my iphone and put them in iCloud?

    I'm trying to get my contacts on my iPhone and put them on my IPad and trying to put them in outlook. also, I have two old email accounts on my iPhone that I do not use anymore and want to delete them, when I do delete them it also delete all my contacts on my iPhone. Lastly, none of my contacts show up on my iPad and iMessage on my iPad doesn’t work. If someone can please help I wall greatly appreciate it. Thanks!!

    ''how do i get my old bookmarks from gmail ''
    There are seven links under the topic "bookmarks"
    :at http://kb.mozillazine.org/Using_Google_Toolbar_features_without_toolbars
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • I plugged my ipod into my pc it said it needed an upgrade so I pressed the upgrade button after the upgrade was finished I bought 2 albums from Itunes and put them on my ipod then when I looked all my other music had dissapeared how do i get it back

    I uploaded two albums and put them on my boyfriends ipod it asked for me to upgrade his ipod and i did, them after when I checked to see if the albums had loaded they had, but all his other music had dissapeared, how do I get it back there were thousands of pounds worth of music on the ipod, he is not happy and neither am I, I am on windows 7. Please help............................................................

    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    For other music you need to get them from where you got them before.

  • I have photos on my iphone 4 that i'm trying to transfer to iphoto.  The problem is when I plug the phone in, it only wants to transfer the new photos, not all.  How can I take all the photos off my phone and put them into iphoto?

    I have photos on my iphone 4 that i'm trying to transfer to iphoto.  The problem is when I plug the phone in, it only wants to transfer the new photos, not all.  How can I take all the photos off my phone and put them into iphoto? Even if there are duplicates, I'd like to make sure I get all the photos from my phone into iphoto.  Thanks

    To see all the photos on the phone, including photos that have already been imported into iPhoto, deselect the "Hide Photos Already Imported" checkbox. If the camera contains photos that have already been imported into iPhoto, those photos are hidden by default.

  • Selecting a group of files and putting them in a newly created folder?

    If I select a group of files in finder or on my desktop -- is there a command to create a new folder and put them in it? (I'm thinking of how you can take a selection in iTUNES and create a playlist from the selection).
    (I know how to create a folder and then drag my selection into it).
    Thanks!

    Open the Script Editor in the /Applications/AppleScript/ folder and paste in the following:
    tell application "Finder"
    make new folder at desktop
    move (selection as alias list) to the result
    end tell
    This script expects that two or more items are selected. You can enable the script menu in the AppleScript Utility and then add the script to the menu for easy access.
    (17890)

  • And put them into stand alone albums on my iPhone 4?

    I want to take some pictures off the camera roll and put them into stand alone albums on my phone...how do I do this?

    go to photos.  click on edit.  click on add. it will ask a name.   then go into your camera roll.  at top right click on arrow.  then select the pics you want.  then click done. 

  • I accidentally deleted all of my Logic Pro X files and put them in my trash but now that I copied them back to my documents they all play in the wrong places in my projects

    I accidentally deleted all of my Logic Pro X files and put them in my trash but now that I copied them back to my documents they all play in the wrong places in my projects

    Buddhaguru wrote:
    I know that Mac's don't have a roll back like PC's
    They do. It's called Time Machine.
    You need to reinstall all of your Apps. That should replace all of the support files you nuked.

Maybe you are looking for

  • Blue screen

    My MacBookPro has been working great... but now it sometimes freezes to a blue screen. it does not happen at login... but while i am running different programs. it will remain on the blue screen anywhere from a second to a minute, and then return to

  • How to find Level 1, Leve 2, Level 3 reporting manager

    Hi Experts, How to find Level 1, Level2, Level 3 reporting manager for an employee. pernr--> leve1 manager --> leve2 manager --> leve3 manager . Thanks in Advance. Regards, IFF

  • Change a attribute value with XSLT before importing an XML

    I need change the attribute value with XSLT before importing an XML <table class="x" style="width="50pt">... I have to divide by 200 the value of "width", and the result multiplied by 100: (50/200) * 100 It's possible with a XLST?

  • Must restart printer to print (3052A)

    This is a very odd problem. I can usually google answers to my problems, and I've tried all the connection checklists and diagnostic tools I can find. I have a HP Deskjet 3052A. I have it set up wirelessly on my home network, where I have a variety o

  • Install PeopleTools 8.51 on my PC

    I wish to install PeopleTools 8.51 on my PC which has Windows Vista Home Premium Service Pack 2 (32 bit operating system). Is this possible/adviseable with my PC configuration and with the file downloads available on the PeopleTools 8.51 Media Pack?