Loading an xml file from an xml file

I'm trying to load an xml file from an xml file, but I'm
having problems. My first xml file is really simple - it only
contains one attribute with the name of another xml file in it
(eventually I will have multiple xml files in here and run a loop
on them...this is why I want to load an xml file from an xml file).
Currently, with the code below, I can get the main xml file
to load ("main.xml"), but I cannot get the secondary xml files to
load FROM the main.xml.
I want to then take childNode values from the secondary xml
file and use them within my .swf in text boxes and whatnot.
Any guidance? I think I'm going wrong on the line where I'm
saying "i.newxml.load(i.attributes.location);"
- How can I get this to work?

johnypeter:
I tried changing the code inside the loop to use just
"newxml" instead of "i.newxml", and I declared with "var newxml =
new XML();" - was this what you were thinking?
kglad:
The reason I tried to use the loadXML() function in the loop
was so that for each node in my "main.xml" it would load the new
xml file listed - this is a no-no? Do you have any ideas as to what
I could do?
For the for-loop, what should I change in it? I'm not great
with loops so I tried to modify some code from another loop I found
in another forum thread - not the right way to do it here?
Also, what should I trace? The value of the _root.address, or
i.attributes.location? I have created dynamic text boxes on my
stage to see if the correct value from the xml file loads (ie. the
name of the xml file within the xml file) and it does, but now I
don't know how to put that information into ANOTHER loadXML()
function and get the node information from it - does that make
sense???
Below are the examples of the xml files I am using. In the
first one, main.xml, I will have a list of multiple xml files, each
with the same nodes and elements as in the details.xml file
(different values, of course).
This is just to give you an example of what I'm trying to
accomplish - pulling ALL the addresses and phone numbers from
multiple xml files. I cannot manually collect this information, as
it is dynamic, and will be updated in each individual details.xml.
I was hoping to collect the information by simply adding to and
updating ONE xml file - main.xml.
Do you think this can be done? Am I going about it the wrong
way? I'm quite limited in AS knowledge, which is why I'm piecing
together code from other posts!

Similar Messages

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • Is there a way to run a script to create an RPD file from MDS XML files

    We would be interested in using the MDS XML format for the RPD file in saving it in our Subversion source code control system, and I have seen how to do this in the User documentation.
    Our question is whether or not there is a way to use a command line tool to recreate the rpd file without having to use the Admin tool, so that we can automate the deployment of the RPD file from source code control to QA and Production environments.
    If we check in the RPD file directly, then there is a way to automate the process, but we would prefer to use the MDS XML format since this allows us to save changes in text format, not binary, but we still need to be able to automate the process.
    In the Oracle Fusion Middleware XML Schema Reference for Oracle Business Intelligence Enterprise Edition document, I have found that there is a way to automate the creation of the MDS XML files from an RPD file using this command:
    biserverxmlgen -M -R repository_pathname [-P password] -D output_directory [-8] [-N] [-Q|-S]
    So my question is basically is there a way to reverse this process, to use some command line tool (or Weblogic Scripting or some other mechanism) to create the RPD file from the MDS XML files? Are there options on the biserverxmlexec command that will do what I am asking?

    Hey dmfairley,
    Thanks for the question. You can absolutely export the project as .mp3, as outlined in this resource:
    GarageBand Help: Export songs to disk
    http://help.apple.com/garageband/mac/10.0/#gbnd7cbf5ed9
    Export songs to disk
    You can export a project to your computer as a stereo audio file.
    Exported files can be reused in GarageBand to save processing resources by replacing or bypassing multiple regions, instruments, and effects. They can also be used with other music applications and devices, posted on the Internet (on a webpage, or in the iTunes Store, for example), added to an iTunes playlist, or uploaded to a mobile device such as iPhone or iPad.
    1. Choose Share > Export Song to Disk.
    2. To rename the exported file, select the name in the Save As field, then enter a new name.
    3. Choose a location to save the exported file from the Where pop-up menu.
    4. Select the format for the exported file (AAC, MP3, or AIFF).
    5. Choose the quality setting for the exported file from the Quality pop-up menu.
    6. Click Export.
    Thanks,
    Matt M.

  • How to get multiple html output file  from an xml document via xslt?

    Hi,
    the purpose is to generate multiple html output file from one xml file
    depending on special tag.
    exp: i have an xml file which contains sevreral articles so how to get each article section in an independant html file
    Thanks for help

    Not a standard feature of XSLT. But Michael Kay's XSLT implementation, SAXON, provides that as an extension. Get it here:
    http://saxon.sourceforge.net/

  • Loading  a database table from a UNIX file

    hi,
    Need A program to load a database table from a UNIX file
    thnks.

    HI,
    report zmjud001 no standard page heading.
    tables: z_mver.
    parameters: test(60) lower case default '/dir/judit.txt'.
    data: begin of unix_intab occurs 100,
    field(53),
    end of unix_intab.
    data: msg(60).
    ***open the unix file
    open dataset test for input in text mode message msg.
    if sy-subrc <> 0.
    write: / msg.
    exit.
    endif.
    ***load the unix file into an internal table
    do.
    read dataset test into unix_intab.
    if sy-subrc ne 0.
    exit.
    else.
    append unix_intab.
    endif.
    enddo.
    close dataset test.
    ***to process the data. load the database table
    loop at unix_intab.
    z_mver-mandt = sy-mandt.
    z_mver-matnr = unix_intab-field(10).
    translate z_mver-matnr to upper case.
    z_mver-werks = unix_intab-field+10(4).
    translate z_mver-werks to upper case.
    z_mver-gjahr = sy-datum(4).
    z_mver-perkz = 'M'.
    z_mver-mgv01 = unix_intab-field+14(13).
    z_mver-mgv02 = unix_intab-field+27(13).
    z_mver-mgv03 = unix_intab-field+40(13).
    to check the data on the screen (this is just for checking purpose)
    write: / z_mver-mandt, z_mver-matnr, z_mver-werks, z_mver-gjahr,
    z_mver-perkz, z_mver-mgv01,
    z_mver-mgv02, z_mver-mgv03.
    insert z_mver client specified.
    *if the data already had been in table z_mver then sy-subrc will not be
    *equal with zero. (this can be *interesting for you - (this list is
    *not necessary but it maybe useful for you)
    if sy-subrc ne 0.
    write:/ z_mver-matnr, z_mver-werks.
    endif.
    endloop.
    1. This solution is recommended only if the database table is NOT a standard SAP database table .
    Cheers,
    Chandra Sekhar.

  • Reading Java files from a EAR file

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    Maybe you can use java.util.zip.ZipInputStream to
    open the Ear and recursively to open the files in
    it; I'm not sure whether this will result in a full
    unpacking of the file in some temporary directory,
    though.
    Please let me know if it worked the way you wanted,
    I'm curious about it.This jerk just created the third thread about the same topic, because he didn't understand your suggestion, which I already provided earlier.
    http://forum.java.sun.com/thread.jspa?threadID=790015

  • Reading a Compressed File from a ZIP File, which is an entry of ZIP File

    Hello, Experts,
    Would it be possible somebody to help me with code example for the following problem?
    I want to read a compressed file from a ZIP file, which is an entry of ZIP File, without extacting/writing files on file system. Is this possible?
    Lets say we have a ZipFile1. There is ZipFile2 inside ZipFile1. And inside ZipFile2 is FileA. The scenario is reading FileA without extracting on file system.
    Thank you in advance for your help.
    Cheers
    RADY

    The classes you want to be using are java.util.zip.ZipInputStream and and ZipEntry from the same package. Construct the ZipInputStream with the input you have for the outer zip. Loop with ZipInputStream.getNextEntry until you find the inner zip you're looking for - that method returns a ZipEntry, and you get the name of the zip entry with ZipEntry.getName. Read the ZipInputStream from that point into some buffer, and read that buffer into a new ZipInputStream - rinse and repeat until you have the contents of the file in the zip in the zip...

  • How to create a .DLL file from a .C file ?

    Hi everybody
    I'm looking for a method how to create a .DLL file from a .C file .That Dll file will be used to perform a board to measure voice quality accoding to the international standard named PESQ (perceptual evaluation of speech qualty) P.862.
    Can anyone help to start dealing with Dlls and give some advices to avoid errors ?
    thx
    Attachments:
    source.zip ‏37 KB

    Hi sinaps,
    You mention that you want to create a DLL from a .C file. Just to clarify, are you using C (.c file) or C++ (.cpp) to write your code?
    Also, if you are using C++, are you using Visual Studio? (The reason I ask is because this forum is geared towards Measurement Studio, which is an add on to Microsoft Visual Studio).
    That being said,
    If you are using C: National Instruments provides an ANSI C Application Development Environment called LabWindows/CVI which makes building dlls a snap. It has templates for DLLs and you can build them either as stdcall or cdecl dlls.
    Developer Zone Tutorial: Building a DLL with LabWindows/CVI 8.5 for use with LabVIEW 8.5
    If you are using Visual C++: Look at the link that Al provided earlier.
    MSDN: Walkthrough: Creating and Using a Dynamic Link Library
    If you aren't using CVI or Visual Studio, then really the best bet is to do a google search for "Create C DLL" or post or a forum for the appropriate environment that you are using.
    Thanks!
    Message Edited by Jervin_J on 03-14-2009 02:02 PM
    Jervin Justin
    NI TestStand Product Manager

  • How to execute a  .sql file from a batch file

    Hi all
    I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
    now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
    i created a batch file prod.bak with the following lines
    @echo off
    set oracle_sid=testdb
    set oracle_home=d:\oracle\ora92
    sqlplus /nolog
    connect sys as sysdba/oracletest@testdb
    this batch file when eexecuted connects me to sql prompt.
    Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
    (i tried with these lines in the above batch file...
    call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
    start bkp.sql---same as call
    connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
    At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
    Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
    I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
    Thanks
    Tripti

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • How to make a jar file from a java file?

    how to make a jar file from a java file, is there any one tht can help me thank you;

    You can study this.
    http://java.sun.com/docs/books/tutorial/jar/basics/index.html

  • Trying to compile a .java file from another .java file

    Hello,
    I'm trying to compile a .java file from another .java file using Runtime.exec...
    String c[]=new String[3];
    c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
    Process p=Runtime.exec(c);
    If anyone can help me in atleast getting the command prompt when Runtime.exec("cmd.exe") is executed...that would be great...I tried out notepad.exe, calc, explorer instead of cmd.exe...all the commands display their respective windows..except cmd.exe...the command prompt doesnt appear...
    Please help me ASAP....
    Thanks for your help in advance...
    Regards.
    AKhila.

    try this. ur code will be compliled and will get .class file. but console won't appear. is it a must for u?
    public class Exec{
         public static void main(String a[]) throws Exception{
              String c[]=new String[3];
              c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
              Process p=Runtime.getRuntime().exec(c);
              // or Runtime.getRuntime().exec("javac Hello.java");

  • HT1353 How do I transfer files from my itune files to a MP3 player (It is aH2OMan for swimming)?

    How do I transfer files from my itune files to a MP3 player (It is aH2OMan for swimming)?

    How do I transfer files from my itune files to a MP3 player (It is aH2OMan for swimming)?

  • Java files from a EAR file and from inner (inside EAR)

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    Firstly Sorry to writing long letter. but i was unable to express my problem.
    see my code==============================
    JarFile jarFile = new JarFile("Demo.ear");
    Enumeration e=jarFile.entries();
    while (e.hasMoreElements())
    JarEntry entry=(JarEntry)e.nextElement();
    if (entry.getName().endsWith(".war"))
    // Then what Next to do...........
    ===========================================
    you have mentioned "theFile" , What is this?...............
    InputStream in = theFile.getInputStream(theEntryOfTheWAR);
    This line is not a compatible type casting in Java..........
    ZipOutputStream theWar = new ZipInputStream(in);

  • Java files from a EAR file

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    please help me
    I am waiting for ur response
    thanking you

  • How to call a function in one .js file from another .js file

    Hello Techies,
    I am trying to call a function in two.js file from one.js file.
    Here is my code
    one.js
    <script>
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
         function one()
                        var a;
                       two(a);
              }two.js
                  function two(a)
                          alert("two");
                      }But the function two() is not working.
    How can I do this one??
    regards,
    Krish

    I think there is a syntax error in line
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
    end tag <\/script> is wrong.

Maybe you are looking for

  • Display blinks on and off

    I'm using two displays with my G5. The primary display recently started blinking on and off when I used any "busy" web site, meaning a site on which images constantly change or text automatically updates. The problem occurs in both Firefox and Safari

  • Some clips jittery

    Hi Not sure if jittery is the correct terminology but when I have burnt a DVD teh clips from one camera are fine, from teh other there is jittery (or juddery) movement. All clips look OK in the Premier preview window and in the Encore preview. The Ca

  • Is my iCloud/ iPhone hacked?

    I suspect that my icloud account has been hacked on my iphone. I have reset my iphone to factory settings and deleted my old iCloud account and created a new one, but the phone still behaves oddly. Internet/WiFi isn't working as it should, apps that

  • Create Tabel having LONG Data Type

    HI Team, I want to create table but for table i have 2 LONG data type is throwing error message please give the light

  • Crash while reformatting

    Just now I reformat my mac, after I restored my backup from an external hard disk, it restarts and after that it hangs at the startup apple logo, I went out for dinner for 50 mins and it was still loading there, so I switched my mac off and on again,