Populating xmlclassgen classes from DOM/XML?

Can I use an XML document or a DOM to populate
classes generated by xmlclassgen (XML Class Generator for Java)?
http://technet.oracle.com/tech/xml/classgen/section.htm says:
"The generated Java source files can then be used to construct,
optionally validate, and print a XML document that is
compliant to the DTD specified"
but is there anyway to import an XML document and access
it through the API generated by xmlclassgen?
Thanks
Mats
null

Mats Strandberg (guest) wrote:
: Can I use an XML document or a DOM to populate
: classes generated by xmlclassgen (XML Class Generator for
Java)?
: http://technet.oracle.com/tech/xml/classgen/section.htm says:
: "The generated Java source files can then be used to
construct,
: optionally validate, and print a XML document that is
: compliant to the DTD specified"
: but is there anyway to import an XML document and access
: it through the API generated by xmlclassgen?
: Thanks
: Mats
Are you asking for the class generator to handle something like
xsl:import for the generated XML document to include?
Currently, no such functionality exists, but it can be
considered. Please describe in detail or pseudo code what
you're trying to do.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • Populating dropdown list from an XML file

    Hi!
    I want to prepopulate a dropdown list in a form from an XML file.
    Typically something like:
      A
      B
      C
    Is this the correct way to specify the list's values in XML?
    How do I specify the binding property of my dropdown list, to put the values A, B and C into the dropdown list?
    I am using Designer 7.0!
    Thanks!

    [email protected] wrote:
    > Hi!
    >
    > I want to prepopulate a dropdown list in a form from an XML file.
    > Typically something like:
    >
    >
    >   A
    >   B
    >   C
    >
    >
    >
    > Is this the correct way to specify the list's values in XML?
    > How do I specify the binding property of my dropdown list, to put the values A, B and C into the dropdown list?
    >
    > I am using Designer 7.0!
    >
    > Thanks!
    Liana,
       You can't do this with Designer 7.0.  If you upgrade to Designer 7.1,
    you can bind dropdown list values to your xml data using the dynamic
    property binding capabilities.
    Hope this helps!
       Justin

  • Generation of java classes from XML Schema.

    Hi All,
    I am working with JWSDP-2.0 but got stucked.:
    To generate Java classes from an XML Schema with the JAXB ,I need to have following jar file in thils location with this JWSDP-2.0
    <JWSDP>/jaxb/lib/jaxb-api.jar
    <JWSDP>/jaxb/lib/jaxb-impl.jar
    <JWSDP>/jaxb/lib/jaxb-libs.jar
    <JWSDP>/jaxb/lib/jaxb-xjc.jar
    <JWSDP>/jwsdp-shared/lib/namespace.jar
    <JWSDP>/jwsdp-shared/lib/jax-qname.jar
    <JWSDP>/jwsdp-shared/lib/relaxngDatatype.jar
    And here I m not finding as jaxb-libs.jar,namespace.jar and jax-qname.jar on respective location.
    If I m putting these left jar file from another place it is not generating all the classes as at least in number it should be 45 but it is generating merely 5 classes.
    Can any one help me regarding this.
    Regards.
    Shelly.

    These JAXB JAR files are for JAXB 1.0.
    For JAXB 2.0 the following JAR files are required.
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-api.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-impl.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-xjc.jar
    C:\Sun\jwsdp-2.0\jwsdp-shared\lib\activation.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\sjsxp.jar

  • How to produce Java class from xsd programmatically?

    As titled, I want to generage Java class/interface from xml schema via a program. There is a tool "xjc" that can do this manually.
    I saw a sample that generates xsd file from Java class programmatically, I am figuring out if there is such a API to do the similar thing vice versa.
    Thank you in advance!

    You may want to check out this Java EE 5 Tutorial: http://docs.oracle.com/javaee/5/tutorial/doc/bnbah.html
    It has an example of generating JAXB Java classes from an XML schema.
    Can you provide a sample xsd schema and the resulting Java class/classes you want to have produced?
    XMLBeans can use an xsd and generate Java classes for containing/manipulating XML objects, though I don't think that is what you are wanting.
    You can also write an XSLT stylesheet that generates Java classes based on parameters that you provide to the stylesheet but there is no xsd schema involved. We used this at a major national bank to produce Java classes for batch processing of files sent/received between the bank and third pary companies. The Java classes generated were used to read/write delimited files, xml files and fixed format files to/from Java bean classes with the necessary getters/setters for manipulating the data.
    Without a sample of what you are trying to doi it is hard to offer much help.

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

  • ERROR Could not create DOM from control.xml

    Hi All,
    I am installaing 4.7EE on Sun Solaris 5.9 SPARC with Oracle and JDK version is 1.4.2_08. When i am running sapinst, sapinst GUI opens and after when i am selecting the Central installtion and i click on Next it giving error message that
    WARNING Could not read file control.xml. Please make sure that you called SAPinst with the correct control file (the control file is given to SAPinst as its first command line parameter or as value of the command line property SAPINST_CONTROL_URL)
    ERROR Could not create DOM from control.xml
    How to solve this error. I have searched in SDN but i am unable to get the solution.
    Mahesh C

    Hi Kiran,
    I have given all permissions to the control file. But these control files are in different places /SAPINST/UNIX/SUNOS_64/PATCOL640/WEBAS630 and ORA, DB2, DB6, IND, INF, ADA in these folders i can c the Control.xml files. But i have given all read write and execute permissions but still its getting the same error. I have downloaded the same IM for 3 times and tried.. But the result is the same.
    Is there any other way of work around for this...
    Thanks
    Mahesh C

  • Is there any way to generate pdf from an xml file using single java class

    i m working on generating a pdf file from an xml file. i want to use only a single java class to do so. if theres any such code available please help me to find out.
    Thanks
    Gurpreet Singh

    exactly,
    here are some libraries which are open sources;
    http://java-source.net/open-source/pdf-libraries hope it's useful. :D

  • Load class from XML (Dynamic Dispatch)

    I'm continuing my voyage into the realms of LVOOP.....
    I have encountered a new problem which I am sure there's a solution to.....
    I have a certain hierarchy and I want to implement a single save and load routine for all objects int he hierarchy (located int he parent class of course).
    Using the "flatten to XML" I'm able to create some nice XML files with all parent and sibling information saved (as long as the values are non-default of course).
    Where I am running into problems is the loading of the data within this XML file.  I want to be able to take an object and basically re-initialise it to the values within the file.  All fine and good I thought, but it doesn't work.
    The problem is that when using the VI with Dynamic dispatch inputs, the output of the "Unflatten from XML" is giving me a conflict with the Dynamic dispatch output saying the obejct types do not  necessarily match.  Is it not possible to match the object type on the input and output of the "Unflatten from XML" primitive?
    If I try removing the "Dynamic Dispatch" input to a static input, then it only loads the data for the parent class regardless of the actual input class.
    Am I doing something silly here or is there no other way to properly load a sibling class from a file using only a method residing within the parent class?  I was hoping I could have a single "Save-Restore" function residing within my parent class to make life easier for me.
    Shane.
    Message Edited by Intaris on 06-17-2009 05:24 AM
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

    Hi Tst,
    Problem is that in order for the cast to yield any useful results, I have to make the inputs and outputs non-Dynamic which results in ONLY the data for the parent class being loaded.
    If the inputs and outputs are Dynamic, then a cast will not solve the problem (It could be a grandchild class being cast as a child, thus breaking the dynamic dispatch tables).
    The only solution I see is for the "UnFlatten from XML" to RETAIN the true object type.
    Either that or use my beautiful solution 
    Shane.
    Ps I just did a bit of a test of the race condition probabilities.  I ran 100000 tests (100k) with a program stressing both cores AND ram of my machine in parallel and all 100k of 100k iterations worked out OK.  I suppose that lets me think I should be in the range of at least 99.99%....... 
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Strip off the base64 content from an XML and saving the rest in streaming fashion using XML Reader Class.

    Hi,
    I'm presently working in a scenario, where i need to read an XML (having base64 encoded images) using XmlReader class in a streaming fashion (considering the performance) .
    1) I have to strip offs the base64 encoded contents from the xml (front & back image node).
    2) Than saving the remaining XML (without base64 content) . 
    Sample XML:-
    <?xml version="1.0" encoding="utf-8"?>
    <tran>
      <tranheader>
     <feild1></feild1>
      </tranheader>
      <item>
    <fields></fields>
        <image>
          <frontimage>base64_content</frontimage>
          <rearimage>base64_content</rearimage>
        </image>
      </item>
      <item>
        <fields></fields>
        <image>
          <frontimage>base64_content</frontimage>
          <rearimage>base64_content</rearimage>
        </image>
      </item>
      <trantrailer>
        <feild1></feild1>
      </trantrailer>
    </tran>
    Please guide.
    Thanks & Regards

    E.g. a simplified skeleton:
    namespace ConsoleCS
    using System;
    using System.IO;
    using System.Xml;
    using System.Xml.Linq;
    class Program
    static void Main(string[] args)
    XDocument xdocument = XDocument.Parse(@"
    <Items>
    <Item>Test with a child element <more/> stuff</Item>
    <Item>Test with a CDATA section <![CDATA[<456>]]> def</Item>
    <Item>Test with a char entity: &#65;</Item>
    <SkipItem>Item to skip.</SkipItem>
    <!-- Fourteen chars in this element.-->
    <Item>1234567890ABCD</Item>
    </Items>");
    StringReader stringReader = new StringReader(xdocument.ToString());
    XmlReader xmlReader = XmlReader.Create(stringReader);
    xmlReader.MoveToContent();
    while (xmlReader.Read())
    switch (xmlReader.NodeType)
    case XmlNodeType.Element:
    if (xmlReader.Name == "SkipItem")
    Console.WriteLine("Skipping..");
    else
    Console.WriteLine("Pushing to output ({0}).", xmlReader.Name);
    break;
    Console.WriteLine("Done.");
    Console.ReadLine();

  • Populating drop-down box from Server XML

    Hello all,
    I'm working on a REST - Lightroom interface, which I'm going to document as expose as a way for anyone to upload pictures to their site.
    Anyway, I need to populate a drop-down with the story names and ids from this XML. Any ideas? I'm a top actionscripter/ruby/etc, but not too familiar with Lua. Looks good though.
    1
    2
    Hope someone can help :)

    Hi there,
    I'm also facing an identical problem and would also like the solution. I've thought about using JavaScript in conjunction with JSP to populate the second drop down box dynamically. But first I need to retrieve the values in the first drop down box from a database and subsequently the 2nd drop down box - I'm thinking that a for loop needs to be used somehow. amishpg, I will let you know If I'm successful.
    Assad

  • Populating Text Fields from XML Based Drop Down

    Hello,
    I'm new to the Adobe Livecycle I have been challenged to make a PDF form that pulls information from an XML file.
    I have been able to get the from to read the XML file and I have successfully created a dynamic pull down, but what I am having a problem with is that when an item is selected in the dropdown I want it to pull other information stored in the XML file.
    <user>
      <csrName>MyName</csrName>
      <csrExt>123</csrExt>
      <csrFax>123-123-1234</csrFax>
    </user>
    <user>
      <csrName>MyName</csrName>
      <csrExt>321</csrExt>
      <csrFax>999-234-1322</csrFax>
    </user>
    My pulldown reads each csrName and I can select whom I want, but how do I get <csrExt> and <csrFax> to pull over for the correct <csrName>? I figured it needs to be done by some code during the "Change Event" but I have not figured out what code is needed.
    Any help is greatly appreciated, if anymore information is needed just let me know and I'll share what I got.
    Thanks
    Derrick

    Thanks for the reply.
    Right now I'm starting with a blank form and once I get my head wrapped around this then I was going to modify what is already in use.
    I'm attaching my scheme and xml file.
    Thanks!
    Derrick
    I get an error when trying to upload my schema. I am pasting the content of the file here. I call it proofout.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="userList" type="UserList" />
    <xs:complexType name="User">
      <xs:sequence>
       <xs:element name="csrName" type="xs:string" />
       <xs:element name="csrExt" type="xs:int" />
       <xs:element name="csrFax" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="UserList">
       <xs:sequence maxOccurs="unbounded">
        <xs:element name="user" type="User" />
        </xs:sequence>
        </xs:complexType>
        </xs:schema>

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

  • Pulling particular attributes from the XML Object

    Hi !
    My requirement is onChange of a value from the first drop down, particular values needs to load in the second drop down. Values that needs to pull are designed in XML Object as Map entries Key,Pair Values.
    We can pull the first drop down values from the XML Object using Rule library and find the following code snippet ;
    <block>
    <set name='appData'>
    <invoke name='getExtension'>
    <invoke name='getObject'>
    <ref>ctx</ref>
    <invoke name='findType' class='com.waveset.object.Type'>
    <s>Configuration</s>
    </invoke>
    <s>Config_SDD_ReferenceData</s>
    </invoke>
    </invoke>
    </set>
    <ref>appData</ref>
    </block>
    Here, Config_SDD_ReferenceData.xml is the file where the map entries are written and the ref name is appData. Later in BPE the code "appData.units" are referred in ValueMap property.
    But we are stuggling to populate the second drop down values based on the valu selected in the first drop down.
    Please find the XML Object also;
    <Attribute name='units'>
    <Map>
    <MapEntry key='1' value='units1'/>
    <MapEntry key='2' value='units2'/>
    <MapEntry key='3' value='units3'/>
    </Map>
    </Attribute>
    Thanks in advance.

    u could use removeChild() method of the node interface....get the parent node named 'xxxxxx' from the DOM and perform a removeChild operation on it specifying the senderID, receiverID and dateTimeStamp Nodes as arguments to the method....
    Hope this helps
    VP

  • Where are classes for oracle.xml.parser.v2?

    I have downloaded both V1 and V2 of the XML parser. I have managed to download the java classes under org.w3c.dom from www.w3.org but I can't find the classes under oracle.xml.parser.v2 (or without v2) anyway on technet. Both are required for import.
    I would have expected them to be in the ZIP files xmlparser_v1_0_2_0.zip and xmlparser_v2_0_2_7.zip but they don't seem to be. These contain the equivalent HTML files but not the class files themselves, so compiling the samples is not possible.
    Any help would be appreciated as this is becoming very frustrating.
    Thanks in advance
    Gary

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steve Muench ([email protected]):
    The xmlparserv2.jar in the 2.0.2.7 download contains everything you need from DOM and SAX interfaces in the jar.<HR></BLOCKQUOTE>
    Many thanks Steve - yes unzipping the jar file corrects problem.

  • Java API - Editor class for an XML schema

    Hi,
    i am very interesting in Java API. I would like to make an editor class for an XML schema. (I will create XML files in the current project based on this XML schema.) What step's are require for this editor class?
    Regards
    Gabor

    DavidThi808 wrote:
    jtahlborn wrote:
    you can provide a schema when parsing an xml document in order to check for schema conformance, but that isn't going to affect your XPath queries at all. DOM content is never anything but strings.In the case of both dom4j/jaxen and the .NET runtime the values returned from XPath queries when a schema is provided are typed. So you get back numbers, dates, and booleans as well as strings. And for numbers you get correct comparisons so 20 > 1.i guess it's possible. i use schemas when parsing xml, and i've used xpath (infrequently), but i'm not sure that i've ever used them together in a way that i would see functionality like that.
    FYI, you use http://docs.oracle.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#setSchema%28javax.xml.validation.Schema%29 to specify a schema while parsing with a DocumentBuilder.

Maybe you are looking for

  • Unable to refresh SQL Server data source through Data Management Gateway

    I just installed the version 1.1.5226.8 of Data Management Gateway and tried to refresh a simple query on a table connected to SQL Server, with no transformations in Power Query. This is the error I obtain: Errors in the high-level relational engine.

  • Can Atv1 and Atv2 sync with the same itunes library?

    I have imac running snow leopard.It was working perfectly well wit my Atv1. I decided to buy Atv2 for airplay function. Since I installed Atv2 icannot find my Atv1. What is more after resetting my Atv1 I cannot find it under 'Devices' in Itunes. It c

  • Running Oracle on Windows 2008 R2 64-bits and WCF

    I'm trying to deploy to a Windows 2008 R2 64-Bits server running AppFabric a WCF 4.0 service that connects to an Oracle 10gR2 database. On my Windows 7 64-Bits, inside Visual Studio 2010, everything goes well. I first started using Oracle ODP.NET and

  • MacBook Pro on Base?

    I just purchased a new 23" Cinema Display and was wondering if anyone using the foot of the display as also a place to put your PowerBook/MBP? Does anyone else do this? I guess its an odd question - but just wanted to see if this was a bad thing (alt

  • Delete key

    My delete key will not funtion since I downloaded the latest version. Any Help Please!!!!!