Using class generator
Hi to all.
My problem is about how to directly load an existing xml file in an in memory structure without building a procedure that creates node by node and put it in the tree.
Is this possible?
Is possible to use the binding mechanism given by the ElementFactory interface of the DOM specification( I think it is not, because the class CGNode does not extend a base class that implements the Element interface
and it seems that doesn't implement that interface itself)?
thanks for anyone paing attenction to my request.
I am aware of the type of input the Clas Generator accepts.
I have a DTD, let's call it "sample.dtd," and I need to use this DTD with the Class Generator. Can someone please show me how to instantiate the DTD object and use it with the Class Generator for Java? Thank you.
-Emad
null
Similar Messages
-
Hello,
I'm working on some java style interfaces for labview for hot swapping of instrumentation for design patterns. When I try to port this code, developed on Labview 8.5 back to labview 8.2, the code it generates crashes labview (both 8.5 and 8.2).
Included is a small snipet of the work that demonstrates this behavior.
It includes to classes:
untitledProject1 - the containing project (version 8.5)
FunctionGeneratorI - Similar to a Java style interface (A class with all Dynamic VI's with no useful functionality)
FunctionGenerator33220a - An intended implementation of Function generator (only a few functions implemented)
and a folder "labview8_2Distribution"
Which contains the port of the 8.5 code to 8.2.
To recreate the error:
A.
1. Open "labview8_2Distribution\Users\Laptop\Desktop\object\Untitled Project 1" (8.2 save)
2. Verify it crashes labview 8.5 and labview 8.2.
3. Watch labview crash?
B.
1. Open the "Untitled project 1" in the root directory. (Using labview 8.5)
2. Save the project as a labview 8.2 type.
3. Try to open the saved version with 8.5 and 8.2.
4. Watch labview crash?
Greg Sonnenfeld
Attachments:
error.zip 885 KBHello Karunya,
In regards to your questions:
>Can you post your code? Have you tested this by creating another project?
Do you have an xcontrols in your projects? Do you have typedefs? Do you
have a LVOOP constant on your block diagram? Are you also using Classes?
I cannot post the cost as it is way too big. Not really my code but a spaghetti code from a previous programmer. I think problems saving it to a previous version have to do with a few things:
1) Memory - I have 1 GB of RAM and I am running XP. I notice the available RAM dropping quickly as it is saving and then it blow up.
2) Long Filenames - The directory path of the original file is incorporated into the saved "previous version" of the code. While a good design, it does make the file/path a bit longer when saving
3) One of teh things it saves is the drivers and their menus. This is due to the drivers being in a subdirectory of the original code and not in the c:\program files\national instruments\labview 8.5\instr.lib directory. I saw this when I tried to save the file as an LLB.
4) If I work with smaller parts of the code without long paths, it saves fine.
There probably are xcontrols, definitely typedefs, no LVOOP's or Classes. Hope you can do something with all this. It just seems that converting to a later version of the code should be reversable. Thanks.
Michael -
ANN: XML Class Generator for Java Available
The Oracle XMCL Class Generator for Java is now available as an
initial beta release on the Oracle Technology Network at
http://technet.oracle.com. Select 'xml' from the Technology menu.
The XML Class Generator will generate a set of Java source files
based on an input DTD. 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. This is an early
beta release and has the following features:
* Creates Java Classes from DTDs to enable the programmatic
construction of XML documents.
* Supports validation mode to assist debugging.
* Works with the Oracle XML Parser in Java.
* Creates documents conforming to the W3C XML 1.0
Recommendation.
* Supports creating documents in the following encodings:
UTF-8
UTF-16
ISO-10646-UCS-2
ISO-10646-UCS-4
US-ASCII
EBCDIC-CP-US
ISO-8859-1
Shift_SJIS
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
nullThanks,
Rob
Oracle XML Team wrote:
: First, the link has been fixed. As to your access exception,
we
: have traced it to a difference between JDK 1.1.x and JDK 1.2.
: You can solve it by using a 1.1.x version of the JDK or wait
till
: our production version of our XML Parser becomes available
within
: a week which will work with 1.2.
: Oracle XML Team
: http://technet.oracle.com
: Rob Edagr (guest) wrote:
: : 1) The HREF on the download page for the NT version points
to
: : the version 102 parser not the classgen.
: : 2) After downloading and installing the classgen (by
guessing
: : what the url was) I ran it and get the following
: : C:\jdk1.2\xml\ora\classgen\sample>java SampleMain -root
: : wddxPacket wddx_0090.dtd
: : Exception in thread "main" java.lang.IllegalAccessError: try
to
: : access class oracle/xml/parser/XMLNode from class
: : oracle/xml/classgen/ClassGenerator
: : at oracle.xml.classgen.ClassGenerator.generate
(Compiled
: : Code)
: : at SampleMain.main(SampleMain.java:65)
: : Any idea on what the problem is (same error with sample dtd)
: : Rob
: : Oracle XML Team wrote:
: : : The Oracle XMCL Class Generator for Java is now available
as
: : an
: : : initial beta release on the Oracle Technology Network at
: : : http://technet.oracle.com. Select 'xml' from the
Technology
: : menu.
: : : The XML Class Generator will generate a set of Java source
: : files
: : : based on an input DTD. 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. This is
an
: : early
: : : beta release and has the following features:
: : : * Creates Java Classes from DTDs to enable the
programmatic
: : : construction of XML documents.
: : : * Supports validation mode to assist debugging.
: : : * Works with the Oracle XML Parser in Java.
: : : * Creates documents conforming to the W3C XML 1.0
: : : Recommendation.
: : : * Supports creating documents in the following
encodings:
: : : UTF-8
: : : UTF-16
: : : ISO-10646-UCS-2
: : : ISO-10646-UCS-4
: : : US-ASCII
: : : EBCDIC-CP-US
: : : ISO-8859-1
: : : Shift_SJIS
: : : Oracle XML Team
: : : http://technet.oracle.com
: : : Oracle Technology Network
: Oracle Technology Network
null -
XML Schema Class Generator Problem compiling generated java programs
Hi,
I ran oracg on the po.xsd schema from X3Cs XML Schema Part 0: Primer which successfully generated the java codes. I ran into problems when I compile the generated classes. Here's what I'm getting:
C:\oracle\xml\xdk\demo\java\classgen\Po2>javac -classpath ".;C:\oracle\xml/lib/xmlparserv2.jar;C:\oracle\xml/lib/xschema.jar;C:\oracle\xml/l
ib/classgen.jar;.;C:\Program Files\VicunaJ521\java\lib\collections.jar;C:\Program Files\VicunaJ521\java\lib\vicunalite.jar;C:\Program Files\
XConverter\XConverter.jar;C:\Program Files\XConverter\IDLGenerator.jar; c:\jdk1.2.2\lib\dt.jar;c:\jdk1.2.2\lib\jvm.jar;c:\jdk1.2.2\lib\tools
.jar;c:\oracle\ora81\jdbc\lib\classes12.zip;c:\oracle\ora81\jdbc\nls_charset12.zip;C:\oracle\xml\lib\classgen.jar;C:\oracle\xml\lib\xmlparse
rv2.jar" *.java
.\types\PurchaseOrderType.java:75: Type expected.
public void addComment(null.Comment thecomment)
^
.\types\Items.java:141: Type expected.
public void addComment(null.Comment thecomment)
^
2 errors
Running the demo which comes with oracles version of po.xsd was OK. What's the difference between the po.xsd from oracle and the po.xsd from W3C? Are there any W3C recommendation for XML Schema not supported by Oracle's class generator?Which po.xsd do you use? Would you post it?
Thanks. Here's the copy of the po.xsd from the W3C website. (http://www.w3.org/TR/xmlschema-0/#po.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Purchase order schema for Example.com.
Copyright 2000 Example.com. All rights reserved.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:element name="comment" type="xsd:string"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN"
fixed="US"/>
</xsd:complexType>
<xsd:complexType name="Items">
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="productName" type="xsd:string"/>
<xsd:element name="quantity">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USPrice" type="xsd:decimal"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="partNum" type="SKU" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Stock Keeping Unit, a code for identifying products -->
<xsd:simpleType name="SKU">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema> -
How to generate .xsd file using jaxb generated java files
Hi,
We need to upgrade our applicatio to jdk1.6 which has jaxb2.0 class files in it. Our application has java files generated from .xsd using jaxb1.0.2 version. At present we dont have .xsd or .xml file with us.
We decide to generate .xsd file by using jaxb1.0.2 generated java files. I tried using schemagen.exe given by jdk1.6 to generate .xsd file. It error out. Is there any other way to generate .xsd file ?
pls let me know.
thanks,
ThiruObject-XML mapping is a new feature in JAXB 2.0. Classes generated with JAXB 1.0 won't generate a schema.
Generate Java classes with JAXB 2.0 xjc.
http://www.theregister.co.uk/2006/09/22/jaxb2_guide/ -
ALV Reports using Class Methods
Hi Experts,
How can we generate ALV report using class and in that How can we define SLIS_EVENTS.
Can I provide all the that functionality the way I used to by calling FM
SLIS_ALV_REUSE_LIST_DISPLAY ?
- Like Header comment, event, data grouping , sort etc.
You may please send any url or document or any example.
Thanks in advance.
Regards,
Tushar ChoksiHi,
The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
programs as detailed below:
BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
The report checks the input value(s) semantically and provides protocol messages in case of error
BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
implement the saving of the new data.
BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
(1) how to define a column for editable checkboxes for an attribute of your list
(2) how to evaluate the checked checkboxes
(3) how to switch between editable and non-editable checkboxes
BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
Grid Control.
BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
are dealt with:
(1) how to replace the standard f4 help
(2) how to pass the selected value to the ALV Grid Control
(3) how to build an f4 help, whose value range depend on a value of another cell.
some links.
www.sapgenie.com
www.abap4u.com
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
download the PDF from following link.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Regards,
Satish -
XmlMarshalException on using XI generated Webservice with WebDynpro
Hi,
i have a problem creating a WebDynpro application using a WebService model created by XI.
When executing the service:
public void onActionGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionGO(ServerEvent)
try {
wdContext.currentRequest_MI_BESCHAFFUNG_MI_BESCHAFFUNGElement().modelObject().execute();
wdThis.wdFirePlugToMIBeschaffungResultView();
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException( e.getLocalizedMessage(), false );
//@@end
I get the following error message:
Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Property [DATA] of class [de.gisa.mibeschaffung.model.proxies.types.RFC_READ_TABLE] must exist and can not be null. This is required by schema description.
The classes generated by the WSDL import are prefixed by ComplexType. So could this be the culprit here? Also the generated classes are in the de.gisa.mibeschaffung package not in the de.gisa.mibeschaffung.model.proxies.types package.
I appreciate your input!
regards
DirkHow do you suggest converting those inputs?
Using a Netweaver Developer Studio generated model (from a
WSDL description in turn generated by XI) should shield one from the actual programming tasks required to do that.
Am i mistaken about that? -
Reusing classes generated by xjc
Hi,
I'am new to xjc and I'd like to know if there is a way to tell it not to generate classes
for certain schemas (maybe better to say namespaces) that I feed to it (let's say I give
it a couple schema files and they have dependencies between them)?
What I would like to do is to generate classes for certain namespaces, package
them to a jar and then supply them when generating classes for other dependent
schemas that need them, but do not generate the packaged classes again.
Is that possible?
Thanks in advance,
TomaszFlattening your schema definition will flatten the output files, too -- that will probably be nice for coding as well since you wont have to use class names such as SomeTypeNestedInAnotherTypeThatHasYetAnotherType. Instead of having all of the elements defined directly within the enclosing root element, define logical chunks at the top level and incorporate them in the definition of real root element of your documents by reference.
-
Differences between Robot class generated events and real input events
Hello everyone!
I'm having a problem with the translation of the description of the awt.Robot class.
- "This class is used to generate native system input events" -
Does this mean there is no difference between real input events and generated events from the Robot class? Difference in reference to that the generated events can't be recognized as generated events by the os or programs.
Thanks in advance.
Chris B.The Robot class will use an interface provided by the operating system to inject events. Those are very close to 'real' input events, but not quite there. There are, for instance, several games out there which have a protection mechanism against Robot's events to prevent scripting/botting. However, any application that is not paying special attention to the event's source will assume that the input events generated by Robot are actually coming from the user, so you can 'control' any application with the exception of the beforementioned games.
-
Help: Creating web service proxy using JAXB generated domains
Hi,
I'm currently doing some investigation considering the use of web services (BPEL) as a complete application backend.
The application should contain a pojo facade which communicates with some web service proxies. By making a datacontrol
of the pojo facade, I'm able to expose methods to the client layer.
I generated my domain objects by using the JAXB Compilation option in JDeveloper. By using that, a java class can be generated
based on an XSD. Disadvantage of this use, seems to be the fact that the ObjectFactory class, generated by JAXB, is overwritten
each time I create java classes from an XSD.
Q1: Is there a solution to prevent the ObjectFactory class to be overwritten? I also could decide not to use it.
After the domain objects are created, I want to call the actual webservice and receive the response by using the JAXB marshaller
and unmarshaller. Problem here is:
Q2: How do I (manually?) create a proxy which calls the web service, by using the domain objects generated by JAXB?
Q3: An important requirement is that it needs to be simple to switch from several environments (eg from development to test). How
can I fulfill this requirement in a nice, solid solution?
Any tips working with web services as the backend layer are welcome!
JDeveloper 10.1.3.4
ADF Faces/JSF
BPEL
Thanks,
Koen Verhulstrepost.
-
Classes generated for Human Task UI
Hi All,
I created ADF UI out of a human task (using Automatically generate form option). After generating, I can see lot of .xml files under the HumanTaskForm package, in the newly generated project. I would like to know the way in which these classes (Java Bean) are generated under the HumanTaskForm package.
Also, when I update some values in the UI page at runtime, I am able to see the change , in the response message of the HumanTask. I would like to know, from where the binding information come from, for those UI components, so that they are able to update!
Kindly give me some good documents that would explain me regarding the bean classes generated for HumanTask.
When I searched for the same, I could get the documents regarding the configuration of Human Task only. I need information regarding the Bean classes for Human Task.
Thanks,
Sabarisri. NPlease post on the Jdeveloper and ADF Forum where you will get more help
JDeveloper and ADF -
BADI - Diff. Class generated in Definition and Implementation
Hi all,
When we define a BADI, a BADI class is generated. When we implement the BADI, another class is generated.
1) What is the difference between these 2 classes?
2) As I know, we use the class generated in Implementation to instantiate and call the BADI method in our program. What about the class generated in Definition? What is it used for?
Thanks.I noticed that under Definition, the class generated is with cat= Exit class while under Implementation, the class generated is with cat= general object type. Both can be instantiated for use in ABAP program.
What is the difference/usage of these 2 generated classes? -
Class generated by genInterface ant task does not compile
I am trying to build a web service from existing wsdl using genInterface and topDownAssemble ant tasks.
The wsdl contains following type definition. Java class generated from this type (see below) does not compile. The problem is that there are two class members named
'value'. Is this an issue with Web Services Assembly tool or there is some way to get
around it?
<s:simpleType name="quantityType">
<s:restriction base="s:string">
<s:enumeration value="summation"/>
<s:enumeration value="demand"/>
<s:enumeration value="value"/>
<s:enumeration value="consumption"/>
</s:restriction>
</s:simpleType>
// Version = Oracle WebServices (10.1.3.3.0, build 070610.1800.23513)
public class QuantityType implements java.io.Serializable {
private java.lang.String value;
private static final String _summationString = "summation";
private static final String _demandString = "demand";
private static final String _valueString = "value";
private static final String _consumptionString = "consumption";
public static final java.lang.String summation = new java.lang.String(summationString);
public static final java.lang.String demand = new java.lang.String(demandString);
public static final java.lang.String value = new java.lang.String(valueString);
public static final java.lang.String consumption = new java.lang.String(consumptionString);
public static final QuantityType summation = new QuantityType(_summation);
public static final QuantityType demand = new QuantityType(_demand);
public static final QuantityType value = new QuantityType(_value);
public static final QuantityType consumption = new QuantityType(_consumption);
AndreiPls set debug attribute of JWSC ant task to true or on, e.g.
<jwsc srcdir="." destdir="${output.dir}" debug="on" keepGenerated="true">
</jwsc> -
XML C++ SDK Class Generator Question
Hello.
I have an XML schema definition file where some elements are defined inside other elements. When I generate classes for this schema I don't get classes for such elements (but only for the outermost level elements). How to use the class generator in this situation ? Do I miss something ?
Thank you.
MarkQuestions related to the XDK products should be posted in the Technologies -> XML -> General Forum. If you like I can move you post to that forum.
-
JAXB: Error compiling classes generated by xjc (file name too long)
Hi friends,
I am trying to compile classes that are generated by using XJC tool on xsd file. The compilation fails with following message.
buildxsdmodel:
[javac] Compiling 794 source files to /home/uchamad/working/teleworker/ejb/build/classes
[javac] /home/uchamad/working/teleworker/ejb/build/tmpsrc/uk/co/novatel/teleworker/model/wlr/bulksearch
results/impl/ApplicationInformationTypeImpl.java:58372: error while writing
uk.co.novatel.teleworker.model.wlr.bulksearchresults.impl.ApplicationInformationTypeImpl.XMLRequestID
TypeImpl.SearchOrderResultsTypeImpl.SearchTypeDetailTypeImpl.OrderTypeImpl.OrderDetailsTypeImpl.
OrderLinesTypeImpl.NumberPortingTypeImpl.OLODetailsTypeImpl.NumberLocationTypeImpl.OLOMainP
STN1AddressTypeImpl.Unmarshaller: /home/uchamad/working/teleworker/ejb/build/classes/uk/co/novatel
/teleworker/model/wlr/bulksearchresults/impl/ApplicationInformationTypeImpl$XMLRequestIDTypeImpl$S
earchOrderResultsTypeImpl$SearchTypeDetailTypeImpl$OrderTypeImpl$OrderDetailsTypeImpl$OrderLin
esTypeImpl$NumberPortingTypeImpl$OLODetailsTypeImpl$NumberLocationTypeImpl$OLOMainPSTN1A
ddressTypeImpl$Unmarshaller.class (File name too long)
[javac] public class Unmarshaller
[javac] ^
[javac] 1 error
The compiler is complaining about the file name being too long. This is happening because the java classes when generated from XSD contains deep nesting of inner classes. So when it comes to compile the .class name file is too long for the operating system.
I am trying this on unix box.
I wonder if there is a way to configure XJC so that it does not produce inner classes but instead keep them out.
Any help would be appreciated.
many thanks
UsmanganiFlattening your schema definition will flatten the output files, too -- that will probably be nice for coding as well since you wont have to use class names such as SomeTypeNestedInAnotherTypeThatHasYetAnotherType. Instead of having all of the elements defined directly within the enclosing root element, define logical chunks at the top level and incorporate them in the definition of real root element of your documents by reference.
Maybe you are looking for
-
Passing Javascript Enabled or Disabled value in a custom tag
Hi, In my JSP I am using a custom tag. This custom tag is having one attribute called status(whose value will be jsenabled means true or jsdisabled means false) depending on the browser's javascript enabled or disabled How can i find the value of jav
-
Ease of use from ver 2 to ver 8
A long time ago I bought Elements Ver 2 and could not understand it all and returned it. I am looking for a program to edit photos like fun stuff,,adding people to other picts, changing picture sizes for a group of picts (pixels/size/names/etc), ch
-
Error while uploading HR master data from inQuality server
Hi, Expert. While uploading of MAster data from Developement to Quality by BDC. When program starts for Tcode PA40, selecting Hiring Action, it is goining to the Action Screen. Here while taking the position from HR template, it gives error as Positi
-
Is my Power Mac G5 Compatible with SATA 2.0 or 3.0 Hard Drives?
Just curious if my old G5 can handle the new faster SATA ratings. The original installed hard drive is a standard SATA, but those are harder to come by and more costly than the newer SATA 1.5 Gb/s or 3.0 Gb/s rated hard drives. Any help would be grea
-
BAPI_PO_CHANGE is not changing the PARTNER NO.
Hello experts, I wanted to change the partner no. using BAPI_PO_CHANGE, in SE37, but its not working. It saying, 'Error transferring ExtensionIn data for enhancement CI_EKPODB'. Can you please help me? Regards, David.