Extraneous nodes like "\n\t\t" when using getFirstChild(), etc.

I have an XML file consisting of:<?xml version="1.0" encoding="utf-8"?>
<config>
     <connection>
          <fromConnString>jdbc:odbc:Conn1</fromConnString>
          <fromUser>user1</fromUser>
          <fromPass>pass1</fromPass>
          <toConnString>jdbc:odbc:Conn2</toConnString>
          <toUser>user2</toUser>
          <toPass>pass2</toPass>
          <fromSchema>schema1</fromSchema>
          <toSchema>schema2</toSchema>
     </connection>
     <conversions>
          <conversion>
               <convertFromFile>C:\clienteleTest\floridaCust.txt</convertFromFile>
               <convertToFile>C:\clienteleTest\eastCust.txt</convertToFile>
               <xrefFile>C:\clienteleTest\custNoMapped.txt</xrefFile>
               <table>
                    <tableName>cy_cust</tableName>
                    <fieldConversions>
                         <fieldConversion>
                              <fieldName>cust_no</fieldName>
                              <fieldValue>C:\clienteleTest\custNoMapped.txt</fieldValue>
                         </fieldConversion>
                         <fieldConversion>
                              <fieldName>UPDATE_TS</fieldName>
                              <fieldValue>CURRENT TIMESTAMP</fieldValue>
                         </fieldConversion>
                    </fieldConversions>
               </table>
          </conversion>
     </conversions>
</config>When I use getNextSibling() or getFirstChild() to move through my list I end up getting lots of nodes that are, apparently, the newlines and tabs that my XML file is formatted with. While debugging I can expand my current node and see 'data="\n\t\t" (id=61)'.
I can loop over the nodes until I get to something I recognize, but is there a way to get rid of these "formatting" nodes before they get to my parsing logic?
Some sample code below:public class XmlSettings
     Document doc = null;
     Connections cons = null;
     ArrayList<Conversion> convs = null;
     public void buildDoc(String filename)
          boolean validate = false;
          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
          dbf.setValidating(validate);
          dbf.setNamespaceAware(true);
          dbf.setIgnoringElementContentWhitespace(true);
          doc = null;
          try
               DocumentBuilder builder = dbf.newDocumentBuilder();
               doc = builder.parse(new File(filename));
               doc.getDocumentElement().normalize();
          catch (SAXException e)
               System.exit(1);
          catch (ParserConfigurationException e)
               System.err.println(e);
               System.exit(1);
          catch (IOException e)
               System.err.println(e);
               System.exit(1);
     public void buildSettings()
          Node currentNode = doc.getFirstChild();
          do
               if (currentNode.getNodeName().equals("config"))
                    currentNode = currentNode.getFirstChild();
               if (currentNode.getNodeName().equals("connection"))
                    cons = new Connections(currentNode);
               else if (currentNode.getNodeName().equals("conversions"))
                    Node convsNode = currentNode.getFirstChild();
                    do
                         Conversion tempConv = new Conversion(convsNode);
                         convs.add(tempConv);
                    while((convsNode = convsNode.getNextSibling()) != null);
          while((currentNode = currentNode.getNextSibling()) != null);
}

Sounds good... I just added some stuff to do that now:                    Node convsNode = currentNode.getFirstChild();
                    while(!convsNode.getNodeName().equals("conversion"))
                         convsNode = convsNode.getNextSibling();
                    }before I try to operate on the "firstChild" node to make sure it's what I'm looking for...

Similar Messages

  • TS2771 on i pod touch the orientation does not change when I turn it on it's side when using safari etc.  When viewing youtube it only displays widescreen and will not display portrait , anyone any ideas? is this a fault or do all ipod touch do this?

    On i pod touch the orientation does not change when I turn it on it's side when using safari etc.  When viewing youtube it only displays widescreen and will not display portrait , anyone any ideas? is this a fault or do all ipod touch do this?

    The user guide says:
    Movies viewed in Videos and YouTube appear only in landscape orientation. Street views in Maps
    also appear only in landscape orientation.
    Do you have the scree orientation lock turned on? If on there is a circular arrow icon with a padlock inside next to the battery charge icon in the upper right.

  • My Apple TV lacking sound when using iplayer etc

    Can get sound when using Airplay from some web sources but not others. Any reasons why?
    Nick

    Hmm, rebooted the mac and now works! had only tried rebooting Apple Tv before. strange, as sound was fine on mac when not using airplay
    thanks all
    Nick

  • I can't comment or like anything on Facebook when using Firefox. Other browsers work, just not Facebook.

    I've tried clearing all my history, cookies, and everything else on Firefox, but it doesn't fix the problem.
    Whenever I try to comment on a post in facebook it says "Unable to post comment." And it won't let me like any posts either.
    Google Chrome works perfectly with Facebook. I don't want to quit using Firefox, but unless I get a solution soon that may be what I have to do.

    I have exactly the same problem.
    It only affects FaceBook and only in Firefox but it's really annoying.
    I can post status updates but can't comment on them or on anything else.
    The message "Unable to post comment." with the option to "try again" appears every time.
    Also, when I try to "Like" something it's as if it works for a split second and then self "unlikes" again. It's only today I've started to have this problem.
    I've tried jscher2000's idea but it did not solve this problem.
    'Concerned a virus or something might be the cause... :/

  • Tab Control Property Node gives a build error when used in a VI for LabVIEW PDA

    Hello,
        Iam new to LabVIEW development & need help regarding this:
        We are trying to port a LabVIEW application from desktop to a Windows Mobile PDA. Please note that the LabVIEW application works fine on the desktop. In one of the VIs, a Tab control property node is used which gives a build error with LabVIEW PDA project. A sample VI which shows the problem & the error list snapshot is attached with this post. Can anyone please suggest an alternate approach to achieve the same functionality with LabVIEW PDA? Waiting for an early response from anyone...
    Thanks & Regards,
    Subhashini
    Attachments:
    VI_Error.zip ‏31 KB

    Hello Ton,
        Am glad that i got a response, thanks. The following links indicate that Tab control is supported on PDA target:
    http://digital.ni.com/public.nsf/allkb/CBA335641E27B858862571490015EA88?OpenDocument
    http://forums.ni.com/ni/board/message?board.id=170&message.id=221507&requireLogin=False
        I feel that the Tab control property node that has been used in the VI (which is attached earlier) may not be supported on the PDA target. Can u (or any LabVIEW expert) suggest an alternate approach to achieve the same goal with LabVIEW PDA (changing colour of Tab control pages programatically)??
        I had missed out some details earlier: We are using LabVIEW 8.5 PDA module on a Windows Mobile PDA.
    Thanks & Regards,
    Subhashini

  • Does anyone have an issue with earbuds connection with iphone 4s. sounds like speaker is on when using them. can someone help me?

    everytime i connect the earbuds to talk on phone it sounds like a loud speaker  on earbuds. it has a lot of echo. does anyone know how to fix this?

    Is yours 4s? Have you recently updated to 6.1 or 6.1.2?
    Looks like apple is kiding with us. Ive had this problem since Ios 6.1 and now after 3 days I ulgraded to 6.1.2 this ****** issue has returned. Again the other part will listen me if I scream HELLOOo in the first second and then everything works fine or if I wait 1 minute but none can wait that.
    Im really angry with this company always they mess up after each update

  • Shuts down when using QuickTime (random)

    Need some help/ideas here...
    My G5 Power PC dual 2.3 OS 10.5.8 shuts down (instant like pulling the plug) when using QuickTime 7.6.4 but its random... sometimes I can watch a couple hours worth sometimes it shuts down in 10 minutes.
    Can software cause a a random instant shutdown?
    My temps seem normal vs. others posted here (I cant see video card temp)
    I think maybe its the Radeon 9650 (256) video card but I can use Aperture without shutdowns.
    At first I thought it was the poor power in my old house (I did just move this computer upstairs) but it never shuts down with anything other than QuickTime.
    Would there be something in a log to show me why its shutting down? how do I find the log and what do I look for?
    Also I cant find the hardware test that came with my computer (lost when moving studios years ago) is there somewhere I can get a copy?
    any ideas to help me identify and solve this issue would be helpful, I dont think it would be cost effective to take such an old computer to the Apple store but would like to get it working again as its plenty fast for home use CS3/Aperture/web/mail
    thank you
    Ray

    Thank you very much, I looked at the console log but its beyond my understanding, there are 960 messages from 10/1/09 (fresh OS instal) to 1/6/10 and 85% of them are all from 1/4-1/6
    after a few emails to the other 2 people that used this computer at my studio, it is sounding like they "upgraded" something so it could play DVIX or CODEC movies/clips??? I dont know what that means but I am ticked to say the least..... they like movies so much maybe I video them getting fired.
    I am not 100% on the hardware but I am thinking its more likely software and will do erase and install, but anymore advice for tracking down the issue would be helpful.

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • I have been noticing that when using the computer the mouse keeps going in places where I really do not want and just now select the sentence without I have done anything. Sometimes goes to places like bookmark or open tabs in website when I am reading a

    I have been noticing that when using the computer the mouse keeps going in places where I really do not want and just now select the sentence without I have done anything. Sometimes goes to places like bookmark or open tabs in website when I am reading a page.
    Also I have noticed opened windows that I have not opened.
    I have verified the sharing folder and also the remote access but it not let me turn it off.
    Also I have add a password to my computer and even using the same one it looks like is not working.
    The I photo stopped working, Mac Mail does not let me add rules (this is from one day to the other)
    The computer is mine, the internet I use is payed by me with a password. I did not give permission to anyone to use my computer or share my files.
    In system preferences in the sharing folder is showing everyone and staff.
    My computer is private I do not own a company and I do not have a network set up in my house.
    I had my photos removed from my computer and even after trying to reinstall I photo and fix the Mac Mail is not working.
    I am receiving emails saying that I have sent emails to people that I do not know and including in a time where I am working and not using the computer.
    Any suggestions in how to fix this issue?
    I really appreciate.

    With the multitude of issues you have I would take it to an Apple store or AASP and have them sort it out. Then I would sign up for Apple camp or one on one.

  • HT204380 When using facetime how many people can you be connected to at one given time? The reason for this question is I would like to utilize facetime for conference call meetings.

    When using facetime, how many people can you be connectedto at once? The reason I ask this question is, I am wanting to conduct teleconference meetings with my staff who are spread out throughout the state and I would like to be able to have seven people in total connected to facetime at once.

    Currently only one person. A lot of users want to be able to FT multiple users.
    Send feedback to Apple requesting it. Maybe in a future iOS update or iPad it will be available.
    http://www.apple.com/feedback/ipad.html
     Cheers, Tom

  • Low memory when using programs like iPhoto, office at the same time I have 4 GB ram

    low memory when using programs like iPhoto, office at the same time I have 4 GB memory ram 3000 graphics 384 mb

    Do you have a question?

  • After updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid

    after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm

    Hi Buterem,
    I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
    How to use Activity Monitor - Apple Support
    If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
    OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
    Regards,
    - Brenden

  • Problem in JDBC , when using LIKE operator. - VERY URGENT

    Problem in JDBC , when using LIKE operator.
    LINE 1 : String temp = "AA";
    LINE 2 : String query = "select * from emp where EMPNAME like '*temp*' ";
    LINE 3 : Staement st = con.createStaement();
    LINE 4 : ResultSet rs = st.executeQuery(query);
    '*' character is not getting evaluated. In MS ACCESS2000 only * is accepted instead of '%'. Moreover in MS ACCESS the like operator has to be used within double quotes as a String. whereas in other databases, it accepts single quotes as a String.
    Ex:
    In MS ACCESS
         select * from emp where ename like "*aa*";
    Other Databases
         select * from emp where ename like '%aa%';
    In my situation iam passing a Variable inside a like operator and '*' is used.
    For the above Scenario, Please help me out.
    If possible Kindly let me know the exact Syntax.
    Please give me the answer as LINE1,LINE2,LINE3,LINE4,
    I have verified in JDBC Spec also, it has been specified to use escape sequence.that too did not work.
    Due to this, My project is in hold for about 4 days. I could not find a suitable solution.
    Please help me out.

    I made a LIKE clause work with M$ Access, using PreparedStatement and the % wildcard:
                escapeStr                   = "%";
                String sql                  = "SELECT USERNAME, PASSWORD FROM USERS WHERE USERNAME LIKE ?";
                PreparedStatement statement = connection.prepareStatement(sql);
                statement.setString(1, ("user" + escapeStr));
                ResultSet resultSet         = statement.executeQuery();
                while (resultSet.next())
                    System.out.println("username: " + resultSet.getObject("USERNAME") + " password: " + resultSet.getObject("PASSWORD"));

  • When using FaceTime, my iMac makes noises.  It dings like I am receiving an email and sometimes sounds like a busy signal, but this is while I am talking to someone. Any suggestions?

    When using FaceTime, my iMac makes noises.  It dings like I am receiving an email and sometimes sounds like a busy signal, but this is while I am talking to someone.  Any suggestions?

    Dear Mr. Toad (my all-time favorite ride at Disneyland ;-) ..
    Thanks so much for your detailed reply.. my netbook is in the bedroom, turned off.. I (so far) only use it in the evening, in the bedroom.. I've saved your response, and will try your suggestions, and let you know if they solve the problem I described. I really appreciate you taking the time to post such a detailed reply..
    I can't answer your Thunderbird "configuration" questions, because I'm in the living room, using the crap Vista laptop, on which I plan to install Thunderbird, and then take Windoze Mail out in the street and drive over it a few times.. I'll get back to you one way or the other, and let you know if your instructions solved the problem, or not..
    I don't understand why Thunderbird "out of the box", so to speak, simply doesn't forward HTML emails with embedded graphics, (like Outlook Excess, and Winblows Mail do).. without having to go through those steps. I personally HATE HTML email, but over the years, it's become more and more prevelant.. so it's a problem I must fix..
    Thanks again..
    Harv..

Maybe you are looking for

  • HP FQ834UT USB Universal Docking Station software won't work on my HP laptop with Windows 7 64 bit

    I am using Windows 7 and when i went to load software for my docking station, HP FQ834UT USB Universal Docking Station, it said it couldn't use the driver.   Is there a software upgrade to allow this driver to work on a HP laptop with Windows 7 64 bi

  • Solaris 8 10/01 installation aborts

    Hello! I'm sorry if this question is asked once again, but I was not able to find a solution for this problem after searching forums, web and google news. I'm trying to install Solaris 8 10/01 on this machine: AMD Thunderbird 1200 396Mb RAM ABIT KT7A

  • SG-300 port lock by bpduguard not visible in webGUI ?

    Hi, we are starting to replace low budget hubs by the SG-300's. On the accessports we use BPDUguard and mac security (max 1 user per port). The newest firmware is used (1.1.2.0). When i lock a port intentionally by connecting e.g. ports 4 and 5 toget

  • I am unable to pick a partition to format.

    Partition drive with a 49 Gb partition with boot camp, insert windows xp pro disk and error message "No disk found....Free space 131072GB". I am unable to pick a partition to format. ALL info I have found relates to Windows 7 or vista but NOT XP. ANY

  • Is it possible to remove an action log entry from a ticket?

    Hello. Is it possible to remove an actoin log entry from a ticket.  We may run into a situation when confidential data has been pasted into the action log. Thank you, Richard