Getting from an xml file to an XMLBean argument to web service

I'm a newbie here, so I apologize for the lack of understanding, but the docs are
not helping me at all here.
I'm trying to write a simple SOAP client to call into a JWS (document style) generated
in Workshop and deployed in 8.1 SP2. The Web Service was in turn generated from
a Java Control with one method. That method took as an argument an XMLBean type.
After deploying my EAR, I downloaded the proxy jar and am trying to use that
to develop a client outside workshop to call into my web service.
ServiceTest_Impl proxy = new ServiceTest_Impl("<pathtoWSDL>");
ServiceTestSoap soap = proxy.getServiceTestSoap();
On that soap variable, I have a method:
validateLoanApp(LOANAPPLICATION arg)
LOANAPPLICATION exists as a class at com.foo.BAR.LOANAPPLICATION, and there's
a LOANAPPLICATIONCodec in the same package, and a com.foo.BAR.holders.LOANAPPLICATIONHolder
Now I have a file on disk that is an XML document. I'd like to read that file,
convert it to a LOANAPPLICATIOAN, and pass it to my method. I cannot for the
life of me figure out how to do this. The LOANAPPLICAITON class just has getters
and setters, and I don't want to have to go through the document and hand parse
it; there must be a way to do it automatically.
I see the deserialize method, but that is expecting a DeserializationContext,
which doesn't seem to have a constructor I can find. Any help here would be appreciated!
Thanks.

Michael, thanks for the quick reply. And crud. Unfortunately, this document is
huge and immensely complicated, so I was hoping to avoid using the getters and
setters for it by populating the Javabeans in some automatic way. I guess I'll
have to just send the doc as a String, and parse it in the client using the Factory.
Thanks!
"Michael Wooten" <[email protected]> wrote:
>
Hi Brian,
No, you won't have to "hand-parse" it, but something must :-)
Those Codec classes are JavaBeans, not XMLBeans, so you won't find a
method like
parse(String xml), on them. If this arg type is really an XMLBean type,
you should
have a .jar file in the APP-INF/lib director (under the directory for
your Workshop
app), which has it (a LOANAPPLICATIONDocument class) in it. You should
be able
to use:
LOANAPPLICATIONDocument mydoc = LOANAPPLICATIONDocument.Factory.parse(new
File("filename.xml"));
to parse (and validate) the file for you. Then you can just use the "getters"
on the mydoc object, with the "setters" on the LOANAPPLICATION class
from the
proxy .jar, to get the results you want.
For the record, it has been brought to the attention of the BEA engineers
(by
myself, and others), that there is a real desire to just use XMLBeans
with the
XXX_Impl and XXXSoap classes in the client proxy .jar, and they are working
on
this for a future release :-)
Regards,
Mike Wooten
"Brian Sensale" <[email protected]> wrote:
I'm a newbie here, so I apologize for the lack of understanding, but
the docs are
not helping me at all here.
I'm trying to write a simple SOAP client to call into a JWS (document
style) generated
in Workshop and deployed in 8.1 SP2. The Web Service was in turn generated
from
a Java Control with one method. That method took as an argument anXMLBean
type.
After deploying my EAR, I downloaded the proxy jar and am trying to
use that
to develop a client outside workshop to call into my web service.
ServiceTest_Impl proxy = new ServiceTest_Impl("<pathtoWSDL>");
ServiceTestSoap soap = proxy.getServiceTestSoap();
On that soap variable, I have a method:
validateLoanApp(LOANAPPLICATION arg)
LOANAPPLICATION exists as a class at com.foo.BAR.LOANAPPLICATION, and
there's
a LOANAPPLICATIONCodec in the same package, and a com.foo.BAR.holders.LOANAPPLICATIONHolder
Now I have a file on disk that is an XML document. I'd like to read
that file,
convert it to a LOANAPPLICATIOAN, and pass it to my method. I cannot
for the
life of me figure out how to do this. The LOANAPPLICAITON class just
has getters
and setters, and I don't want to have to go through the document and
hand parse
it; there must be a way to do it automatically.
I see the deserialize method, but that is expecting a DeserializationContext,
which doesn't seem to have a constructor I can find. Any help herewould
be appreciated!
Thanks.

Similar Messages

  • Error in Reading data from a xml file in ESB

    Hi,
    i created a inbound file adapter service which reads data from a xml file and passes it to the routing service and from there updates to the database.....
    (everything created in jdeveloper)
    But i am getting error....it is not getting updated to the database...when i check the database(select * from table) its showing one row selected but i couldnt find the data....
    Transformation mapping also i did...
    i think may be some error in reading the data from the xml file but not so sure.....
    please reply to this mail as soon as possible its very urgent

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

  • Need to insert values into a table from a XML file

    Hi,
    I'm an Oracle 9i/10g DBA with quite a few years experience, but I'm new to XML and dealing with it in database terms. I've been given a project that entails pulling XML values out of a file (or 100's of them) and storing them in the database so that they are searchable by end-users. The project is classified as secret so I'm unable to upload the specific XML or any info relating to the structire of the XML or the table I will use to insert the values into - sorry!! So, I've created an XML file with a similar structure to help people understand my predicament.
    The end-users only need to search on a subset of the total amount of columns from the table I'll insert data into, although the XML file has a lot more, so I dont need to store the other values - but I will need to store the name of the XML file (or a pointer to it so I know what XML file a particular set of values belong to) in another column of the table along with its associated values.
    I've been using the XMLTABLE function with some degree of success, although I had better succes using the XMLSEQUENCE function. However, I found out this is deprecated in 10g and replaced with XMLTABLE, so I guess it's better if I use this in case we ever need to upgrade to 11g.
    The main problem I've been having is that some elements in the XML files have multiple values for the one record when all the other records are the same. In terms of storing this in the database, I guess it would mean inserting multiple rows in the table for each element where the value differs. Here is a dumbed down XML file similar to what I've got along with the other SQL I've used:
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<House>+
    +<Warehouse>+
    +<WarehouseId>1</WarehouseId>+
    +<WarehouseName>+
    +<Town>Southlake</Town>+
    +<State>Texas</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>25000</Area>+
    +<Docks>2</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Street</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>2</WarehouseId>+
    +<WarehouseName>+
    +<Town>Poole</Town>+
    +<State>Dorset</State>+
    +</WarehouseName>+
    +<WarehouseName>+
    +<Town>Solihull</Town>+
    +<County>West Midlands</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>40000</Area>+
    +<Docks>5</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>3</WarehouseId>+
    +<WarehouseName>+
    +<Town>Fleet</Town>+
    +<County>Hampshire</County>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>10000</Area>+
    +<Docks>1</Docks>+
    +<DockType>Side load</DockType>+
    +<WaterAccess>false</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>20</VClearance>+
    +</Warehouse>+
    +</House>+
    CREATE TABLE xmltest OF XMLTYPE;
    INSERT INTO xmltest
    VALUES(xmltype(bfilename('XML_DIR', 'test.xml'), nls_charset_id('AL32UTF8')));
    Consequently, I need to...
    1) Retrieve the results from the XML file for all 3 warehouses where multiple values for the same sub-element are shown as 2 rowsthe result set. (I am guessing there will be 4 rows returned as warehouse sub-2 has 2 different elements for <WarehouseName>.
    2) Build a case statement into the query so that regardless of the sub-element name (i.e State or County), it is returned into the 1 column, for instance County.
    So, if I run a query similar to the following...
    select y.WarehouseId, y.Town, y.County, y.Area
    from xmltest x, xmltable('/House/Warehouse' .......
    I would like to get results back like this...
    ID Town County Area
    1 Southlake Texas 25000
    2 Poole Dorset 40000
    2 Solihull West Midlands 40000
    3 Fleet hampshire 10000
    Sorry for the non-formatting but I hope this all makessense to someone out there with what I'm trying to do.
    I appreciate any help whatsoever because, as i said before, I'm totally new to XML and trying to read the vast amount of information there is out there on XML is all a bit daunting.
    Many thanks in advance,
    Shaun.

    Hi again,
    Thanks for keeping the post open for me. I've had a look at the post illustrating the XFileHandler package, and tried to alter it to make it fit with my XML files. To help explain things, my XML file looks like this:
    <?xml version="1.0"?>
    <!DOCTYPE  CMF_Doc SYSTEM "CMF_Doc.dtd">
    <House>
        <Warehouse>
        <WarehouseId>1</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>House
        <WarehouseId>2</WarehouseId>
        <WarehouseName>
           <Town>Poole</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>3</WarehouseId>
        <WarehouseName>
           <Town>Fleet</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>4</WarehouseId>
        <WarehouseName>
           <Town>Dallas</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>5</WarehouseId>
        <WarehouseName>
           <Town>Dorchester</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>6</WarehouseId>
        <WarehouseName>
           <Town>Farnborough</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>7</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>8</WarehouseId>
        <WarehouseName>
           <Town>Bournemouth</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Shirley</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>30000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>9</WarehouseId>
        <WarehouseName>
           <Town>Clapham</Town>
           <County>London</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>And the XFilehandler package looks like this (I'm just trying to do a simple select only on WarehouseId & WaterAccess for the time being to keep things simple):
    create or replace package XFileHandler as
      TYPE TRECORD IS RECORD (
        WID     NUMBER(2)
      , WACCESS VARCHAR2(5)
      type TRecordTable is table of TRecord;
      function getRows (p_directory in varchar2, p_filename in varchar2) return TRecordTable pipelined;
    end;
    create or replace package body XFileHandler is
      function getRows (p_directory in varchar2, p_filename in varchar2)
       return TRecordTable pipelined
      is
        nb_rec          number := 1;
        tmp_xml        clob;
        tmp_file         clob;
        rec               TRecord;
      begin
        DBMS_LOB.CREATETEMPORARY(TMP_FILE, TRUE);
        tmp_file := dbms_xslprocessor.read2clob(p_directory, p_filename);
        LOOP
          tmp_xml := regexp_substr(tmp_file, '<\?xml[^?]+\?>\s*<([^>]+)>.*?</\1>', 1, nb_rec, 'n');
          exit when length(tmp_xml) = 0;
          --dbms_output.put_line(tmp_rec);
          nb_rec := nb_rec + 1;
        select y.WID, y.WACCESS
        into rec.WID, rec.WACCESS
        from xmltable('/House' passing xmltype(tmp_xml)
                      columns WID NUMBER(2) PATH 'Warehouse/WarehouseId',
                                  WACCESS VARCHAR2(5) PATH 'WaterAccess') y;
          pipe row ( rec );
        end loop;
        dbms_lob.freetemporary(tmp_file);
        return;
      end;
    end;Now, when I run the query:
    select * from table(XFileHandler.getRows('XML_DIR', 'XFileHandler_test.xml'));I get the error: ORA-00600: internal error code, arguments: [17285], [0x5CFE8DC8], [4], [0x45ABE1C8], [], [], [], []
    I had a look in the dump file for anything obvious, but nothing really stands out. Is there anything obvious in my code that I'm missing or something else which you may think could be causing this error, e.g in the regular expression regexp_substr?
    Many thanks,
    Shaun.

  • Using HTTPService to import data from a XML file

    Hello there!
    I'm having some problem's with this import... If anyone can
    help, I would appreciate it!
    I'm using this type of information as data source:
    public var dataCollection:ArrayCollection =
    new ArrayCollection([
    { id: "P1", name: "Porto", type: "team", children: [
    { id: "R1", name: "Dr Silva", location: "Bloco 1", type:
    "member" },
    { id: "R2", name: "Dra Neto", location: "Gabinete", type:
    "member"
    { id: "P2", name: "Braga", type: "team", children: [
    { id: "R3", name: "Dr Santos", location: "Bloco 2", type:
    "member" },
    { id: "R4", name: "Dra Sonia", location: "Piso 1", type:
    "member"
    But I want to import it from a XML file like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="P1" name="Porto" type="team">
    <children id="R1" name="Dr Silva" location="Bloco 1"
    type="member" />
    <children id="R2" name="Dra Neto" location="Gabinete"
    type="member" />
    </item>
    <item id="P2" name="Braga" type="team">
    <children id="R3" name="Dr Santos" location="Bloco 2"
    type="member" />
    <children id="R4" name="Dra Sonia" location="Piso 1"
    type="member" />
    </item>
    </items>
    I already import the file, but can not translate the data
    into a array collection.
    private function initApp():void {
    var httpService:HTTPService = new HTTPService();
    httpService.url = "dataprovider.xml";
    httpService.resultFormat = "e4x";
    httpService.addEventListener(FaultEvent.FAULT,
    onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT,
    onResultHttpService);
    httpService.send();
    private function onFaultHttpService(e:FaultEvent):void
    Alert.show("Error reading data file.");
    private function onResultHttpService(e:ResultEvent):void
    //Convert the xml data to a array collection
    Thank you

    Hello Peter, and thank you for your reply's.
    My problem is that I'm receiving the data from the external
    file and I don't know how to get the children in place... I mean, I
    also have some data being received form a file that I can convert
    into an array collection, but the thing is, that file doesn't have
    children structure...
    It's something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="T1" resourceId="R1" name="Cardiologia"
    startTime="25-3-09 8:0:0" endTime="25-3-09 8:30:0" />
    <item id="T2" resourceId="R2" name="Raio-X"
    startTime="25-3-09 9:0:0" endTime="25-3-09 9:15:0" />
    <item id="T3" resourceId="R3" name="Analises"
    startTime="25-3-09 12:0:0" endTime="25-3-09 12:45:0" />
    <item id="T4" resourceId="R4" name="Consulta"
    startTime="26-3-09 8:0:0" endTime="26-3-09 9:0:0" />
    </items>
    And I solve it with this (don't know if is the best):
    private function onResultHttpServiceTask(e:ResultEvent):void
    var a:Array = xmlListToObjectArray(e.result.item);
    tasks = new ArrayCollection(a);
    protected function
    xmlListToObjectArray(xmlList:XMLList):Array
    var a:Array = new Array();
    for each(var xml:XML in xmlList)
    var attributes:XMLList = xml.attributes();
    var o:Object = new Object();
    for each (var attribute:XML in attributes)
    var nodeName:String = attribute.name().toString();
    var value:*;
    value = attribute.toString();
    o[nodeName] = value;
    a.push(new ObjectProxy(o));
    return a;
    But when the children "enter in action" I don't know how to
    bring them to the array...
    This code you send it's preaty much the thing I need, but the
    thing is that I don't know how to call the children with data as
    e:ResultEvent...
    If you can help a bit more, I would really appreciate...
    Thank You

  • 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!

  • How can I reference a dtd in the Web-Inf directory from an xml file?

    Hi,
    I've placed my test.xml and test.dtd files in the following
    direcory (part of my web application)
    weblogic\config\MyDomain\applications\sample\Web-inf
    When I refer to the dtd from the xml file, as follows,
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE application SYSTEM "test.dtd">
    Weblogic tries to look for the dtd in the weblogic directory(the
    place where I started the server from). How can I get it to read
    the dtd in the Web-inf directory?
    I'm using Weblogic6.0 SP1 on Windows NT 4.0
    Thanks.

    Two options:
    1) Use SYSTEM "http://localhost:7001/sample/test.dtd"
    2) Or use XML registry in WLS6.0
    Cheers - Wei
    "Paromita" <[email protected]> wrote in message
    news:3aaff997$[email protected]..
    >
    Hi,
    I've placed my test.xml and test.dtd files in the following
    direcory (part of my web application)
    weblogic\config\MyDomain\applications\sample\Web-inf
    When I refer to the dtd from the xml file, as follows,
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE application SYSTEM "test.dtd">
    Weblogic tries to look for the dtd in the weblogic directory(the
    place where I started the server from). How can I get it to read
    the dtd in the Web-inf directory?
    I'm using Weblogic6.0 SP1 on Windows NT 4.0
    Thanks.

  • Create a list from an XML file    no display

    I have a multiline Dynamic text box called projList.
    I am trying to populate it from an xml file and create a
    clickable list.
    The trace works but cannot get to display the list in the
    text box.
    As far as the clickable goes, haven't gotten that far yet.
    Help very much appreciated.
    The xml is structured like this:
    <?xml version="1.0" ?>
    - <images>
    - <pic>
    <Image>/Butler/Images/sfah2_small.jpg</Image>
    <Category>Institutional</Category>
    <Proj_title>FRESH AIR HOME</Proj_title>
    Please see code below:
    import mx.xpath.XPathAPI;
    var allproj_xml:XML = new XML();
    allproj_xml.ignoreWhite = true;
    allproj_xml.onLoad = function(success:Boolean) {
    trace("onload...");
    if (success) {
    trace("success...");
    var thePath_str:String = "/images/pic/Proj_title";
    var title_array:Array =
    XPathAPI.selectNodeList(this.firstChild,
    thePath_str);
    for (var i:Number = 0; i < title_array.length; i++) {
    trace(title_array
    .firstChild.nodeValue);
    projList.addItem(title_array.attributes.Proj_title);
    } else {
    trace("error loading XML");
    allproj_xml.load("allimages.xml");
    stop();

    This did it:
    projList.addItem(title_array
    .firstChild.nodeValue);
    > Thanks for your response.
    > How can I add what I am tracing, to the component
    properly?
    >
    > "DMennenoh **AdobeCommunityExpert**"
    <[email protected]> wrote in
    > message news:eqaejh$bi8$[email protected]..
    >>>>trace(title_array.firstChild.nodeValue);
    >> projList.addItem(title_array
    .attributes.Proj_title);
    >>
    >>
    >> Your code seems OK. What you are tracing here
    however isn't what you're
    >> adding to the component. Are you sure what you're
    adding traces?
    >>
    >> --
    >> Dave -
    >> Head Developer
    >> www.blurredistinction.com
    >> Adobe Community Expert
    >>
    http://www.adobe.com/communities/experts/
    >>
    >

  • Reading rule sets from an XML file

    Hi all,
    How can I read rule sets from an XML file? I have been given some rules in XML
    format and using those I have to query some content. I am using WLP4.0
    Also how can I code rules in java?
    Thanks in advance.

    You can have the following classes:
    Players class deriving from Vector (or containing a vector), and then
    Player class with attribute 'name'.
    class Players
               Vector myVector = new Vector();
                void addPlayer(Player p)
                      myVector.add(p);
                Player getPlayer(int index)
                      myVector.get(index);
    class Player
             private String myName = null;
             Player(String name)
                    this.myName = name;
             String getName()
                    return myName;
    }Then while handling the SAX events you can do the following:
    class MySAXHandler implements ContentHandler (or whatever the itnerface is)
                 public void startElement(String name,....)
                          Players p = null;
                          if(name.equals("Players"))
                                 p = new Players();
                         else if (name.equals("Name"))
                                p.add(new Player(value));
    }HTH,
    Kalyan.

  • Importing Arabic text from an XML file

    Importing text from an XML file to appear as text in Flash
    works in English, however if the text I want to import is in
    Arabic, when I test the movie there is no text at all.
    Is there some particular syntax to preface the Arabic text?
    I'll want to import text from XML in other languages too.
    (French)
    I'd cut and pasted some Arabic text into the XML file that
    displays pictures and text in the "slideshow.fla" (
    http://www.adobe.com/support/flash/applications/jpeg_slideshow_xml/jpeg_slideshow_xml03.ht ml)
    Substituting Arabic text for English text, editing the XML
    file with Dreamweaver.
    Any ideas as to how I might achieve my objective of importing
    Arabic text into Fash?
    I'd started developing my prototpe in Macromedia Director 7,
    and then Director MX, but I have not found a suitable Arabic font
    that I can embed that will allow me to display Arabic fonts in
    Adobe Director. I have the Arabic text in a Word document.
    I've dicovered that my Flash MX Pro and Dreamweaver both
    support Arabic fonts, but I want to import text from an XML file.
    I'd prefer using cast libraries and cast members, but I don't
    know of an equivalent in Flash to what I'm comfortable with in
    Director.

    Oh so many questions. You probably aren't going to like the
    answers. I have Flash MX04 pro (aka Flash 7) and things made a big
    jump between MX (aka 6) and MX04. If you only have MX, there might
    not be a way to do this. All my advice is based upon MX04 or
    higher.
    It is possible to do complex languages in Flash. My
    experience is with Hindi and I've helped a few folks here with
    Arabic.
    You won't be able to use text from Microsoft Word – at
    least I don't think so. The XML file will need to be saved in the
    UTF-8 format. I think Word uses its own scheme and won't work. But
    I'm not a Word expert. Something like Text Edit (Mac) or WordPad
    (PC) should be able to save a UTF-8 file.
    The next problem is you mention "suitable Arabic font that I
    can embed." AFAIK, you can't embed any of the complex scripts in
    Flash. You just have to rely on the end user having appropriate
    fonts installed and enabled. Most operating systems from 2000 on do
    have this – although some folks like to remove them to save
    space.
    Next issue will be line composing. I've found that when using
    anything above the normal Latin range that Flash suddenly forgets
    how to make a line fit into a text area. It will just break things
    in the middle of words and not even notice the spaces between
    words. I've written a little snippet of code that "composes" the
    lines. It works well with Hindi and folks here have used it with
    Arabic and not come back saying that it doesn't work. Search the
    forums (both the Flash and Actionscript) if you can't find it I'll
    dig it out when I get home.
    So here is the checklist:
    Make sure the XML is saved in UTF-8
    Import the XML file
    In Testing environment go Debug–>List variables.
    Does it show up correctly there?
    Does it show at all in a text field?
    Use the "composer" to make the lines break.

  • Extracting from an xml file..

    hi.. i am required to write a program that extracts and perform certain calulations with stock numbers. I have been able to complete the calcuations part but need a little help(ideas, guildines) when xtracting stuff from a xml file that has six lines..
    <?xml version="1.0"?>
    <Portfolio>
    <Investment><Stock symbol="RY"></Stock><Qty>15</Qty><Comment>this is a good one; esp. the BookValue</Comment><BookValue>58.5</BookValue></Investment>
    <Investment><Comment>this is not "bad"</Comment><Stock symbol = "NT"></Stock><Qty>10</Qty> <BookValue>108</BookValue></Investment>
    <Investment><Qty>2</Qty><BookValue>45.75</BookValue><Comment>not sure about this; >= last time</Comment><Stock symbol= "BMO" > </Stock></Investment>
    </Portfolio>
    I'm not sure if this post will display properly but the correct format is this..
    Line 1: <?xml version=...
    Line 2: <Portfolio...
    Line 3: <Investment...
    Line 4: <investment...
    Line 5: <investment...
    Line 6: </Portfolio.....
    The stuff i'm supposed to extract are..
    RY 15 58.50
    NT 10 108.00
    BMO 2 45.75
    I am new to java and i am still beginning to realize the many methods that enable me to do this.. if anyone has any ideas please let me know.. thank you for ur time.
    (I'm not requesting actual coding..) Thanks again.

    Hey kk.. thanks for helping out but unfortunatly.. i can't use a parser like u.. since i'm taking an introductory course we're only limited to a number of classes to use(we're not suppoesd to know much we have to work with what we have). This is the coding i have so far..
    public class Test
    {     public static void main(String[] args)
         {     YorkReader reader = new YorkReader("pfxml.a1.xml");
              String line = reader.readLine();
              String tag = line.substring(0,7);
              String investTag = "<Invest";
              while (!tag.equalsIgnoreCase(investTag))
                   York.println(line);
                   line = reader.readLine();
                   tag = line.substring(0,7);
              while(tag.equalsIgnoreCase(investTag))
                   York.println(line);
                   line = reader.readLine();
                   StringTokenizer st = new StringTokenizer(line, "Stock");
                   String line1 = st.nextToken();
                   StringTokenizer stSymbol = new StringTokenizer(st.nextToken(), "\"");
                   String symbolS = stSymbol.nextToken();
                   York.println();
                   York.println(line1);
                   York.println();
                   tag = line.substring(0,7);
              reader.close();
    I've managed to get the program to skip lines that don't match the string "Invest" and once i get to invest i'm planning to use loop and extract the stuff i need out of the line.. but for some reason(IT'S DRIVING ME CRAZY).. is that when i try to use the Tokenizer class to parse out what i need.. it doesn't work. U see.. in the code i used the string "Stock" as the delimiter.. but when i check to see if the code is working it's not returning what i'm asking for.
    When i ask it to print out the first token it returns this..
    <Inves
    and when i ask for the second it gives me..
    men
    what is going on... argh.. i thought i had a great idea to do this too.. like wat i was planning was.. use "Stock" as the delimiter and get the string
    symbol="RY"></
    then use tokenizer again and use " as the delimiter to get the RY string which is what i want.. but for some reason it's not doing that.. if u have time could u take a look at my coding and let me know what's wrong?.. thanks a lot for ur help.. i really appreciate it.

  • Bursting from an XML file

    I have a BIP Report that I'm generating from an XML file. The XML file also contains the email addresses to which these reports should be bursted to. When creating the data model from the XML file, I have the option of defining my bursting options but it seems that "SQL Query" is only allowed option.
    Is it not possible to burst dynamically from an XML file?
    Could you show me how I can get this done. The docs haven't really been too helpful.
    Thanks

    Of course, this is possible. But what kind of "GUI XML" are you talking about? Is the XML given? Does it already conform to some GUI-XML-API? Give more infos!

  • Sliding Flash Interface - Using Links from an XML file Problem

    Hi All,
    Working on a new site for the company i've recently started
    working for... fairly new to flash but wanted to try this sliding
    interface for the graphic banner at the top of the page...
    have a look here at an early version of the site - sliding
    graphic interface at the top with coloured rollover buttons (a lot
    of work still to do! feel free to post constructive criticism)
    (am I allowed to post links??)
    here is the unfinished version with no links in the flash bit
    http://www.westfieldhealth.com/website/index.asp
    The Problem:
    I am pulling in a 'heading' 'text' and 'image' into the
    sliding graphic interface from the following xml file... (there are
    4 different xml files for 4 different slides)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <content>
    <dialogue>
    <heading>Interested in selling our health
    plans?</heading>
    <text>Click here to learn more...</text>
    <img>home_window/intSmall.jpg</img>
    </dialogue>
    </content>
    I want to add a link to the xml that would be specific to
    each instance of the window...
    eg
    <link>contact-us/index.asp</link>
    But my limited knowledge of flash means I have no idea how to
    pull the link through from the xml file to use in the flash...
    Perhaps I need link text to pull as well
    eg
    <link-text>click here to contact us</link-text>
    Here is the function that pulls in the img, heading and txt
    public function onComplete(event:Event):void {
    var loader:URLLoader = event.target as URLLoader;
    if (loader != null) {
    externalXML = new XML(loader.data);
    mover_mc.heading_txt.htmlText =
    externalXML.dialogue[0].heading;
    mover_mc.myText_txt.htmlText = externalXML.dialogue[0].text;
    var url:URLRequest = new
    URLRequest(externalXML.dialogue[0].img);
    myLoader.load(url);
    } else {
    trace("loader is not a URLLoader!");
    Can anyone help me on how to pull in the link from the xml
    and use it to navigate to a different page on the site
    Thanks very much
    Hans
    link to
    my unfinished flash file...

    What is the exact error you get (what db version also), could you post a simplified version of the SQL which fails also? I have splitter based maps that successfully read from file via the XMLType(bfilename....) style code and insert into multiple targets, I did this on 11g though.
    Cheers
    David

  • How to display Japanese text from an XML file

    Hiya,
    I have various adapted mp3 players [called playlists on my site] which retrieve the songs and song titles/artists from an XML file. One of them plays Japanese music.
    Most of the tracks are in English but I now have a couple of songs with Japanese titles and file names which I can't get to preview/display in Flash Pro CS5 [Mac]. I can type static Japanese text and it displays fine but Flash seems to be having a problem with the Japanese from the XML file.
    Though I can find the English titles, etc, it would be nice if there were a way to display Japanese text from a 'multi-lingual' [English and Japanese] XML file [probably something really easy].
    Thanks a bunch.
    steve

    This should help you:
    http://http://www.packtpub.com/article/working-with-xml-in-flex3-and-java-1http://www.packtpub.com/article/working-with-xml-in-flex3-and-java-1

  • Is it possible to extract the xpath for fields from a XML file

    Hi,
    After all we do the recording to capture the xpath of the fields, so i thought of extracting xpath from a XML file will be a good idea.
    Is there a way to do this?
    Please suggest
    regards
    Suresh

    Yes, there is.  Go to the Tools menu -> Generate XPaths and load in your xml file.  Select the element you are interested in and you will get the XPath to utilise.
    Regards,
    Jamie

  • How to generate GUI code from parsed XML file?

    hai,
    I have to generate GUI code after parsing any configuration XML file as input.Now i have parsed my XML file and got its attributed and i want to get some idea of how to map the parsed XML attributes to the java code to build GUI code.

    Hello,
    1. I like to create data type from a XML file structure, which contains the data structure ?
    XML fields will need to be taken note of to see which is repeating or not. You can also load the XML into a third-party tool such as Altova XML Spy and then generate an XSD from there. You will need to import the XSDs into PI under external definitions. However, this does not guarantee business interoperability, as such, it is always best to ask the provider for the XSDs or WSDL. It will also save you a lot of time from guessing which fields are needed or not.
    2. How to create custom node function in graphical mapping editor ?
    In your graphical mapping editor, on the lowest left corner, there is an icon there that says Create New Function. You must take into account their return types:
    1. Single Values = String
    2. Queue/Context (no return type) thus resultList is used.
    Hope this helps,
    Mark

Maybe you are looking for

  • CONTROLLING TIME OF STILL SLIDES IN IMOVIE

    WHEN I TRY INSERTING A DESIRED TIME FOR A SLIDE IN "CLIP ADJUSTMENTS" THE RESULT IS NEVER WHAT I ENTER. IF I ENTER 2 SECONDS, FOR EXAMPLE, I'M LIABLE TO GET 6S. IF I EXPERIMENT GOING DOWN IN SECONDS, I GET ALL THE WAY TO .1, AFTER WHICH IT WILL GO TO

  • Oem 12c metric threshold

    All, I have a question is it feasible at all to set up the warning and alert thresholds for the disk %busy to be 100% for a period of 3 hours for all servers as a default. After this time notificaction should be sent. Thanks, Marcin

  • Broken screen iphone 5

    Broke the screen on my iphone 5, he is under warranty, how to do?

  • Multiple Column selection in single selection

    I have made an report using Pivot table I have 6 Dim & 1 fact out of this I have placed 3 Dim in Pages tab of pivot table so that it will work like Prompt Now the user wants to swap the tables dynamically I have Column selector for this purpose but u

  • Measure heading display to left of measure instead of on top

    Can someone tell me how to move the measure headings to the left of the measure so it appears on the report as follows count of persons 1520 instead of count of persons 1523 I chose the third option radio button in the pivot table for 'column heading