Jabx xsd to classes and xml marshalling issues due to two namespaces

Hello everyone,
I am stack using jaxb and I ask for some help.
My final objective is being able of marshalling and unmarshalling xml-s that follows the structure of this xsd:
http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd
I have already generated the classes with xjc:
     xjc.bat VoIP3.5-A.0.1.xsd
This generates the following class tree:
parsing a schema...
compiling a schema...
org\ipdr\namespaces\voip\IPDRVoIPType.java
org\ipdr\namespaces\voip\ObjectFactory.java
org\ipdr\namespaces\voip\package-info.java
org\ipdr\namespaces\ipdr\IPDRDoc.java
org\ipdr\namespaces\ipdr\IPDRDocEnd.java
org\ipdr\namespaces\ipdr\IPDRType.java
org\ipdr\namespaces\ipdr\ObjectFactory.java
org\ipdr\namespaces\ipdr\package-info.java
Note that if you are behind a proxy and it is not configured it may fail.
This is fine for now. Next step, I have the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Assumptions:
Call is being made from cell phone to IP
Call is terminated (normally) by the called side
Optional and Conditional fields are included based on the type of call made
Fields that did not include specific values (in the ipdr spec) have been
populated with information based on SS7 equivalents
IMSI/ESN/PIN/HLRID values are fictitious -->
<IPDRDoc xmlns="http://www.ipdr.org/namespaces/ipdr"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd"
IPDRRecorderInfo ="apex.virtualsummit.com"
version="3.5-A.0.1">
<IPDR>
<seqNum>123</seqNum>
<IPDRCreationTime>2000-02-01T07:00:00Z</IPDRCreationTime>
<subscriberId>Vendor Phone-1</subscriberId>
<ipAddress>172.17.17.10</ipAddress>
<hostName>cisco.gateway.234</hostName>
<imsiIngress>247478674378574</imsiIngress>
<esnIngress>33375629401</esnIngress>
<serviceConsumerType>EU</serviceConsumerType>
<pin>6294621</pin>
<startAccessTime>2000-11-25T09:45:30Z</startAccessTime>
<startTime>2000-11-25T09:45:45Z</startTime>
<endTime>2000-11-25T10:00:30</endTime>
<timeZoneOffset>-480</timeZoneOffset> <callDuration>885</callDuration>
<type>V</type>
<feature>H</feature>
<incomingCodec>G711Alaw</incomingCodec>
<disconnectReason>normalCallClearing</disconnectReason>
<averageLatency>145</averageLatency>
<ani>214-924-0258</ani>
<originalDestinationId>408-830-3711</originalDestinationId> <ipAddressEgressDevice>199.171.210.211</ipAddressEgressDevice>
<portNumber>17779</portNumber>
<homeLocationIdIgress>FF01ABD6</homeLocationIdIgress>
<callCompletionCode>200</callCompletionCode>
<uniqueCallId>id45678</uniqueCallId>
</IPDR>
</IPDRDoc>
And I have the following classes:
public class main {
     * @param args
     public static void main(String[] args) {
          Manager mng = new Manager();          
          mng.marshall();
          System.out.println("Agur mundua!");
And:
public class Manager {
     public void marshall() {
          try {
               JAXBContext voip = JAXBContext.newInstance(
                         "org.ipdr.namespaces.voip", this.getClass()
                                   .getClassLoader());
               Unmarshaller u = voip.createUnmarshaller();
               // IPDRVoIPType po = (IPDRVoIPType)uvoip.unmarshal( new
               // FileInputStream("files/example.xml"));
               // IPDRType po = (IPDRType)uvoip.unmarshal( new
               // FileInputStream("files/example.xml"));
               // this implementation is a part of the API and convenient for
               // trouble-shooting,
               // as it prints out errors to System.out
               u
                         .setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
               // IPDRVoIPType structure = (IPDRVoIPType)u.unmarshal( new
               // FileInputStream(
               // "D:\\S3Lab-Projects\\Future Internet\\enviroment\\files\\example.xml"
               JAXBElement<IPDRVoIPType> st = (JAXBElement) u.unmarshal(
                         new StreamSource(new File("files/example.xml")),
                         IPDRVoIPType.class);
               IPDRVoIPType vtype = st.getValue();
               System.out.println("ok");
          } catch (JAXBException je) {
               je.printStackTrace();
It gives me an exception saying that there are unexpected elements.
If I use:
JAXBContext voip = JAXBContext.newInstance(
                         "org.ipdr.namespaces.ipdr", this.getClass()
                                   .getClassLoader());
JAXBElement<IPDRDoc> st = (IPDRDoc) u.unmarshal(
                         new StreamSource(new File("files/example.xml")),
                         IPDRDoc.class);
               IPDRDoc vtype = st.getValue();
I am able to read the attributes of IPDRDoc but not the ones from VoIP.
My analysis is:
     The xml file is a IPDRDoc with VoIP3.5-A.0.1 elements
     JAXB does not know how to deal with xml that are spitted in various classes
     I cannot change any xsd files because they are standars
So...
     What can I do to be able to marshall and unmarshall IPDRDoc xml with VoIP attributes generating the java classes from the standard xsd?
Thank you for your time

Hello everyone,
I am stack using jaxb and I ask for some help.
My final objective is being able of marshalling and unmarshalling xml-s that follows the structure of this xsd:
http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd
I have already generated the classes with xjc:
     xjc.bat VoIP3.5-A.0.1.xsd
This generates the following class tree:
parsing a schema...
compiling a schema...
org\ipdr\namespaces\voip\IPDRVoIPType.java
org\ipdr\namespaces\voip\ObjectFactory.java
org\ipdr\namespaces\voip\package-info.java
org\ipdr\namespaces\ipdr\IPDRDoc.java
org\ipdr\namespaces\ipdr\IPDRDocEnd.java
org\ipdr\namespaces\ipdr\IPDRType.java
org\ipdr\namespaces\ipdr\ObjectFactory.java
org\ipdr\namespaces\ipdr\package-info.java
Note that if you are behind a proxy and it is not configured it may fail.
This is fine for now. Next step, I have the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Assumptions:
Call is being made from cell phone to IP
Call is terminated (normally) by the called side
Optional and Conditional fields are included based on the type of call made
Fields that did not include specific values (in the ipdr spec) have been
populated with information based on SS7 equivalents
IMSI/ESN/PIN/HLRID values are fictitious -->
<IPDRDoc xmlns="http://www.ipdr.org/namespaces/ipdr"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd"
IPDRRecorderInfo ="apex.virtualsummit.com"
version="3.5-A.0.1">
<IPDR>
<seqNum>123</seqNum>
<IPDRCreationTime>2000-02-01T07:00:00Z</IPDRCreationTime>
<subscriberId>Vendor Phone-1</subscriberId>
<ipAddress>172.17.17.10</ipAddress>
<hostName>cisco.gateway.234</hostName>
<imsiIngress>247478674378574</imsiIngress>
<esnIngress>33375629401</esnIngress>
<serviceConsumerType>EU</serviceConsumerType>
<pin>6294621</pin>
<startAccessTime>2000-11-25T09:45:30Z</startAccessTime>
<startTime>2000-11-25T09:45:45Z</startTime>
<endTime>2000-11-25T10:00:30</endTime>
<timeZoneOffset>-480</timeZoneOffset> <callDuration>885</callDuration>
<type>V</type>
<feature>H</feature>
<incomingCodec>G711Alaw</incomingCodec>
<disconnectReason>normalCallClearing</disconnectReason>
<averageLatency>145</averageLatency>
<ani>214-924-0258</ani>
<originalDestinationId>408-830-3711</originalDestinationId> <ipAddressEgressDevice>199.171.210.211</ipAddressEgressDevice>
<portNumber>17779</portNumber>
<homeLocationIdIgress>FF01ABD6</homeLocationIdIgress>
<callCompletionCode>200</callCompletionCode>
<uniqueCallId>id45678</uniqueCallId>
</IPDR>
</IPDRDoc>
And I have the following classes:
public class main {
     * @param args
     public static void main(String[] args) {
          Manager mng = new Manager();          
          mng.marshall();
          System.out.println("Agur mundua!");
And:
public class Manager {
     public void marshall() {
          try {
               JAXBContext voip = JAXBContext.newInstance(
                         "org.ipdr.namespaces.voip", this.getClass()
                                   .getClassLoader());
               Unmarshaller u = voip.createUnmarshaller();
               // IPDRVoIPType po = (IPDRVoIPType)uvoip.unmarshal( new
               // FileInputStream("files/example.xml"));
               // IPDRType po = (IPDRType)uvoip.unmarshal( new
               // FileInputStream("files/example.xml"));
               // this implementation is a part of the API and convenient for
               // trouble-shooting,
               // as it prints out errors to System.out
               u
                         .setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
               // IPDRVoIPType structure = (IPDRVoIPType)u.unmarshal( new
               // FileInputStream(
               // "D:\\S3Lab-Projects\\Future Internet\\enviroment\\files\\example.xml"
               JAXBElement<IPDRVoIPType> st = (JAXBElement) u.unmarshal(
                         new StreamSource(new File("files/example.xml")),
                         IPDRVoIPType.class);
               IPDRVoIPType vtype = st.getValue();
               System.out.println("ok");
          } catch (JAXBException je) {
               je.printStackTrace();
It gives me an exception saying that there are unexpected elements.
If I use:
JAXBContext voip = JAXBContext.newInstance(
                         "org.ipdr.namespaces.ipdr", this.getClass()
                                   .getClassLoader());
JAXBElement<IPDRDoc> st = (IPDRDoc) u.unmarshal(
                         new StreamSource(new File("files/example.xml")),
                         IPDRDoc.class);
               IPDRDoc vtype = st.getValue();
I am able to read the attributes of IPDRDoc but not the ones from VoIP.
My analysis is:
     The xml file is a IPDRDoc with VoIP3.5-A.0.1 elements
     JAXB does not know how to deal with xml that are spitted in various classes
     I cannot change any xsd files because they are standars
So...
     What can I do to be able to marshall and unmarshall IPDRDoc xml with VoIP attributes generating the java classes from the standard xsd?
Thank you for your time

Similar Messages

  • URGENT controller class and XML file

    Hi there,
    I understand that oapagecontext.getParameter("FieldID") returns the field of XML. So for example in my xml i had this:
    <oa:messageTextInput id="AActiveTo" dataType="DATE" viewName="RoleAdminVO" prompt="Active To" viewAttr="ActiveTo" readOnly="${oa.RoleAdminVO.SecuredFlag}" columns="15"/>
    And on the front end I typed in "25-Aug-2006". My oapagecontext.getParameter("AActiveTo") should return "25-Aug-2005".
    However is this only true if I put oapagecontext.getParameter within my processFormRequest of the controller class which the XML is pointing to?
    Cheers

    Or you can apply a XSLT transform as per http://blogs.msdn.com/b/mattm/archive/2007/12/15/xml-source-making-things-easier-with-xslt.aspx
    Arthur My Blog

  • Touch and sync related issues due to write protected photo's

    i had a problem where the photo's in the directory that the touch was pulling from were write protected. once sync'd the ipod gets an error every time thereafter seemingly becuase the files synced were write protected. if you turn of the sync photo's option, the photo's remain so that does not help. so i had to do a restore of my ipod touch. a few comments about this process. turning of automatically sync when connected does nothing (and either does {ctrl}{Shift} when connecting). for some reason, if a "verify" starts on the ipod, even if you delete the sync history, it must verify. this makes no sense since you will have to wait hours (as i did) for the verify to complete just to restore the ipod. the next morning when i actually told the system that it was a new ipod instead of restoring from backup (which i assume would only put the write protected photo's back on the ipod) i did all the settings again, etc. painful! this bug needs to be fixed. write protected files should not screw up your ipod or syncing. one final question, are there and licensing ramifications on a restore with a new setup (instead of from backup)? the older ipod name still shows in devices. is it safe to delete the backup at this point?
    thanks
    harvey

    I do not recall anyone else specifically mentions this but other users have reported problems with wifi sync and maybe that was the reason.

  • Upgrade to MDEX 6.4.0 and RAD toolkit issues

    Hi,
    We are currently evaluating the 6.4 build for use with our web app and are having issues due to it being designed with the RAD toolkit for the 6.1.3 build of MDEX.
    Process.
    Upgrade of MDEX to 6.4
    Update the Reference App (normal not Rad) with the presentation API dll's
    Run Reference app and it works as usual.
    Upgrade current web app with Presentation API dll's and the fun started. (this pointed to needing to Upgrade to RAD Toolkit for 6.4 (RAD 2.1.3)
    Upgrade to RAD toolkit
    Upgrade all references to use the new RAD dll's
    now we get +"Error reading from the connection.The remote server returned an error: (404) Not Found."+
    After stepping through the code everything looks good. It points to the MDEX server @ port 16000 (which is exactly what the Reference App uses)
    At that point I decided it might pay to see if the RAD reference app would run.
    Configure iis7 to use the RAD reference app and Run the site.
    Set the input box's to point to our MDEX server and MDEX port and it returned the following error.
    An unexpected error occurred: Error reading from the connection.The remote server returned an error: (404) Not Found.
    at Endeca.Navigation.OptiBackendRequest.GetContent() at Endeca.Navigation.OptiBackend.GetNavigation(OptiBackendRequest req) at Endeca.Navigation.HttpENEConnection.Query(ENEQuery neq) at Endeca.Data.Provider.PresentationApi.CommandExecutor.ExecuteCommand(EndecaCommand command)
    Any ideas..
    Thanks in advance
    Edited by: 976760 on Jan 30, 2013 1:53 PM

    Hi ,
         I am facing the same issue.I installed the entire setup(mdex version 6.4.0,tools and frame work,platform services,RAD tool kit) and configured a project .The project runs fine in workbench and in the reference jsp application.But i am unable to connect it through the RAD tool kit.I get the same "Error reading from the connection.The remote server returned an error: (404) Not Found." error.
           Any kind of help would be highly appreciated.
    Regards,
    Raghvendra Panda

  • Creating a Java content tree from scratch and then marshal it to XML data

    Hi,
    After binding a schema using JAXB binding, I wrote a class to create a Java content tree from scratch and then marshal it to create an XML document. To see if the resulting xml document is correct, I opened it in XMLSpy and tried to validate it against the original schema.... I got the following error:
    "Unable to locate a reference to a supported schema kind (DTD, DCD, W3C Schema, XML-Data, Biz Talk) within this document instance"
    Then I realized that the generated xml document didnot contain the following for the root element:
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xsi:schemaLocation="....."
    i.e, the XML Schema Instance namespace and the schema location.
    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Thanks.

    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Add xmlns:xsi and xsi:schemaLocation attributes to the root element in the schema.
    <xsd:attribute name="xmlns:xsi"  fixed="http://www.w3.org/2001/XMLSchema-instance"/>

  • XML file in the form of .config file how to convert it to class and store it in single object

    Hi,
    I have a config file in which i have to convert it to class and get an object.
    example:
    <?xml version="1.0" encoding="utf-8" ?>
    <xyz xmlns="">
      <Container name ="Basic">
        <Connectivity user="" server="" protocol="udp"/>
        <Connectivity user="" server="" protocol="udp"/>
      </Container>
      <Container name ="Cp">
        <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
          <domain name="audio">
            <section name="headset">
              <setting name="audio_in_agc_enabled " value="1"/>
            </section>
            <section name="incoming">
              <setting name="use_agc" value="1"/>
            </section>
            <section name="vad">
            </section>
          </domain>
          <domain name="system">
            <section name="qos">
              <setting name="audio" value="tos 46"/>
            </section>
            <section name="dtmf">
              <setting name="force_send_in_band" value="0"/>
              <setting name="minimum_rfc2833_play_time" value="40"/>
            </section>
            <section name="network">
              <setting name="dtx_enabled" value="0"/>
            </section>
            <section name="diagnostics">
              <setting name="enable_logging" value="1"/>
              <setting name="log_level" value="Error"/>
            </section>
            <section name="general">
              <setting name="add_OS_version_to_user_agent_header" value="1"/>
            </section>
            <section name="indialog_notify">
              <setting name="enable_indialognotify" value="1"/>
            </section>
          </domain>
          <domain name="rtp">
            <section name="2833">
              <setting name="enabled" value="1"/>
              <setting name="packet_time_in_ms" value="60"/>
              <setting name="payload_number" value="101"/>
            </section>
            <section name="inactivity">
              <setting name="timer_enabled" value="0"/>
            </section>
          </domain>
          <domain name="proxies">
            <section name="proxy0">
            </section>
            <section name="proxy1">
            </section>
          </domain>
          <domain name="ggg">
            <section name="device">
              <setting name="use_headset" value="1"/>
              <setting name="rrr" value="1"/>
              <setting name="eee" value="480"/>
              <setting name="eme" value="hhh"/>
              <setting name="headset_name" value="vvv"/>
              <setting name="manual_audio_devices_configure" value="0"/>
              <setting name="audio_in_device" value=""/>
              <setting name="audio_out_device" value=""/>
              <setting name="ringer_device" value=""/>
            </section>
            <section name="system">
              <setting name="export_settings" value="EndpointSettings.xml"/>
              <setting name="enable_export_settings" value="0"/>
              <setting name="log_level_AbstractPhone" value="0"/>
              <setting name="log_level_Audio" value="0"/>
              <setting name="log_level_Auto Configuration" value="0"/>
              <setting name="log_level_CCM" value="0"/>
              <setting name="log_level_Conferencing" value="0"/>
              <setting name="log_level_Contacts" value="0"/>
              <setting name="log_level_DNS" value="0"/>
              <setting name="log_level_GUI" value="0"/>
              <setting name="log_level_Jitter" value="0"/>
              <setting name="log_level_Licensing" value="0"/>
              <setting name="log_level_Media" value="0"/>
              <setting name="log_level_Privacy" value="0"/>
              <setting name="log_level_RTP" value="0"/>
              <setting name="log_level_STUN" value="0"/>
              <setting name="log_level_Security" value="0"/>
              <setting name="log_level_Storage" value="0"/>
              <setting name="log_level_Transport" value="0"/>
              <setting name="log_level_USB Devices" value="Info"/>
              <setting name="log_level_Utilities" value="0"/>
              <setting name="log_level_Video" value="0"/>
              <setting name="log_level_Voice Quality" value="0"/>
              <setting name="log_level_XMPP" value="0"/>
              <setting name="log_level_Endpoint" value="6"/>
            </section>
            <section name="beeptone">
              <setting name="play_locally" value="0"/>
              <setting name="enable_beeptone" value="1"/>
              <setting name="beeptone_file" value="beep.wav"/>
              <setting name="beeptone_timeout" value="30000"/>
            </section>
            <section name="dtmf">
              <setting name="play_locally" value="1"/>
              <setting name="pause_start_stop_dtmf" value="100"/>
            </section>
            <section name="control">
              <setting name="auto_answer" value="0"/>
            </section>
            <section name="ctrol">
              <setting name="auto_ans" value="0"/>
            </section>
          </domain>
        </settings>
      </Container>
    </xyz>
    Please help me out in creating an object from it.
    Thanks,
    Hiranmayee

    It's one of those things you usually start from the other end.
    IE with a class and then serialise / deserialize to xml.
    Because you have a namespace in there:
    <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
    I think you will find linq to xml will have issues with that.
    You could still use xpath to pick data out of there and there's been a thread on the c# forum recently which is relevent:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/2dc0581e-f2fd-4fd3-89ee-e59280c398e6/read-xml?forum=csharpgeneral
    Why do you want to turn that into an object?
    By the way.
    This isn't a wpf question and you should probably have posted it on the c# forum.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • [svn:fx-trunk] 5844: rename classes (again!) per Ely's last recommendation to avoid XML Library issues

    A new discussion was started by Alex Harui in
    Commits --
    [svn:fx-trunk] 5844: rename classes (again!) per Ely's last recommendation to avoid XML Library issues
    Revision: 5844
    Author: [email protected]
    Date: 2009-04-01 17:59:34 -0700 (Wed, 01 Apr 2009)
    Log Message:
    rename classes (again!) per Ely's last recommendation to avoid XML Library issues
    QE Notes: Rename mustella tests again (please)
    Doc Notes: Update names of classes in documentation.
    tests: checkintests
    Modified Paths:
    April Fool!
    View/reply at
    Replies by email are OK.
    Use the unsubscribe form at
    to cancel your email subscription.

    In the default php.ini is set open_basedir which limits work with php only to few directories (and directories bellow them). There is set /srv/http, /home,/tmp and /usr/share/pear by default.
    To allow your vhost you should add /data/www or set empty value.

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • XSD/DTD Reference in XML ISSUE

    Hi,
    What I am trying to do. Lets say that I have an XML file on a machine locally, and I want to
    parse that XML file and validate it against a XSD that is determined dynamically or
    at runtime. What I am saying is that I have an XML file that may or may
    not have a schema reference inside its top root node, but either way what I am looking to do is
    to take this loaded XML file and set an XSD reference and then validate the XML file
    against that XSD file ?
    Even if I don't have to set the XSD reference within the XML file itself, I still need to validate it against
    a XSD that will be choosen at runtime.
    Any ideas out there ?
    Thanks,
    Wesley C. Maness
    [email protected]

    Thanks, for that but here is a continuation of the problem...
    </MISSION_MODE_FRAME>
    </MISSION_MODE>
    Error while loading mission mode MissionModeComposer.xml:
    no protocol: <?xml version="1.0" encoding="UTF-8"?>
    <!--
            XML file used in loading Composer as a mode.
    --><MISSION_MODE name="MissionModeComposer" resolution="1600x1200" swap="off" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\CMMU
    \SRC\data\modes\MM_XSD.xsd">
      <MISSION_MODE_FRAME className="missionMode.renderer.ChartFrameRenderer" height="590" main="true" scalable="true" title="MissionModeComposer" width="650" x="540" y="406"
    >
      <MISSION_MODE_VWS className="missionMode.renderer.ChartPanelVWSRenderer" height="0" name="chartPanel" swap="true" swapHandleColor="" width="0" x="566" y="566">
        <MISSION_MODE_COMPONENT Default="true" componentClassName="chartPanel" description="hey" maintainDisplayState="false" rendererClassName="null" resize="false" showImme
    diately="true">
        </MISSION_MODE_COMPONENT>
      </MISSION_MODE_VWS>What would cause the error seen above ?
    Wesley

  • Loading XML using a custom class and accessing it from other classes?

    I began with a class for a movie clip rollover function
    FigureRollOver. It works marvellously. Three things happen:
    1) it loads XML from a file "mod1_fig1.xml" and uses another
    class, XMLMember, to retool the scoping of the XML so that I can
    get at it
    2) an onload call inside of XMLMember calls the myOnLoad
    function and transfers the XML into an array.
    3) so long as the array is finished building, rolling over a
    movie clip attaches a new movie clip with the rollover text in it.
    But I don't want all those functions in one because I need it
    to be more dynamic, starting with being able to load any old xml
    file instead of just "mod1_fig1.xml", plus it seems like
    overbuilding to have all of that in one class, so I've separated
    out the loading of the XML and building of the array into its own
    class, FigureXMLLoader. FigureRollOver is then left to just attach
    the rollover with text in it, extracted from the array built by the
    new class.
    Problem is, though the array builds inside FigureXMLLoader, I
    can't figure out how to make it available outside the class. I know
    that I'm constructing things in the wrong order, and that the array
    needs to be somehow built inside the class function to be
    available, but I can't figure out how to do that. A cruddy
    work-around is to put a function call at the end of the building of
    the array, which calls yet ANOTHER function on the main timeline of
    my .swf to put the array I've just built into a new variable. This
    works, but it's messy. It seems like I should be able to have one
    line of script in the .swf that generates an array on the main
    timeline (or just a public array) which I can then access from my
    FigureRollOver class:
    var myRollOvers:Array = new FigureXMLLoader("mod1_fig1.xml");
    Here is FigureXMLLoader (see comments in the code for more
    details) which obviously does not return an array as it is, because
    of all the working around I've had to do. Note the "testing"
    variable, which can be traced from the main timeline of the .swf,
    but I will get "not what I want" because of course the array hasn't
    been built yet, and never will be, inside of the declaration as it
    is. How do I get it in there so I can return an array?
    Thanks!

    Suggest you ask this question in the Actionscript forum as
    this forum is
    more tuned to database integration questions.
    You can create arrays outside a class and pass them into it
    by reference and
    visa versa build arrays inside a class and pass out via
    reference.
    The preferred approach is to place the array in a class and
    not expose it.
    Then add methods to use the array or should we say to use the
    class.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "maija_g" <[email protected]> wrote in
    message
    news:ed4i43$9v0$[email protected]..
    > Update: I've now put this on the main timeline of the
    .swf:
    >
    > myRollOversLoaded = false;
    > var myRollOvers:Array;
    > var roll_content = new FigureXMLLoader("mod1_fig1.xml");
    >
    > And inside the "myOnLoad" function in FigureXMLLoader,
    just after the
    > while
    > loop I've put this:
    >
    > _root.myRollOversLoaded = true;
    > _root.myRollOvers = figure_arr;
    >
    > The movie clip rollover won't act until
    myRollOversLoaded is true. It
    > works,
    > but it still seems klugey. Any suggestions for a more
    elegant solution
    > would be
    > appreciated.
    >

  • Documentation for Oracle XML parser Classes and Interfaces

    I would like to use the oracle XMLParser V2 classes with JDeveloper 3.1, but I cannot find any reference documentation for the classes and interfaces in help.
    I am especially interested in a documentation for the XSLProcessor class. The only information I found was provided with the few provided samples.

    I don't think the javadoc for this was included in the release. You can get the Javadoc (as well as the latest version of the XML Parser v2) here on OTN.
    Take Care,
    Rob
    null

  • JNDI lookup couldn't find any objects in MBean class and -userThreads issue

    Hi,
    We had used some MBean classes in a jboss j2ee project. Now we need to migrate it to oc4j. We also need to use Thread class and jndi looking up in these MBean classes.
    I encountered two problems when I migrate these MBeans.
    1. The first problem is:
    If I create a InitialContext object just like the following:
    InitialContext result = new InitialContext();
    Then I lookup an ejb,I can't find anything from this InitialContext.
    However,If I create a InitialContext object just like below:
    Properties props = new Properties();
    props.put( Context.PROVIDER_URL, "***" );
    props.put( Context.INITIAL_CONTEXT_FACTORY, "***");
    //props.put( Context.URL_PKG_PREFIXES, "***" );
    props.put( Context.SECURITY_PRINCIPAL, "***");
    props.put( Context.SECURITY_CREDENTIALS, "***" );
    InitialContext result = new InitialContext(props);
    I can find that ejb. Why?
    Is it possible to get InitialContext just like InitialContext result = new InitialContext()?
    2. The second problem is:
    I had used a thread class to do the above mentioned jndi looking up in one MBean method. This method is not be invoked by oc4j EM. It is invoked by another class. There is an exception throws just like below:
    javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    I had add -userThreads argument in the startup command just like below:
    java -Xdebug -Xnoagent -Djava.compiler=NONE -Doc4j.jmx.security.proxy.off=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Dnl=en_US %JAVA_OPTS% %JAVA_SYSPROP% -jar %ORACLE_HOME%/j2ee/home/oc4j.jar
    -userThreads
    Does anyone know why there is an jndi problem in MBean class?
    Thanks,
    Eternal

    Hi,
    We had used some MBean classes in a jboss j2ee project. Now we need to migrate it to oc4j. We also need to use Thread class and jndi looking up in these MBean classes.
    I encountered two problems when I migrate these MBeans.
    1. The first problem is:
    If I create a InitialContext object just like the following:
    InitialContext result = new InitialContext();
    Then I lookup an ejb,I can't find anything from this InitialContext.
    However,If I create a InitialContext object just like below:
    Properties props = new Properties();
    props.put( Context.PROVIDER_URL, "***" );
    props.put( Context.INITIAL_CONTEXT_FACTORY, "***");
    //props.put( Context.URL_PKG_PREFIXES, "***" );
    props.put( Context.SECURITY_PRINCIPAL, "***");
    props.put( Context.SECURITY_CREDENTIALS, "***" );
    InitialContext result = new InitialContext(props);
    I can find that ejb. Why?
    Is it possible to get InitialContext just like InitialContext result = new InitialContext()?
    2. The second problem is:
    I had used a thread class to do the above mentioned jndi looking up in one MBean method. This method is not be invoked by oc4j EM. It is invoked by another class. There is an exception throws just like below:
    javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
    I had add -userThreads argument in the startup command just like below:
    java -Xdebug -Xnoagent -Djava.compiler=NONE -Doc4j.jmx.security.proxy.off=true -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Dnl=en_US %JAVA_OPTS% %JAVA_SYSPROP% -jar %ORACLE_HOME%/j2ee/home/oc4j.jar
    -userThreads
    Does anyone know why there is an jndi problem in MBean class?
    Thanks,
    Eternal

  • Errors generating Java classes from XML schema

    I received the following errors when generating Java classes from the schema located at: http://imsproject.org/xsd/ims_qti_rootv1p1.xsd and http://imsproject.org/xsd/ims_xml.xsd
    XML Spy v4 claims that the schema is well-formed and valid. Could this be a problem with the class generators, or is XML Spy not telling the truth?
    Thanks.
    D:\IMS_QTI\Java>java -classpath .;lib/xmlparserv2.jar;lib/xschema.jar;lib/classgen.jar oracle.xml.classgen.oracg -schema ims_qti_rootv1p1.xs
    d -outputDir src\com\icld\qti -package com.icld.qti -comment
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 235, Column 21>: XSD-2209: (Error) Duplicated definition for: 'attr.view'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 303, Column 21>: XSD-2209: (Error) Duplicated definition for: 'grp.labels'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -12236>: XSD-2209: (Error) Duplicated definition for: 'qtimetadatafield'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -9642>: XSD-2209: (Error) Duplicated definition for: 'typeofsolutionType'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 2252, Column -3019>: XSD-2026: (Error) Invalid attribute 'use' in element 'attribute'
    Error: Schema Class Generator failed to generate classes. oracle.xml.parser.schema.XSDException: Duplicated definition for: 'attr.view'

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    Which version are you using? I can't reproduce the error with 9.0.2B version.<HR></BLOCKQUOTE>
    Thanks for having a look at the problem. I am using the 9.0.2.0B version with Java 2 Standard Edition Build 1.3.1-b24. The classgen -version option returns 9.0.2.0b-beta - and xmlparserv2.jar and xschema.jar are from the same distribution. Running the corresponding DTD from the same source work fine - I'm just havinf this problem with the XSD. Anything else I should look at?

  • Class and package names

    I'm novice in Java, but not novice in programming. So, it is not a problem to understand and to write simple samples, but it is still hard to create a good package structure and give good names for classes.
    For example now, I started writing simple standalone application, which will be run by cron and will communicate with 2 webservices. I will receive data(reports) from one webservice, and will send this data to another one. From the very beggining, I have a poblem about structure of roject and naming. Is it ok, to make only one class, with name for example ReportApp? Or better create one class for communicating with first service, another - with second, and main class will call methods of this classes? Also package name... I think it is good, when from package you see, that i is service, or xml.util etc. How can I show in package name that it is batch standalone application? Can somebody explain what names for classes and packages he'll use for such task, please.

    Descriptive names are nice....
    For packages, a standard method is a domain name for your company or organization:
    com.widgetsRus.service.
    com.widgetsRus.ui.
    com.widgetsRus.util.
    As for class names, just descripe what the class is for. ReportServer, ReportClient, Report (interface), AbstractReport (implements Report), StatusReport (extends AbstractReport), etc...
    As for creating a class for this and that, or separate classes, that's a design issue, but typically, it's easier to maintain things if they are kept in smaller classes with related functionality.

  • Dealing with abstract classes and interfaces with XMLBeans

    I'm quite new to XMLBeans and would like some help. I've got things working when
    you are only saving concreate classes as XML, but when it comes to clesses containing
    interfaces I am running into problems.
    I basically have a collection of XY objects (see below) that I want to save as
    XML.
    I want to convert the following java classes to an xml schema:
    public class XY{
    X x;
    Y y;
    public interface X{
    void setA(int a);
    int getA();
    public interface Y{
    void setB(int b);
    int getB();
    public class X1 implements X{
    void setA(int a);
    int getA();
    //other data to save
    public class X2 implements X{
    void setA(int a);
    int getA();
    //other data to save
    public class Y1 implements Y{
    void setB(int b);
    int getB();
    //other data to save
    public class Y2 implements Y{
    void setB(int b);
    int getB();
    //other data to save
    What would be the best way to convert these to XML Schema? I've looked through
    all the XMLBeans documentation, but it doesn't say anything about dealing with
    interfaces/abstract classes. Is there anywhere else to look?
    Thanks in advance,
    Andrew

    Anurag,
    What I really wanted was a work-around to using substiutionGroups as substitution
    groups are not supported in this release.
    I want to convert the following schema:
    <xsd:complexType name="PublicationType">
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="Date" type="xsd:gYear"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType" >
    <xsd:sequence>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="MagazineType">
    <xsd:complexContent>
    <xsd:restriction base="PublicationType">
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Date" type="xsd:gYear"/>
    </xsd:sequence>
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="Publication" type="PublicationType"/>
    <xsd:element name="Book" substitutionGroup="Publication" type="BookType"/>
    <xsd:element name="Magazine" substitutionGroup="Publication" type="MagazineType"/>
    <xsd:element name="BookStore">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Publication" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    to produce an XML file like:
    <?xml version="1.0"?>
    <BookStore ¡Ä>
    <Book>
    <Title>Illusions: The Adventures of a Reluctant Messiah</Title>
    <Author>Richard Bach</Author>
    <Date>1977</Date>
    <ISBN>0-440-34319-4</ISBN>
    <Publisher>Dell Publishing Co.</Publisher>
    </Book>
    <Magazine>
    <Title>Natural Health</Title>
    <Date>1999</Date>
    </Magazine>
    <Book>
    <Title>The First and Last Freedom</Title>
    <Author>J. Krishnamurti</Author>
    <Date>1954</Date>
    <ISBN>0-06-064831-7</ISBN>
    <Publisher>Harper & Row</Publisher>
    </Book>
    </BookStore>
    What is the best way to do this without using substitution types?
    Thanks,
    Andrew
    "Anurag" <[email protected]> wrote:
    Andrew,
    Could you please paste/attach a sample of the code you are using to convert
    Java bean classes to XMLBeans?
    In the current release the goal of XMLBeans technology was to convert
    from
    XML Schemas or XML files to XMLBeans. The focus was not towards conversion
    of Java beans to XMLBeans.
    Regards,
    Anurag
    "Andrew" <[email protected]> wrote in message news:[email protected]...
    I'm quite new to XMLBeans and would like some help. I've got thingsworking when
    you are only saving concreate classes as XML, but when it comes toclesses
    containing
    interfaces I am running into problems.
    I basically have a collection of XY objects (see below) that I wantto
    save as
    XML.
    I want to convert the following java classes to an xml schema:
    public class XY{
    X x;
    Y y;
    public interface X{
    void setA(int a);
    int getA();
    public interface Y{
    void setB(int b);
    int getB();
    public class X1 implements X{
    void setA(int a);
    int getA();
    //other data to save
    public class X2 implements X{
    void setA(int a);
    int getA();
    //other data to save
    public class Y1 implements Y{
    void setB(int b);
    int getB();
    //other data to save
    public class Y2 implements Y{
    void setB(int b);
    int getB();
    //other data to save
    What would be the best way to convert these to XML Schema? I've lookedthrough
    all the XMLBeans documentation, but it doesn't say anything about dealingwith
    interfaces/abstract classes. Is there anywhere else to look?
    Thanks in advance,
    Andrew

Maybe you are looking for

  • Creation of ZRPA_MARM in Retail

    Hello! I have created new info-object ZRPA_MARM in retail BW project. I want to know when ever we create a new Bespoke info-objects, WHY all the related tables are created in local instead of storing transport request where info-object is stored. for

  • Selection Screen in Target Query in BEx RRI

    Can I get a selection screen when I am drilling down from source to target query. Thanks,

  • Animated bump map filter, how to ?

    Hi(Bonjour)! I want to animate on a path an small oval shape and use this shape as a bump map in a bump map filter ( or displace filter). The goal is to "push out" a small portion of my movie like if someone is pushing beneath the screen. The result

  • Facebook is broken in Safari

    I have updated to Mavericks and all the new bits to support it. That said, Facebook will not load in Safari. It works fine in Firefox and Chrome. I have reloaded, rebooted, emptied the cache and everything else I can think of, but it still hangs. Ide

  • BAPI for Clients

    Hello... I need a BAPI with functionality of registering and modifying clients on SAP R/3, currently we have SAP XI in our organization but we are only installing Finance and Controlling. Someone know about that? Thank you Alicia