Creating objects from .xsd
It is easy to construct objects in a oracle database that produce xml files with nested tables etc.
What i'm looking for is a utility that creates the pl/sql code for the construction of those objects from a .xsd file !
Anyone?
You and me both, eppo.
Supposedly 9iR2 has some tools that support this, but I don't know where to find them.
Similar Messages
-
Problem Create object from superclass
Hi,
I have a problem with classes:
I have one abstract superclass which has a method to create objecto for its children class.
CREATE OBJECT R_FLIGHT TYPE (l_class_name)
EXPORTING
i_sflight = l_sflight.
l_class_name: has the name of my children class
My children class has this properties:
A dump its triggered when I try to create object from the superclass.
Best RegardsHello,
I think that you defined the instantiation level of the superclass as PROTECTED & from the screenshot i can see that the instantiation level is protected & the class is marked as "Final".
Are you having a factory method which returns the instance of the abstract class & you use it to achieve polymorphism?
May be a little bit insight into your coding can help us
BR,
Suhas -
How to create object from Table?
Hi all,
Is there any command to create an object type from a table?
I i want to that command to create object type from emp table insted of typing the following command:
CREATE TYPE emp_t AS OBJECT
(empno NUMBER(6),
ename VARCHAR2(25),
job VARCHAR2(10),
mgr NUMBER(6),
hiredate DATE,
sal NUMBER(8,2),
comm NUMBER(2,2))
any help would highly be appriciated.
Thank you in advance,
AlirezaHi Jafar,
Thanks for your attention,
I dont want to create synonym,
I just want to create some Object types and work with XMLDB and create xsd or somthing like that using XMLDB packages.
I supose There shold be a simple way to do that.
Alireza -
Having trouble with creating objects from instances created with ClassLoade
Hi.
I'm having a bit of trouble with casting an instance of an object from a custom ClassLoader. Don't worry - the code isn't for anything sinister - it's for one of those life simulation thingies, but I want to make it modular so people can write their own 'viruses' which compete for survival. You know the score.
Anyway. I've got the beginnings of my main class, which seems to load the class data for all 'virus' classes in a folder called 'strains'. There is a abstract class called AbstractVirus which declares the method calls for how the viruses should behave and to get textual descriptions, etc. AbstractVirus is to be subclassed to create working virus classes and these are what my main class is trying to load instances of.
Unfortuantely, I can't cast the instances into AbstractVirus objects. The error I've been getting is 'ClassCastException' which I presume is something to do with the fact that my ClassLoader and the Bootstrap ClassLoader aren't seeing eye-to-eye with the class types. Can anyone help? This line of programming is really new to me.
My code for the main class is below:
/* LifeSim.java */
public class LifeSim {
public LifeSim() {
/* Get a list of all classes in the 'strains' directory and store non-
* abstract classes in an array. */
Class virusClasses[] = null;
try {
/* Get a reference to the file folder 'strains' and make sure I can read
* from it. */
java.io.File modulesFolder = new java.io.File("strains");
if (!modulesFolder.isDirectory() || !modulesFolder.canRead()) {
System.out.println("Failed to find accessible 'strains' folder");
System.exit(-1);
/* Get a list of all the class files in the folder. */
String virusFiles[] = modulesFolder.list(new ClassFileFilter());
if (virusFiles.length == 0) {
System.out.println("No virus strains in 'strains' folder");
System.exit(-1);
/* Create an array of class objects to store my Virus classes. Ignore the
* abstract class as I cannot instantiate objects directly from it.*/
virusClasses = new Class[virusFiles.length];
VirusClassLoader classLoader = new VirusClassLoader();
int j = 0;
for (int i = 0; i < virusFiles.length; i++) {
String virusName = "strains/" + virusFiles;
Class tempClass = classLoader.loadClass(virusName);
if (tempClass.getName().compareToIgnoreCase("strains.AbstractVirus") != 0) {
virusClasses[j++] = tempClass;
} catch (ClassNotFoundException ncfe) {
System.out.println("Failed to access virus class files.");
ncfe.printStackTrace();
System.exit(-1);
/* TEST CODE: Create an instance of the first virus and print its class
* name and print details taken from methods defined in the AbstractVirus
* class. */
if (virusClasses.length > 0) {
try {
// Print the class name
System.out.println(virusClasses[0].getName());
Object o = virusClasses[0].newInstance();
strains.AbstractVirus av = (strains.AbstractVirus) o;
// Print the virus name and it's description
System.out.println(av.getQualifiedName());
System.out.println(av.getDescription());
} catch (InstantiationException ie) { ie.printStackTrace(); }
catch (IllegalAccessException iae) { iae.printStackTrace(); }
public static void main(String args[]) {
new LifeSim();
class ClassFileFilter implements java.io.FilenameFilter {
public boolean accept(java.io.File fileFolder, String fileName) {
if (_fileName.indexOf(".class") > 0) return true;
return false;
class VirusClassLoader extends ClassLoader {
private String legalClassName = null;
public VirusClassLoader() {
super(VirusClassLoader.class.getClassLoader());
public byte[] findClassData(String filename) {
try {
java.io.File sourcefile = new java.io.File(filename);
legalClassName = "strains." + sourcefile.getName().substring(0,sourcefile.getName().indexOf("."));
java.io.FileInputStream fis = new java.io.FileInputStream(sourcefile);
byte classbytes[] = new byte[fis.available()];
fis.read(classbytes);
fis.close();
return classbytes;
} catch (java.io.IOException ioex) {
return null;
public Class findClass(String classname) throws ClassNotFoundException {
byte classbytes[] = findClassData(classname);
if (classbytes == null) throw new ClassNotFoundException();
else {
return defineClass(legalClassName, classbytes, 0, classbytes.length);
Thank you in advance
MorganTwo things:
I think your custom ClassLoader isn't delegating. In general a ClassLoader should begin by asking it's parent ClassLoader to get a class, and only if the parent loader fails get it itself. AFAIKS you could do what you're trying to do more easilly with URLClassLoader.
Second, beware that a java source file can, and often does, generate more than one class file. Ignore any class files whose names contain a $ character. It's possible you are loading an internal class which doesn't extend your abstract class. -
Unable to create object from stored procedure
Hi,
we are trying to use a stored procedure to do data preparation.
When we add the stored procedure to a universe, the procedure is executed succesfully and a table with one column, called "1" is created. When we try to create an object from this column, Designer does not allow us to do so.
We already tried to alias the column name in the stored procedure but we still get an unusable column called "1" back.
BO version used is XI R3.0. The stored procedure is written in Cobol on DB2 mainframe.
Does somebody know what we do wrong ?Problem solved.
First we aliased the result columns in the stored procedure, that got rid of the "1".
Then we still could not create an object based on the column in the result set.
Apparently this issue occurs when the length of the column of the result set is too long.
We decreased the length and now we can create the object -
Unable to create object from stored procedure universe
Dear All Experts,
I am facing a problem on unable to create object dimensions on a Stored procedure universe. Fyi, I have successfully insert a stored procedure ('SP_Sales') with input parameter (@date) into universe (Universe_1). But I unable create any object based on the the stored procedured ('SP_Sales') due to it show nothing from the Edit Select Statement of 'Object1', empty for Tables nd columns windows.
Thefore, i unable to drag data in WEBI when i select univese as "Universe_1", it will not sure any object. Please advise.
I am using XI4.0, MSSQL2008.Hi ,
You wont be able to edit the object definitions.
u2022 Designer generates one table per selected stored procedure (or many
tables if multiple result sets) and one object per column returned by a
stored procedure.
u2022 The result set structure is determined when you describe the function.
Please refer chapter 7(Page 451) of below document for more details.
[Universe Designer Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_designer_en.pdf]
Hope this helps.
Bilahari M -
Xmlbean Error while creating jar from XSD
Hi all,
I am using xmlbean technology while preparing jar from xsd i am getting the following error
"error: Could not load resource "http://dataservices.citigroup.net:8080/documentEngine/GMA/technology_area/CMM/Commons/1.0/Core-schema.xsd" (network downloads disabled)."
Please help meHi All,
I got the solution.
we have to add -dl in the script as args -
im trying to create objects based on number i input on a textbox
here is the image and code :
// Image
// codes
import flash.events.MouseEvent;
var circle:Shape = new Shape();
var i:int;
var j:int;
myBtn.label = "Show";
var a:Number = Number(text1.text);
myBtn.addEventListener (MouseEvent.CLICK,createCircle);
function createCircle (event:MouseEvent):void{
for (i = 1;i<=a;i++){
for (j = 1;j<=a;j++){
circle.graphics.beginFill(0xFF0000, 1);
circle.graphics.lineStyle(5, 0x000000);
circle.graphics.drawCircle(j*50 + j*20, i*50 + i*20, 25);
circle.graphics.endFill();
addChild(circle);
can someone help me ??
thanksi can apply the mc with tween already
but the circle create tweening when other circle create which i want it to stop when it finish and then the other circle tween
i try using array to the mc but i think i mess up in the code
can some1 help me ??
// here is the code
import flash.events.MouseEvent;
import flash.ui.Mouse;
import fl.transitions.Tween;
import fl.transitions.easing.Strong;
import fl.transitions.TweenEvent;
var i:int = 1;
var a:int;
var myMC:MovieClip = new MovieClip();
var myTween:Tween;
var myArray:Array = new Array();
myMC.name = "mc1";
myBtn.label = "Show";
myBtn.addEventListener (MouseEvent.CLICK,showCircle);
function timing (event:MouseEvent):void{
a = int(text1.text);
var myTimer:Timer = new Timer(500,a);
myTimer.addEventListener(TimerEvent.TIMER, createCircle);
myTimer.start();
function createCircle (event:Event):void{
a = int(text1.text);
myMC.graphics.beginFill(0xFF0000, 1);
myMC.graphics.lineStyle(5, 0x000000);
myMC.graphics.drawCircle(200, 150 + i*50 , 25);
myMC.graphics.endFill();
myArray.push(myMC);
i++;
function showCircle (e:MouseEvent):void{
a = int(text1.text);
var myTimer:Timer = new Timer(500,a);
myTimer.addEventListener(TimerEvent.TIMER, createCircle);
myTimer.start();
addChild (myMC);
myTween = new Tween(myMC, "x", Strong.easeOut, 50, 400, 2, true);
and the circle didnot restart when i input a new number to the inputbox
for example when i first input 3 in the textbox, it create up to 3 circle
when i change the number to 4 , the circle add 4 to the previous 3 circle rather than create new 4 circle
how do i solve this ??
thanks -
Hi,
Is it possible to create and populate XML from an XSD without knowing what the XSD elements are beforehand (all the examples appear to know what the input XSD will be, and therefore know what the set and get methods should be called)?
Can a user browse for an xsd to input, and the java will dynamically create the get methods, and be able to create instances and populate variables before converting to XML?
I have looked at JAXB and the purchase.order examples mainly, and it appears the input XSD was known before writing the java to populate the variables.
Thanks
JohnHi,
Is it possible to create and populate XML from an XSD
without knowing what the XSD elements are beforehand
(all the examples appear to know what the input XSD
will be, and therefore know what the set and get
methods should be called)? I think it is possible--you would have to recompile each time (unless you can dynamically recompile, which would be neat), but using the classes getMethod() function, you can list all the methods. You would then have to do some tricky logic to determine which of the getMethods you want (for example NOT getClass()), and you can basically call them in sequence. You also need to worry about handling lists & recursively call xxxType classes.
I'm experimenting with this, and it can get a little frustrating because there are a lot of odd cases to handle (for example, while setting the elements of a list, you need to actually get the list & add elements to it), but I think it's possible.
>
Can a user browse for an xsd to input, and the java
will dynamically create the get methods, and be able
to create instances and populate variables before
converting to XML?
What I'm puzzled about is where you'd get the data to populate the variables? Perhaps a database, or a bean? If you just want to make a test xml file, then it doesn't matter, but with real data, I think you'd still have to change how you actually get the variables you want to populate the xml file with, right? In other words, if your schema changed, the parameters you're passing to the set methods would change as well.
Maybe we'll see some more packages in the future to make this task easier. -
Creating XML from XSD, Only create The First Element
Hi,
I create a XML File from a xsd schema by this way:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setAttribute(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
factory.setAttribute(JAXP_SCHEMA_SOURCE, new File(MY_SCHEMA));
DocumentBuilder documentBuilder =factory.newDocumentBuilder();
documentBuilder.setErrorHandler(new SimpleDOMHandler());
Document parse = documentBuilder.parse(new File(MY_XML));The first lines of the schema:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://gencat.net/scsp/esquemes/peticion"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="Peticio" xmlns:p="http://gencat.net/scsp/esquemes/peticion">
<xs:element name="Apellido1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Apellido2">
.............................The problem is that the created document only have the first element "Apellido1". I dont know if it is a wrong xsd, or i'm using a bad way to do it.
Thanks a lot, and apologize for my englishHi,
Is it possible to create and populate XML from an XSD
without knowing what the XSD elements are beforehand
(all the examples appear to know what the input XSD
will be, and therefore know what the set and get
methods should be called)? I think it is possible--you would have to recompile each time (unless you can dynamically recompile, which would be neat), but using the classes getMethod() function, you can list all the methods. You would then have to do some tricky logic to determine which of the getMethods you want (for example NOT getClass()), and you can basically call them in sequence. You also need to worry about handling lists & recursively call xxxType classes.
I'm experimenting with this, and it can get a little frustrating because there are a lot of odd cases to handle (for example, while setting the elements of a list, you need to actually get the list & add elements to it), but I think it's possible.
>
Can a user browse for an xsd to input, and the java
will dynamically create the get methods, and be able
to create instances and populate variables before
converting to XML?
What I'm puzzled about is where you'd get the data to populate the variables? Perhaps a database, or a bean? If you just want to make a test xml file, then it doesn't matter, but with real data, I think you'd still have to change how you actually get the variables you want to populate the xml file with, right? In other words, if your schema changed, the parameters you're passing to the set methods would change as well.
Maybe we'll see some more packages in the future to make this task easier. -
Create object from a different location
I have a script object under Variables called Library. In it, I have a cat object:
function Cat(name) {
this.name = name;
this.talk = function() {
app.alert( this.name + " meow" )
I want to instantiate an instance of Cat from form.initialize.
If I do var myCat = new Library.Cat("Oscar"); I get exception.rman target /
catalog start with '/other/archivelog/location';
backup archivelog like '/other/archivelog/location/%' ... ; -
Creating objects from traced image for video
I want to take the traced star (and maybe the text) to use in a video project. I need to make individual objects that I can fill and animate in AE or Premiere. Is Illustrator the right app to use? And where is a tutorial on how this is done?
Alex,
The star is made of rather simple parts, and an obvious solution would be to recreate it using some of the Tools in the Rectangle Tool group and possibly the Pen Tool.
For the text, the easiest way would be to use the Type Tool; you may use similar fonts amng the countless ones available, or look for the exact font at sites like
http://www.identifont.com/
http://www.whatfontis.com/
http://new.myfonts.com/WhatTheFont/ -
Creating a XML file from XSD file
Is there a piece of Java code that will convert a file to XML using a XSD without the use of generated Java classes?
Thanks alot,
AmyI tried the link in asp.net but When I double click the exe it just pops off and goes.....How to use C# application......I am using Visual web developer 2005......please help in creating XML from XSD file
-
Setting the name of a new object from a string
Is there anyway I can set the object name of a newly created
object from a string?
eg.
(the code below generates a compile time error on the
variable declaration)
public function addText(newTxt:String, txt:String,
format:TextFormat):void {
var
this[newTxt]:TextField = new TextField();
this[newTxt].autoSize = TextFieldAutoSize.LEFT;
this[newTxt].background = true;
this[newTxt].border = true;
this[newTxt].defaultTextFormat = format;
this[newTxt].text = txt;
addChild(this[newTxt]);
called using>
addText("mytxt", "test text", format);
I could then reference the object later on without using
array notation using mytxt.border = false; for example
There are many a time when I want to set the name of a new
object from a string.
In this example I have a function that adds a new text object
to a sprite.
The problem is, if I call the function more than once then
two textfield objects will exist, both with the same name. (either
that or the old one will be overwritten).
I need a way of setting the name of the textfield object from
a string.
using
var this[newTxt]:TextField = new TextField()
does not work, If I take the "var" keyword away it thinks it
a property of the class not an object.
resulting in >
ReferenceError: Error #1056: Cannot create property newTxt on
Box.
There must be a way somehow to declare a variable that has
the name that it will take represented in a string.
Any help would be most welcome
ThanksUsing:
var this[newTxt]:TextField = new TextField()
is the right approach.
You can either incrment an instance variable so that the name
is unique:
newTxt = "MyName" + _globalCounter;
var this[newTxt]:TextField = new TextField();
globalCounter ++;
Or store the references in an array:
_globalArray.push(new TextField());
Tracy -
Hi all,
Can anyone tell me how to create an object of the class CL_BP_HEAD_CORPACCOUNTDET_CTXT .
Please reply as fast as possible.
Regards,
VijayHi Balasubramanian,
The below steps might help u out.
1. Call the function Create Object.
You have the following options:
¡ Choose Object ->New () in the main menu (or the pushbutton Create Object ).
¡ Position the cursor on a structure node in the navigation area and choose New () from the context menu.
In this case, there are already entries in the Create Object dialog, corresponding to the position of the cursor in the navigation area.
Integration Builder (Integration Directory): You have positioned the cursor on the Service node of a communication party. If you call the function Create Object from the context menu, there are already entries for the object type Service and the party field.
You cannot create objects of type RFC or IDoc again.
2. Enter the required information. Select the object type first and then specify the object key.
An input help is available to help you specify the key values. To call the input help, use the icon . The value selection offered by the input help may depend on which values have already been defined for the other key attributes.
Integration Builder (Integration Repository): The namespace selection depends on the selected software component version.
3. To confirm your entries, choose Create.
This calls the object editor for this object. The specifications that you made when you created the object are displayed in the header. You can edit the object further in the work area of the object editor.
Once you have confirmed your entries by choosing Create in the Create Object dialog, you can no longer change the object key.
Reward if helpful.
Thankyou,
Regards.
Maybe you are looking for
-
SSHR V4 upgrade err (oracle.jbo.NoDefException: JBO-25002)
SSHR V4 upgrade err (oracle.jbo.NoDefException: JBO-25002) We have recently applied patch 2111325, prequisites patches ,We have gone thru the README text and html files and did the neccessary changes. Created a sample test user with Employee Self-Ser
-
When i upgrade to leopard will it keep ilife
when i upgrade to leopard will i have to reinstall ilife or will it go straight from tiger to leopard?
-
Cant sign into Adobe Download Assistant Error 100 yet Internet connection strong
Continue to get Error 100 when I try to sign into Adobe Download Assistant. My Internet connection is strong. Able to visit any site
-
Keychain anguish - I'm stupid and here is the proof
Hi, I'm very stupid: on one of my 2 macs my user password is far too simple. I need to change it, at least change the password of the keychain which is the only thing that worries me. I dare not do it as I don't know the implications of changing eith
-
Unusable cause very slow automatic query
SQLdeveloper frequently freeze up for minutes in our development instances (EE 11.2.0.3), which have an huge amount of schema, objects and synonyms. Freezing is due to following query, I suppose automatically issued in order to discover accessible ob