XML DOM. Need the command to convert to real values.

Hi,
This is a sniplet of my code.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
Document doc = db.parse(new FileInputStream(MyXMLFile));
NodeList list = doc.getElementsByTagName("log");
Node root = list.item(0);
return doc.toString() + list.toString() + root.toString();
This is what gets returned.
[email protected][email protected]@3411a
How do I get the real value of "log"?
Thanks in advance

I have tried this and still returns blank.
          DocumentBuilderFactory docFac1 = DocumentBuilderFactory.newInstance();          
DocumentBuilder db1 = docFac1.newDocumentBuilder();          
Document doc1 = db1.parse(new FileInputStream(XMLFILE));          
TransformerFactory tfac1 = TransformerFactory.newInstance();          
StringWriter strWtr1 = new StringWriter();          
StreamResult strResult1 = new StreamResult(strWtr1);          
Transformer trans1 = tfac1.newTransformer();          
trans.transform(new DOMSource(doc.getDocumentElement()), strResult1);          
System.out.println(strResult1.getWriter().toString());          
DocumentBuilder parser;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
parser = factory.newDocumentBuilder();
Node myNode = doc1.getElementsByTagName("properties").item(0);
if (myNode != null) {
NodeList propChildren = myNode.getChildNodes();
int n = propChildren.getLength();
for (int i=0;i<n;++i) {
Node node = propChildren.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
NodeList nodeChildren = node.getChildNodes();
int m = nodeChildren.getLength();
Message = Message + "<" + node.getNodeName() + ">";
for (int j=0;j<m;++j)
if (nodeChildren.item(j).getNodeType() == Node.ELEMENT_NODE) {
Node thisnode = nodeChildren.item(j);
Message = Message + "<" + thisnode.getNodeValue() + ">";
else
Message = Message + "element <properties> not found";
} catch (Exception e) {
Message = Message + "trace ";
e.printStackTrace();
}

Similar Messages

  • I have uploaded a pdf-file. Where is the command to convert it to docx?

    I have uploaded a pdf-file. to https://files.acrobat.com/?trackingid=KGLHY#folder/0662976a-3059-4bd3-8f49-87041736f7c2.
    It appears in the list of files.
    Where is the command to convert it to docx?

    Hi TRee2,
    When you logon to the Acrobat.com service on the top left corner click on 'Tools' an now on the top right side select 'Export from pdf'.
    Now select the files and click on 'Export'.

  • What is the command to convert abc.pll to abc.txt in forms 10g

    Dear All,
    I want to convert all my .pll files into .txt.
    Is there any command to convert abc.pll to abc.txt in forms 10g.
    Any Help Appreciated..

    If you are attempting to produce an Object List Report from the command line with Forms Builder, yes, this is possible. According to My Oracle Support, you can use the command line call:
    frmcmp.exe batch=yes module_type=library userid=[username]/[password]@[db] forms_doc=YES module=<<Lib_name>>However, when I tested this it didn't produce what I expected. It does produce a .txt version of my Forms Library file, but it was simply the output from the Forms Compiler - not the Object List Report I was expecting. After playing around with the Forms Compiler, you can produce an Object List Report (.pld) with the Forms Compiler using the SCRIPT= parameter. So I modified the above command line to the following:
    frmcmp MODULE=MY_LIBRARY MODULE_TYPE=Library BATCH=YES LOGON=NO SCRIPT=YES OUTPUT_FILE=MY_LIBRARY.txtThis command in turn produced the file: MY_LIBRARY.txt. When you open this file in a text editor - it lists all of the library program units. It should be noted that if your Forms Library has any attached libraries, you will have to produce an Object List Report seperately for them.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Still on the inclusion of the time/date field into the spreadsheet file, with 2 real values?

    I have tried to convert the 2 real values to decimal strings, and then taken these 2 values, as well as the date/time strings, put it into an array, converted the array to decimal number, and plugged it into the 1D input of the spreadsheet vi. However, for the date and time, i get the first part only, in a decimal.i.e,for 12:30pm-->12.0000 and for 23/04/2001-->23.0000.
    How can i get the right values, show me an example if u can.
    Thanks.

    1- Open write to spreadsheet file vi.
    2- Save a copy as "Write string array to spreadsheet.vi" or something.
    3- Open this copy.
    4- Replace the numerical controls in the 1D and 2D arrays with string controls.
    5- Save this vi
    6- Now you can wire a string array to this vi and have a spreadsheet from there.
    Remember to modify the COPY, and be careful with the format string.

  • I need the best video converter

    hopefuly it will not loose any quality and i would like one that worked with any video formats
    even tho im mainlly converting mts to final cut pro
    By the way what is the best format for me to use on final cut pro x
    thanks

    Okay from my quick research, it looks like you need to import MTS files with the dialog "Import from camera" instead of just import files.
    However if none of this works I'd take the Streamclip route. Technically, yes, any video conversion is going to degrade the quality of your footage, but there's no way around it and the loss will be completely imperceptible to your (or anyone else's eyes). Repeat that conversion 1000+ times then that's a different story.
    Squared 5 will absolutely not take (or even be aware of) your footage if you use Streamclip. If you're concerned about it, though, disable your Internet connection during the duration of your file conversion. But I guarantee you, they won't steal anyone's footage nor would they have any need to.
    If you want quality, I would recommend converting to ProRes 422 (HQ) at 100% quality with no scaling enabled.

  • Which one i need when i need the scanned docs convert to pdf

    i have to sent the documents from scanning to pdf. Which adobe reader i need to use

    My above reply was under the assumption that your scanned doc is already a PDF; if it's in a different format you will need to convert it, either using Acrobat, or the PDF Pack online service.
    But most scanners can save scanned docs directly as a PDF.

  • How to convert LV Vi's from LV 7.0 to higher versions or viceversa.​I need the steps.

    For example i have labview 7.0 and i wan to open in LV 8.0 or still higher..so how to convert my VIs to higher versions or vice versa..I need the steps to convert.

    Hello,
    If you want to convert a vi written in LV 7.0 to a higher version (say 8.5) open the vi written in 7.0 with 8.5 and then save the same. (once you save it to 8.5, you can not open it with 7.0 since 8.5 is higher than 7.0. So male sure to back up your 7.0 version files)
    Now to convert a vi from 8.5 to 7.0 (for example) it gets a litle complicated becase you have load the vi in LV8.5 and then select the option File-->Save for Previous version and select the appropriate option (like 8.2, 8.0 or any other that gets populated in the drop down menu).
    Now say that you have selected the option 8.0, Again the vi saved in 8.0 and follow the same procedure to save it to 7.0 version of labVIEW.
    The reason i said it gets complicated becasue you must have installed all the version of labVIEW  (in the above case its LV 8.0) for a sucessful downgrade.
    Hope this helps you out
    Guru
    Regards
    Guru (CLA)

  • XML Dom example

    I am trying to parse an XML file in Java. I use the same XML file and am able to parse it easily in C# (hehehe I love mentioning that here ;) & VB. However, I am unable to find a decent tutorial for parsing XML DOM on the Java website. The example I have ties it into a Swing app and makes it needlessly complicated. Is there another tutorial for XML DOM? Can someone post some source code illustrating DOM?
    Thanks!

    That's the horrible example that I was referring to. It takes the reading of an XML document, using DOM, and creates a GUI app from it, making the example needlessly complicated.
    However, through experimentation and the java docs for JDK 1.4 I have figured out how to do what I need.

  • I cannot find the command/template to force rebuild of users Spotlight

    I give up, I have searched these forums, but cannot find it.
    I need the command line to recreate the template, I know I found it online but cannot find it now.
    What's worse I had a template for it, but re imaged the Mac on which I run ARD, and cannot find a copy or remember how to do it.
    So does anyone have it or can they point me in the right direction to find.
    Thanks
    Phil

    Ah well,
    Working on something else and remembered most of it, hacked it together and got it to work.
    Here it is if anyone wants it, it will turn off, delete, then turn on Spotlight on a users Mac
    #!/bin/bash
    sudo mdutil -i off / /Volumes/*
    sudo mdutil -E / /Volumes/*
    sudo mdutil -i on / /Volumes/*
    Cheers
    Phil

  • Eliminating the Command window in Windows

    I had thought I had found a way to make the command window (the black command interpreter window in Windows that comes up when you run the JVM) go away. I used the following code:
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );
    When I run this Java app and put in another app for it to run, it runs that app just fine (it's a Swing app so I don't need the command window visible). Not only that, but it gives me the command line right after starting it (meaning the original app exited). So, theoretically, you would think I could just type "exit" to close the command window. Well, when I do type that, the command window waits until the program exits before actually closing. Manually closing the command window closes the whole program. The odd thing was, an older version (I think Java 1.1) of the JRE would allow the command window to close. But, with 1.3, it does not. Does anyone have any idea about how I could change this, or of another way to get rid of the command window?
    -Sam Fahmie

    Sorry, didn't put the code tag in right...
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );

  • Can the newText property detect when a value is deleted?

    i'm writing a script in a text field that runs from the change event:
    ]var myValue = xfa.event.newText;
    ]oSubform.textField.rawValue = ScriptObject.myFunction(thisValue);
    it runs fine when an actual value is passed to the function. my problem is that i also need the function to run when a value is deleted from the text field. can the newText property detect when a value is cleared via the delete / backspace key?
    i know i can run this from the calculate event but i would rather not because the text field running the script is in a repeating subform that spans multiple pages. previous attempts to fire off the function from the calculate event has caused significant slow down in processing.

    justin,
    good catch on the thisValue being passed instead of myValue. note to self: need to work on attention to details...
    anyway, i re-examined my function to see what errors may be happening but i'm stumped. here's the gist of what the function's supposed to do:
    function myFunction(myValue) {
    ] if (myValue == null) {
    ]] return "None";
    ] } else {
    ]] if (myValue == 1) {
    ]]] return myValue + " day off";
    ]] } else {
    ]]] return myValue + " days off";
    when i delete the value being entered into the text field that calls the function, the function returns " days off" instead of "None". what am i missing here?

  • Converting Dom Document object into XML file removes the DTD

    Hi All
    My xml is dtd. I have one xml file. i changed the node value after that i want to create a xml file with the same name. I created new xml file but i am not seeing the old dtd in the new file. This process is done with the help of jaxp.
    My code is given below
    File fileInput = new File("input.xml");
              File fileOutput = new File("output.xml");
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setExpandEntityReferences(false);
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document document = builder.parse(fileInput);
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
    transformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, "true");
              transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
              DOMSource source = new DOMSource(document);
              FileOutputStream fos = new FileOutputStream(fileOutput);
              StreamResult result = new StreamResult(fos);
              transformer.transform(source, result);
    Thanks in advance

    The Transformer API does not guarantee the preservation of that information. You may want to check the DOM L3 Load/Save package (http://java.sun.com/javase/6/docs/api/index.html). Alternatively, you may force things by setting the additional output properties 'doctype-public' and 'doctype-system'.

  • Which unix command for converting xml to pdf

    Anybody know the command in unix to convert docbook xml to PDF???
    is it xsltproc or pdfwrite???
    thanx

    "ooba" <[email protected]> wrote in message
    news:gl2klg$rap$[email protected]..
    >I know this is the Flex Group, but I'm getting no love
    from the Flash
    >group.
    > 1. I need to build a thick client
    > 2. I have 0 experience with Flex or AIR
    > 3. I have built alot of Flash web components and a few
    thick clients
    > 4. I only have one week to get something working
    >
    > Can anyone tell me if it is even possible for Flash to
    generate a PDF file
    > from an imported XML file? or to browse a systems and
    allow the user to
    > select
    > an xml file to load?
    You'd need to upload the file to a server and have the server
    do this.
    > I need to have the client select an xml file that and
    the thick client
    > would
    > then use a predefined xsl file and (missing this part)
    need to convert the
    > xml
    > out to a human readable PDF format.
    Depending on what server-side technology you are using, there
    are probably
    PDF libraries you could use.
    > If you have another suggestion on how to do this please
    post suggestions.
    >
    > All I know right now is that I need to construct a thick
    client to do
    > this,
    > and being that Flash has been what I have built thick
    clients on before
    > I'd
    > like to do it in Flash rather than try and figure out
    how to do it in C#
    > .Net
    > in less than a week.
    You won't be able to do it with Flash or Flex alone.
    HTH;
    Amy

  • [svn] 2716: SDK-15848 - Conditional compilation constants defined in flex-config. xml are never used if a single constant is specified on the command line

    Revision: 2716
    Author: [email protected]
    Date: 2008-08-04 01:18:12 -0700 (Mon, 04 Aug 2008)
    Log Message:
    SDK-15848 - Conditional compilation constants defined in flex-config.xml are never used if a single constant is specified on the command line
    * There's a possibility this will break a conditional complication test which disallows overwriting an existing definition -- I don't know if that will break the build, but the test should be removed either way.
    * Using append syntax ("-define+=" on the command line or ant tasks, or append="true" in flex-config) and redefining a value works now if you use an already-defined namespace and name.
    * So your flex-config may have -define=CONFIG::debug,false, and you may want -define+=CONFIG::debug,true from the commandline build, or FB build.
    * Made the ASC ConfigVar fields final as a sanity check since overwriting is now allowed. It would be harder to track changes and subtle bugs if they were mutable. This means that you must build a new ConfigVar object if you need to make changes.
    Bugs: SDK-15848
    QA: Yes. Please read the updated javadocs in CompilerConfiguration. Tests need to be added to validate that overwriting is allowed, and happens correctly in different situations: I believe the order should be that flex-config is overwritten by a custom config (can we have more than one user config? is the order deterministic? I forget...), is overwritten by commandline or OEM. Did I miss any? (I didn't write code which changes this, it works however the existing configuration system allows overwriting and appending; if we have tests for that, maybe we don't need them duplicated for this feature.)
    Doc: Yes. Please read the updated javadocs in CompilerConfiguration.
    Reviewer: Pete
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15848
    http://bugs.adobe.com/jira/browse/SDK-15848
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/ConfigVar.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/internal/OEMConfiguration.java

    Please note: I AM USING:
    JkOptions ForwardKeySize ForwardURICompat -ForwardDirectories
    And that's what's supposed to fix this problem in the first place, right??

  • Simple XML DOM Example Needed.

    I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
    Thanks,
    Dave.

    You can find some examples:
    http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
    http://newinstance.com/writing/javaxml2/javaxml2_examples.html
    http://www.docuverse.com/domsdk/index.html#tutorial
    http://www.devx.com/sourcebank/search.asp

Maybe you are looking for

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java web

  • Restoring desktop from backed up user folder - Time machine doesn't ??

    I need to restore my desktop from a backed up copy of my user files. Went to the Genius Bar and discovered my disk was failing (Apple replaced it at No Charge! kudos) The Genius backed up my files to a folder on my external hard drive before replacin

  • Newbie to applets! error message in java console

    hi, i'm kindof new to this, i've created a simple "hello world" applet! it doesn't seem to find the class! i've even put it in the bin dir of java. i'm using 1.4 error message in java console: Java(TM) Plug-in: Version 1.4.2_01 Using JRE version 1.4.

  • No General Ledger View for few FI documents

    Dear Friends, For few FI documents there is no General Ledger View.  What could be the reason for this ?? Regards Rakshita

  • Unit of measure 309

    Hi, I have the following issue. 1.one material A is procure with UoM KG after the GR. 2.same material A require  material to material transfer posting (MB1B 309 )to convert as material B having with UoM KIA which is selling unit of measure. but in SA