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.
Mark
Questions 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.
Similar Messages
-
XML File Input to Generated Classes
Hi,
I looked at the Oracle Class Generator and used it to generate
some class files for a sample dtd schema that I had. Upon
looking at the classes that were generated, I saw only APIs to
construct instances thru regular means (providing values to
members) and APIs to print the XML representation to an output
stream.
However, I this functionality is not as complete as I expected it
to be. I expected the document class to include a constructor
that will simply take an XML document object and populate the
various members automatically. Is this functionality really
non-existent at this point ? Is it in the works ?
Let me know
Arun
nullYou are correct that the Class Generator does not have this
functionality at this time as our parser only can build DOM
trees. We have logged your enhancement request.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Arun (guest) wrote:
: Hi,
: I looked at the Oracle Class Generator and used it to generate
: some class files for a sample dtd schema that I had. Upon
: looking at the classes that were generated, I saw only APIs to
: construct instances thru regular means (providing values to
: members) and APIs to print the XML representation to an output
: stream.
: However, I this functionality is not as complete as I expected
it
: to be. I expected the document class to include a constructor
: that will simply take an XML document object and populate the
: various members automatically. Is this functionality really
: non-existent at this point ? Is it in the works ?
: Let me know
: Arun
null -
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> -
XML Parser, Class Generator demo problem
Hello,
I have downloaded today the XML Parser and the Class Generator. I have successfully compiled the SampleMain.java coming with the kit. When running it there is a problem with the expected DTD filename input.
The program prints out the needed format as:
Usage: java SampleMain [-root <rootName>] <fileName>
fileName Input file, XML document or external DTD file
-root <rootName> Name of the root Element (required if the input file is an external DTD)
Whatever I try as DTD filename input fails.
I work on Windows-NT!
I have tried running with JDK 1.1.7.a and JDK 1.2.2.
Thanks, Yigal.java SampleMain Widl.xml
or
java SampleMain -root WIDL Widl.dtd
Make you have Widl.xml and Widl.dtd are
in the current directory. Also, remember
Java is case sensitive.
If you are still getting errors, please
post the error message.
null -
IMPORTANT: XML Class Generator Feature Test
To Those of you who are using our XML Class Generator, we would
really like some feedback regarding your tests of the following
features:
1) validation -- turn it on/off with DTDs
2) character set encoding -- ask them to try different ones
3) DTDs -- included in the XML file and also have it as an
external DTD;
4) XML 1.0 conformance -- see if the XML documents created
conform to the spec;
5) print methods -- try them out
We would like to go production in the near future and need this
feedback.
Thanks,
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
nullPosted reply to:
Re: xml class generator NullPointerException when element type is base64Binary
-Blaise -
Where are the xml files for code generator of MSAHH5?
I'm generating source files for MSAHH5 and in the source code I can find xml files for generating all entities and DAL for those entities but I can't find anywhere files for MSATableConstants.xsl and MSAPersistanceManager.xsl and if I leave them alone they don't generate any class. I tried all xml in the code-generator folder without luck. What files should I use?
Thanks in advance.Hi,
I will answer your question in 2 parts.
1. Which files are used to generate what?????????
For entities: Entity.xslt+ Entity.xml
For MSATablesContants: MSATableConstants.xslt+
Entity.xml
For MSAPackageManager: MSAPackageManager.xslt+
Entity.xml
For DAL Generation: DAL.xslt+DAL.xml
2. Where these will be generated?????????
It depends on the path of the project that you are giving. If in the code generator tool when u make a new project give the path as the path of your project in eclipse.
Otherwise if you give path as ./ means the current folder from where you r running classgenerator.jar
you have to manually create folders like
C:\classgenerator\com\sap\crm\handheld\db\dataaccess for DAL classes and similarly for entities etc.
Hope this is clear
anubhav -
Hello,
I want know when the first version of Class Generator will be
released and the license agreements. Another question : at the
actual moment, can I utilize the Class Generator for commercial
purposes ? I've read the license, and I've understood this is
impossible until the new version will be released.
Thank you in advance
Rolando Ramieri
Agenzia ANSA Roma
nullRolando Ramieri (guest) wrote:
: Hello,
: I want know when the first version of Class Generator will be
: released and the license agreements. Another question : at the
: actual moment, can I utilize the Class Generator for
commercial
: purposes ? I've read the license, and I've understood this is
: impossible until the new version will be released.
: Thank you in advance
: Rolando Ramieri
: Agenzia ANSA Roma
There will be an announcement in a couple of weeks regarding
licensing. Right now it is only a development license.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
Loading and viewing XML when a class object is created..Help Please
Hello,
I have writing a simple class which has a method that gets invoke when the object of the class is created. I am able to view the loaded XML content when I trace it with in my class method, but cannot assign the content to a instance variable using the mutator method. So the process goes like this:
Class object is instantiated
Class construtor then calls the loadXML method which laods the XML
And then assigns the XML to a class instance variable.
So now if I would like to access the loaded XML through class object, I should be able to see the loaded xml content which I am not able to see. I have spent over few hours and cannot get the class object to display the loaded XML content. I would highly appreciate it if someone can help in the right direction, please.
[code]
package com.as3.app
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class Cars extends MovieClip {
public var _CarList:Object;
public function Quiz()
super();
loadCars();
// ===========================================================
// CARS GETTER SETTER
// ===========================================================
public function set Cars(val:XML):void
this._CarList = val;
public function get Cars():XML
return this._CarList;
// ===========================================================
// LOAD QUESTIONS FROM XML
// ===========================================================
public function loadcars()
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("xml/cars.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
Cars = myXML; // Assigning the loaded xml data via mutator method to the _CarList;
//=============================================================
INSTANTIATING THE CLASS OBJECT
//=============================================================
package com.as3.app
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import com.as3.app.*;
public class DocumentClass extends MovieClip {
public var c:Car;
public function DocumentClass()
super();
c = new Cars();
trace(c.Cars);
[/codewhere you have:
super();
c = new Cars();
trace(c.Cars);
c.Cars will not trace as the loaded xml, because it will not have loaded in time. After some time it should presumably have the correct value.
loading operations in actionscript are asynchronous, so your nested function which is acting as the listener ( function processXML(e:Event):void) only ever executes when the raw xml data has loaded and that is (I believe, not 100% sure) always at least one frame subsequent to the current one.
In general I would consider it bad practise to use nested functions like that, but I don't think its contributing to your issues here. I think its just a timing issue given how things work in flash....
Additional observation:
your Cars constructor calls loadCars() and your loadCars method is defined as:
public function loadcars()
I assume its just a typo in the forum that the uppercase is missing in the function name.... -
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 -
Schema Class Generator Problem
I'm getting this error msg when I do the following command line:
$java oracle.xml.classgen.oracg -s MySchema.xsd
<Line 455, Column -136>: XSD-2028: (Error) Invalid reference: 'http://www.w3.org/2000/10/XMLSchema:dateTime'
My XSD's header looks like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.5">
Any idea?
Thanks,
Peter ;-)
nullThe problem is due to missing "dateTime" in
class generator datatypes in 9.0.1. This will be updated and in 9.0.2beta (upcoming in few weeks) release.
null -
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 -
Hi
I found an example code for generating Java class based on the xml file.
i just want to know which package the following classes belongs to.Here the the classes
1. DTD
2.ClassGenarator
Thanks in advance
BalajiHi !
I am facing a similar problem
I am using classgen version 1.0.1.0.0
and xmlparser version 2.0.0.1.0....
everythings in the CLASSPATH...
I could compile the SampleMain.java in the classgen/samples directory .
But when i run it with any dtd or the provided widl.dtd i get the following error
XML Class Generator: Error Attribute Value should start with quote
Attribute Value should start with quote
at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:191)
at oracle.xml.parser.v2.XMLError.error(XMLError.java:97)
at oracle.xml.parser.v2.XMLError.error(XMLError.java:135)
at oracle.xml.parser.v2.NonValidatingParser.parseAttrValue(Compiled Code
at oracle.xml.parser.v2.ValidatingParser.parseAttr(ValidatingParser.java
:418)
at oracle.xml.parser.v2.NonValidatingParser.parseAttributes(Compiled Cod
e)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(Compiled Code)
at oracle.xml.parser.v2.ValidatingParser.parseRootElement(ValidatingPars
er.java:89)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingP
arser.java:181)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:142)
at SampleMain.main(SampleMain.java:45)
please help !
thanks
amit
null -
Classes generated start with "SMALL" letters
Hi,
For example if on the server side,
@WebService
public class CLASS1
public void getValue(CLASS2 cls2, CLASS3 cls3)
The generated classes..specially CLASS2 and CLASS3 are something like cLASS2 and cLASS3. Any way to control this??
Thanks,
VijayYes The classes generated on the client side start with small case letters.
I am using apt (is that wat u mean when u ask abt the tools?).
I start from java and when I look at the generated wsdl I do see the classes with small case letters.
I use jaxws with jaxb.
I am not sure If I answered your question abt the tools..please let me know.
Thanks a lot for your time.
Vijay -
XML Report Issue while generating the Report in EXCEL
Hi All,
I have Created the XML Report which will generate the output in EXCEL format. I am having the issue with the report output in EXCEL.
In my Case,
If I ran the concurrent it got completed normally and the output got completed normally and the output is generated successfully if the data for the input parameter combinations exists.
Issue is if there is no data exists for the combinations of parameters choosen then it gives the output in excel with the headers alone some times. (meaning there is no combinations of data exists for the input given excel is having headers alone).
wiseversa
sometimes the output in excel there is no header part too..(meaning the excel is empty/null).
Could anyone suggest how to resolve the issue so that the output in excel can include the header part if the data not exists for the input given. so that it should not generate the output as blank in excel i want the header alone should be included even if the report has no data for the input combination given.
Its very urgent issue.
Any suggestion will be a great help for me.
Thanks ,
Ravi.Hi,
Please see if this thread helps.
XML publisher output report in excel format
Re: XML publisher output report in excel format
Regards,
Hussein
Maybe you are looking for
-
A problem with SSLSocket handshake - verifying server entity
Hello, does somebody know how to "say" a server�s certificate is trusted in order to establish a SSLconnection? or How to register my keystore with such the certificate? something like that note: while i do a server�s socket there is no problem but w
-
About Fact and Dimensional tables
Hi I did not understand what what are fact and dimensional table. where we use them and how. Pl give with example. thanks
-
Hi! The configuration manager console shows the client is Active but when we try to connect to it using either "Remote Control" or "Remote Desktop Client", it does not work. Is it a known issue or the console is not updating the status of the clients
-
Premiere Pro CC 2014 RAM issues, audio dropouts and export failures
So I've upgraded to PP CC 2014, it worked fine for a while. Then I've noticed that while editing audio starts to dropout (I'm getting PP system message in the low right corner). I tried to dig up some info on the subject, but the only explanation I s
-
When I'm working on a painting and I switch to another of my monitors (i.e. Browser/ 3 Monitors) and then go back to photoshop sometimes the tools don't function anymore (the brushtool, eraser etc.) The cursor shows them being in use but they don't h