External class call in a XSL document ?
I'd like to use Xalan package to transform XML documents thanks to XSL documents. I've seen how to use these classes in the XML Tutorial, but does anyone know whether it is possible or no to define customized call in a XSL document ?
Exemple
<xsl:template match="ARTICLE">
<COMMENT >
{<b>com.myclass.mymethod(myargs)</b>}
</COMMENT>
</xsl:template>
Yes, you can. There's a section near the back of Michael Kay's book "XSLT Programmer's Reference" that describes how to do it. It's about three pages long and describes the various rules for calling constructors, static methods, and instance methods. It also talks about mapping between XPath data types and Java data types.
Too long to retype all that here, and then there's the copyright issue. And I don't want to summarize or excerpt it because you will probably need more information. If you're going to be doing serious XSLT work (and it sounds like you are) I would recommend you get this book, or one like it.
Similar Messages
-
Referencing Stage From External Class
I have an external class file that extends the MovieClip
class and is linked to a movieClip on the main stage. I need it to
be able to access properties of other movieclips on the main stage.
How could I do this. Here is what my base movieclip class that I
want to access the stage with looks like. Remember, it is linked to
a movieclip on the stage, if that matters...
Obviously there is more code in the class, but I removed it
for the sake of simplicity.that's what I thought too, but it's not working.
in my document class Main I tried
mc_bg:MovieClip = new mc_background();
then i tried passing the mc_bg MovieClip instance to the Background class.
That gives Error 1180: Call to a Possibly undefined method mc_background. -
How do I write an external class with global constants?
Hi you all !
First I want to explain what exactly I want to do:
I have an application that should run in different resolutions. The app runs fullscreen, and I don't use Layouts or something, just a single Frame with a Graphics Object.
Now to handle the different resolutions, I want to write an external class with some constants to use. The usage in my main Class should be something like this:
public
class blah
private Constants myConstants;
public blah()
if (highResolution)
myConstants = new hiResConstants();
else
myConstants = new loResConstants();
System.println(String.valueOf(myConstants.SCREEN_WIDTH);
}or somthing like that. The important fact is that I can choose the constants at runtime and that I am NOT forced to use methods to get the values, cause something like
System.println(String.valueOf(myConstants.getScreenWidth());sux if you have methods using 5 or more parameters.
Anybody out there who understood my problem and can help me??? PLEASE?
best regards,
SkippyFirst, what's so much worse about
System.println(myConstants.getScreenWidth());
than
System.println(myConstants.ScreenWidth);
Is the extra five characters really that bad? (Note
you don't need the String.valueOf method call.)Well actually it was a wrong example I gave here, but it's not the call that makes me shake but the implementation:
public int screenWidth = 1024;vs.
public
int getScreenWidth()
return 1024;
}Here it makes a bigger difference, even when you think of managing about 100 or even more constants.
Second, why do you have methods that take five or more
parameters!?Well, maybe this example show up what I mean:
if (cursorIsInArea(100,100,200,200,areaId))
doSomeStuff();Ok, I could use Rectangles here, but if you think of the timing here (I draw 30 frames / sec and this check comes about every frame or the animation would be choppy) I refuse to create an Object everytime I make this call.
Btw: Is it worth thinking about the time of execution like I did in this example? OO is a neat thing, but is it that fast?
I don't think isCursorInArea(new Rectangle(100,100,200,200),areaId) is such a great idea, but I might be wrong.
It sounds like you're trying to compound a bad design
with an even worse design for no good reason!Well, I'm not that experienced Java programmer to judge about that, but I (and my profs at university too) found my codes well structured and designed so far.
Skippy
PS: the string.valueOf(123) call came from cut&paste:
system.out.println(string.valueOf(number1)+string.valueOf(number2));Try this without the function.... ;-) -
How do you override global variable values when calling oraxsl or xsl.exe?
I am a newbie to oracle xslt.
I have down loaded the latest version of xdk (10.1.0.2...). (Jan 2, 2009).
In the past I haveI used micorsoft's "msxsl.exe" to perform my transformations.
I am looking for a more up-to-date transformation tool.
I found Oracle's version, and thought I would try it out.
I have run the "bin/xsl.exe -hh" command.
I read its help data. It states that variables are
passed by coding a pramater "-V <var> <value>".
I have also examined the oraxls.bat file.
I found the documentation on "oracle.xml.parser.v2.oraxsl" class.
It states that parameters are passed after the "-p" switch.
It says the value of the -p parameter is "a list of paramemters".
I don't find this sufficient information to be useful.
I can spend days guessing, and I might get lucky.
I thought it my be better to ask for help.
I need to pass in (override) values for 3 global variables.
I saw the method
"setParam(namespace, variable, value)",
near the documentation for the "oraxsl" class.
How do you format the options string to communicate more than one param statement?
(in either xsl.exe and/or oraxsl class).
Suppose I have an xslt stylesheet as follows:
==================================================
<?xml version="1.0" ?>
<xsl:stylesheet version="1.1" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:param name='a' select='"default_a"' />
<xsl:param name='b' select='"default_b"' />
<xsl:param name='c' select="'default_c"' />
<xsl:template match='/'>
this is value for a: <xsl:value-of select='$a' />
this is value for b: <xsl:value-of select='$b' />
this is value for c: <xsl:value-of select=$c' />
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
========================================================
Now as part of the calling of the XSL processor I want to change the value of these
three global parameters.
I want:
a="current_a",
b="current_b",
and c="current_c"
How do I express this using xsl.exe and its paramter string (-V ????).
and/or how do I express it to the oraxsl class ( -p (xsl, a,"current_a"), (....) )???
The syntax for specifying this information is not very clear in either situation.
Of course I am making the "assumption" that by "param" they are
refering to "global parameters" (as in my stylesheet), rather than some other global parameters of XLST.
As an aside inquiry:
I had hopped that the Oracle's xsl Verion 2 routine could handle xslt 2.0 commands
such as "xsl:for-each-group", since it handled multiple xsl:outputs.
From reading some of the documentation it seems it only handles xslt 1.0 syntax/commands.
Is this true? (or is the documentation not up-to-date?).
Any help on passing param values to xsl.exe and/or "oraxsl" class is appreciated.
Thanks.Here is the line from one of my testing .bat files that passed in one parameter. I can't recall if I've passed in two, but this will give you a starting point for passing in multiple
java -cp %CPath% oracle.xml.parser.v2.oraxsl -p show_image='yes' %ValXML% %ValXSLT% As for XSLT 2.0 support, it appears it does per {thread:id=503445} -
WL 6.1 to 8.1 XSL Error SAX Exception, Could not parse xsl document
1)I have an application which is deployed and running successfully on WL6.1. The application uses lot of xsl style sheets. Parsers used were from xalan.jar and xerces.jar
2)Now, I am migrating it to WL8.1, the application is deployed on 8.1 but when I open the login(first page) it gives the following error:
====================
ABCD.xsl; Line 0; Column 0
XSL Error: Could not parse C:/src/xslsheets/ABC4.xsl document!
XSL Error: SAX Exception
====================
3)As the previous versions of WebLogic Server included the unmodified versions of the Xerces parser and Xalan transformer from www.apache.org in the WL_HOME\server\ext\xmlx.zip file. The ZIP file no longer includes these classes and interfaces in 8.1.
4)I understand it is the the Parser Exception and wud like to know the best possible way to solve this.
Thanks
Val1)I have an application which is deployed and running successfully on WL6.1. The application uses lot of xsl style sheets. Parsers used were from xalan.jar and xerces.jar
2)Now, I am migrating it to WL8.1, the application is deployed on 8.1 but when I open the login(first page) it gives the following error:
====================
ABCD.xsl; Line 0; Column 0
XSL Error: Could not parse C:/src/xslsheets/ABC4.xsl document!
XSL Error: SAX Exception
====================
3)As the previous versions of WebLogic Server included the unmodified versions of the Xerces parser and Xalan transformer from www.apache.org in the WL_HOME\server\ext\xmlx.zip file. The ZIP file no longer includes these classes and interfaces in 8.1.
4)I understand it is the the Parser Exception and wud like to know the best possible way to solve this.
Thanks
Val -
Message Transformation Bean - Usage of external classes
Hi SDNers,
I am planning to write an external Java class to be loaded from AF_Modules/MessageTransformBean . The idea is simple, I want my class to handle an extra level of hierarchy in FCC process. I know writing the Java class which is as generic as the one provided by SAP is too complex. But I just want it for some specific requirements, so I dont intend to make it as a generic class.
Should the external class that I write implement the interface Transform? If so, what is the jar file that contains this interface and where can I find this jar file in my XI installation?
Also, what is the jar file that contains the standard class com.sap.aii.messaging.adapter.Conversion that gets loaded by default while using the MessageTransformBean?
If you have already tried with similar requirements, please share your experience on the same.
Thanks
JaishankarYou can use the same module in J2SE and J2EE adapter without change.
I recommend to install a J2SE adapter engine on a local PC for testing.
I have found a sample code from previous tests:
package sample;
import com.sap.aii.messaging.adapter.Parameter;
import com.sap.aii.messaging.adapter.trans.Transform;
import com.sap.aii.messaging.adapter.trans.*;
import java.io.*;
public class MyModule extends Transform {
Parameter parameter;
String filename;
public void init(TransformConfig config) throws TransformException{
super.init(config);
parameter = (Parameter) config.getParameters("Parameter");
filename = (String) parameter.get("filename");
// obligatory method service
public void service(TransformRequest request, TransformResponse response) throws TransformException {
// Get the input stream for request message
InputStream in = (InputStream) request.getMessage();
// Get output stream for response message
OutputStream out = (OutputStream) response.getMessage(Transform.MT_OutputStream);
try{
execute(in,out);
} catch (Exception e) {
throw new TransformException("TransformException: Error converting Message " + e.getMessage(), e);
public void execute(InputStream in, OutputStream out) throws Exception{
String filename = (String) transformConfig.getParameters("FileName");
if (filename == null){
filename = "notfound.txt";
// open file stream
OutputStream fileOut = new FileOutputStream(new File(filename));
// copy input stream to output stream and to file
int c;
while ((c = in.read()) != -1) {
fileOut.write(c);
out.write(c);
// main Methode, for local testing. A local XML file is expected.
public static void main (String[] args) {
try {
// Define Input stream and output stream from file
InputStream in = new FileInputStream(new File("source.xml"));
OutputStream out = new FileOutputStream(new File("target.xml"));
// call Mapping
MyModule map = new MyModule();
map.execute(in,out);
} catch (Throwable t) {
t.printStackTrace();
System.exit(0); -
Flash player caches external class files
Hi I work for a technology company in San Antonio and we use
flash for developing interactive course ware. We use a flash shell
which loads the separate pages of our lessons and have noticed a
very big problem with the way the flash player caches class files.
Basically it seems that when you use the 'import' call in
actionscript the flash movie doesn't import the external class if
it has already been loaded. the problem is that we have a huge
amount of developed classes, many of which have been updated
throughout our development. Is there any way for force clear the
ASO cache in actionscript or force import external actionscript
classes?Yes we know and use the delete aso files feature all the
time. this however is a runtime problem. meaning that the flash
player itself is caching class files and there is no way to get it
to refresh these links without doing a forced refresh of the shell
itself. this is something that is not an option as it doesn't allow
for fluid page loading. Is there any way to force reload/import
class files that have already been loaded, that is clear the
class/aso cache in the flash player itself using actionscript
code? -
Java class call from Stored Proc or trigger
Hi Experts!
I have windows 2K server with Oracle 8i Enterprise Edition installed. Please let me know if I can call a java class from Stored Procedure or Trigger. If there is a way, then help me out with code sample or description.
Regards,
Atul
[email protected]Atul,
Couple of questions to you, off the subject,
* Why NULL NULL registration?(You already revealed your name at the bottom)
* Why email at the bottom? This is already a discussion forum.
To your qn, it is very much possible. It is not something that one can explain in a single thread. It takes your machine setup for JVM, your knowledgebase on JAVA and other things. Please find notes on External Procedure Calls, which should give you a start. If you are running into problems, please come back with specifics.
Thx,
SriDHAR -
"1046: Type was not found" for a custom class calling a custom class
This should be easy... but I've spent two days on nothing but this error.... I am absolutely at my wit's end.
Basically, I've got a "character" container linked to a MovieClip in the library that is supposed to act as a container for various body parts; head, shirt, pants, etc. For simplicity, I've just got Character class and Head class, both in a "char" package, both classes are named the same as their respective files (Character.as and Head.as, both in an actual file called "char"). Character class is supposed to create an instance of Head, but I always get this 1046 error. The problem is that I've got other body parts with nearly identical classes that ARENT throwing a 1046 error and are working just fine. I went and made a new project to see if I was still having the problem with just character calling 1 simple body part. I do.
In the symbol properties, it's Exported for Actionscript & Export in Frame 1... the class is "char.Head" and "char.Character" respectively. I have tried everything I can find or think of, I've done dozens of Google searches and sifted through dozens of forums. I can't find anything and I've been working on this problem for 24 straight working hours now. I'm completely exasperated......
package char {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.ColorTransform;
import fl.motion.Color;
import char.Head;
public class Character extends MovieClip {
// 1046: Type was not found or was not a compile-time constant: Head
private var _head:Head;
// reference to get the stage later
private var stageRef:Stage;
public function Character(stageRef:Stage=null) {
trace("NEW CHARACTER");
//1180 Call to a possibly undefined method Head;
_head=new Head();
And here's the contents of Head.as
package char {
import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Stage;
import flash.geom.ColorTransform;
public class Head extends MovieClip {
private var skin_type:uint;
public function Head() {
trace ("NEW HEAD");
Now if I declare the head variable and create a new instance of it in my document class, no problem whatsoever. If I do it in my Character class, it just doesn't stop giving me this error!!! Somebody please help me.
1046: Type was not found or was not a compile-time constant: Head
1180 Call to a possibly undefined method Head;There is a blank movieclip named Character in the library, yup.
Also in my main handler for my document class calls "mainCharacter = new Character(); "
Here's a chunk of the code from the document class. For the record, it calls "head" as just a test and that works fine. Just doesn't work in "Character"
import char.Character;
import char.Head;
public class MainHandler extends MovieClip {
private static var _instance:MainHandler;
public static function get instance():MainHandler { return _instance; }
public var mainCharacter:Character;
public var head_:Head;
public function MainHandler() {
_instance = this;
mainCharacter = new Character();
head_=new Head(); -
Class has be instantiated in document class but having issue..HELP
Guys,
I am making my way with AS3 in little steps and have hit a
road block. This is what I have:
I have a document class called "Document Class"
I have a custom class called "Game"
I have instantiated an object of "Game" class and I am able
to trace a class method which return a simple "HELLO".
within my Game class, I have a variable(type Array) called
"questions" as instance variable.
I would like to add questions to "questions" array by using
"Mutator" method, or count the current elements with the questions
array and return the total number of questions. I am unable to add
or access elements to the questions array.
Any help would highly be appreciated, please.First thing: you need to set the functions you're calling to
public, so that you have access to them outside of your class.
Second: you are initializing 'questions' to null. I made some
changes and it seems to work for me:
//////////////Game
Class///////////////////////////////////////////////
public function Game()
//this.questions = null;
this.correctAnswers = null;
this.userAnswers = null;
// SETQUESTION FUNCTION CAN ADD QUESTIONS TO THE QUESTION
ARRAY;
public function myArr():void
trace(questions.length);
public function AddQuestions(val:String)
this.questions.push(val);
trace(val);
} -
Reset or Clear SAP user context by external RFC caller program
Hello,
I have a SAP system with performance problems due to a SAP user context starts using a lot of memory.
This user context comes from an External RFC caller program written in Delphi and which uses the SAP RFC SDK provided by SAPGUI 6.40: SAP Automation library, SAPFuntionsOCX, I mean, using methods in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
Everytime we have performance problems, this RFC SAP user context is using near 1400 Mb of extended memory, although there is a lot of free physical RAM memory available, there are free dialog processes and CPU load is low (no more than 30%).
This performance problem is solved by closing the external program (written in Delphi) which connects to SAP via RFC.
This external program works for the warehouse management and connects to SAP several times per minute. Due to connection performance and the high frequency with which this external program must connect to SAP, the connection to SAP is not closed after each call to RFC SAP function modules.
The extended memory used by this SAP RFC user is growing along time. I detected, using ST03 transaction, that these user sessions have always the same transaction code hash, I mean, although the external programs call the same SAP RFC funcion modules several times (¡¡¡ always clearing the variables at the beginning and at the end of de ABAP code, with ABAP commands like REFRESH and FREE ¡¡¡¡) the technical transaction code is the same and I suppose the user context (in extended memory) is not deleted.
I think it is better than the external program close the context memory (similar to "/n" okcode in SAPGUI).
But we don't want to close the connection, because the external program connects to SAP with a high frequency, and the logon process is expensive.
Is there any way to send something similar to "/n" (end of transaction) from the external program? Is there any command in the SAP RFC SDK library (SAPFuntionsOCX or something similar?
I cannot find any method to do that in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
Old information for Object Classes "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory, is described in the following URL:
http://help.sap.com/saphelp_45b/helpdata/en/39/7e00d1ac6011d189c60000e829fbbd/frameset.htm
But I cannot find anything related to something similar to a "/n" in SAPGUI.
As I have the SAPGUI installed on my desktop, I can see all SAP RFC classes and methods from Excel, by opening the Visual Basic editor.
I am only asking a way to send to SAP a command to free the user context used for an open RFC session in order to avoid the memory used to be continuously growing, without having to close the RFC session.
The external program only calls a certain SAP function module periodically and we want to free the user context between calls without logging off. This is the same, very similar, as if we called that function from SAPGUI and we used "/n" in SAPGUI between calls.
Anyone can help me?
Thanks and best regards.Hello,
I don't know if this will solve your problem, but you may be using MF 'RFC_CONNECTION_CLOSE' between each call of you RFC function.
Regards
Brice
Edited by: blsapsdn on Apr 15, 2011 5:27 PM -
External Procedure Call: Temporary Blob Array out.
Hello,
I am having difficulty getting out an array of blob from the external procedure call interface. I am trying to create an array of blob initialized with temporary blobs. I was successfully able to create single blob parameter out but no success with the array type.
I am including the code for PLSQL wrapper, test code, and the main C code.
I appreciate your help.
The error message of the test run:
0
10
DECLARE
ERROR at line 1:
ORA-22275: invalid LOB locator specified
ORA-06512: at "SYS.DBMS_LOB", line 554
ORA-06512: at line 7
CREATE OR REPLACE PROCEDURE blob_coll (
cintarray IN OUT VDC_BLOB_ARRAY ) IS
LANGUAGE C
NAME "blob_coll"
LIBRARY sjc_lib WITH CONTEXT
PARAMETERS (
context,
cintarray OCIColl);
DECLARE
BLOBARRAY VDC_BLOB_ARRAY:= VDC_BLOB_ARRAY();
BEGIN
dbms_output.put_line( BLOBARRAY.count);
SCOTT.BLOB_COLL ( BLOBARRAY );
dbms_output.put_line( BLOBARRAY.count);
dbms_output.put_line( dbms_lob.getlength( BLOBARRAY(1)));
END;
void blob_coll( OCIExtProcContext *ctx,
OCIColl **cintarray )
sword status;
int i;
OCILobLocator *lobp[10];
status = OCIExtProcGetEnv( (OCIExtProcContext *)ctx, (OCIEnv **)&envhp,
(OCISvcCtx **)&svchp, (OCIError **)&errhp );
for (i=0; i < 10; i++)
status=OCIDescriptorAlloc( (dvoid *)envhp, (dvoid **) &lobp,
(ub4)OCI_DTYPE_LOB, (size_t)0, (dvoid**)0);
status=OCILobCreateTemporary((dvoid *)svchp,
(dvoid *)envhp,
lobp[i], (ub2)0, SQLCS_IMPLICIT,
OCI_TEMP_BLOB, OCI_ATTR_CACHE,
OCI_DURATION_SESSION);
status = OCICollAppend( (OCIEnv *)envhp,(OCIError *)errhp,
(CONST dvoid*) lobp[i],
(CONST dvoid*)0,
(OCIColl *)*cintarray);The "X" in the second registerOutParameter is the type name which
you have created in oracle DB.
eg. if you have created a nested table
create Type integer_table is table of number(10);
then "X" = "INTEGER_TABLE" and it has to be in caps
and other thing to keep in mind is that it only works with nested
table or varray and not with pl/sql table.
Al Pivonka (guest) wrote:
: How can I pass pl/sql record in and out
: and pl/sql tables in out thru a pl/sql procedure using jdbc
with
: the zip file of 816classes12.zip...
: I have tried everything I know...
: I know the procedure is working, others are using it with in
: Oracle...
: I need to use the information it generates.
: here is what I have so far...
: try
: Class.forName ("oracle.jdbc.driver.OracleDriver");
: DriverManager.registerDriver (new
: oracle.jdbc.driver.OracleDriver());
: oracle.jdbc.driver.OracleConnection conn =
: (oracle.jdbc.driver.OracleConnection
: DriverManager.getConnection
("jdbc:oracle:thin:@--","NA","NA");
: // SQL92 SyntaxCallableStatement
: oracle.jdbc.driver.OracleCallableStatement cstmt =
: (oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall
: ("{call cbmd_proposal_PKG.DefaultTerms (?,?,?,?)}" ) ;
: cstmt.setString(1,"5118");
: cstmt.setString(2,"3");
: cstmt.registerOutParameter
: (2,oracle.jdbc.driver.OracleTypes.NUMBER);
: cstmt.registerOutParameter
(1,oracle.jdbc.driver.OracleTypes.ARRAY,"X");
: cstmt.execute();
: catch(Exception e)
: System.err.println(e.toString());
: e.printStackTrace();
: The "X" in the second registerOutParameter is still unknown to
: me.
: The JavaDoc for the
OracleCallableStatement.registerOutParameter
: is not clear.
: Can any One help simplify this...
: Thanks
null -
this is the class that calls another class called cuboid
package WindowsApplication1;
* Summary description for Cuboid.
//Import the classes to allow the use of the array, iterator and listiterator
import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
public class DisplayCuboidValues
public static void main(String args[])
//Create the array list
ArrayList VolumeList = new ArrayList();
//Create the counter to loop 4 times and get 4 different volumes. Modify the counter
//if you need a different values
int Counter = 1;
//Initialize the counter to loop 4 times in order to get the 4 objects
while (Counter < 5)
Cuboid mp = new Cuboid(2, 4, 3);
//Add the values to the array
VolumeList.add(mp);
// get the volume again via accessor method(Optional)
//int Volume = mp.Volume();
//System.out.println(Volume);
//Increment the counter to obtain a new value in the array
Counter = Counter + 1;
// Retrieve iterator to the radiuslist
Iterator itr1 = VolumeList.iterator();
while (itr1.hasNext())
// call Cuboid.toString()
System.out.print(itr1.next());
System.out.println();
}this is the cuboid class
package WindowsApplication1;
* Summary description for Cuboid.
public class Cuboid
private final int length, width, height;
//1st contructor with 3 arguments
public Cuboid(int length, int width, int height)
this.length = length;
this.width = width;
this.height = height;
//2nd constructor with no arguments
//I BELIEVE THIS PUBLIC CUBOID IS THE ONE THE PROVOKES THE ERROR. BUT I CAN NOT DELETE IT BECAUSE I NEED ANOTHER PUBLIC CUBOID. SO IDK WHAT TO DO......
public Cuboid()
this.length = length;
this.width = width;
this.height = height;
public String toString() {
return "This cuboid has length x, width y, height z, and has volume of v where X=" + length + " " + "Y=" + width + " " + "Z=" + height + " " + "Volume=" + length * width * height + ". -- ";
//Method to calculate the Volume
public int Volume()
return length * width * height;
}This is what i have done. I have created a project named ths(which i do not use it at all). Then, i created one file called DisplayCuboidValues under ths. Then i created the file Cuboid under ths too. But it gives me errors. like this one:
init:
deps-jar:
Created dir: C:\Documents and Settings\Owner\ths\build\classes
Compiling 1 source file to C:\Documents and Settings\Owner\ths\build\classes
C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:25: variable length might not have been initialized
this.length = length;
*^*
C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:26: variable width might not have been initialized
this.width = width;
*^*
C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:27: variable height might not have been initialized
this.height = height;
*^*
Note: C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\DisplayCuboidValues.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
*3 errors*
BUILD FAILED (total time: 0 seconds)
Any help you can give me will be appreciated. Thanks.yeah. you are right in that. so that means that i have to get rid of it??. because i will need it. and the values assigned to them is in the first class that calls the second class look:
package WindowsApplication1;
* Summary description for Cuboid.
//Import the classes to allow the use of the array, iterator and listiterator
import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
public class DisplayCuboidValues
public static void main(String args[])
//Create the array list
ArrayList VolumeList = new ArrayList();
//Create the counter to loop 4 times and get 4 different volumes. Modify the counter
//if you need a different values
int Counter = 1;
//Initialize the counter to loop 4 times in order to get the 4 objects
while (Counter < 5)
*//HERE IS WHERE I AM PROVIDING THE OTHER CLASS WITH VALUES. THEREFORE IT SHOULD SENT THOSE VALUES TO MY CLASS CUBOID AND RETRIEVE THE ANSWER TO FOLLOW THE REST OF THIS CODE.*
Cuboid mp = new Cuboid(2, 4, 3);
//Add the values to the array
VolumeList.add(mp);
// get the volume again via accessor method(Optional)
//int Volume = mp.Volume();
//System.out.println(Volume);
//Increment the counter to obtain a new value in the array
Counter = Counter + 1;
// Retrieve iterator to the radiuslist
Iterator itr1 = VolumeList.iterator();
while (itr1.hasNext())
// call Cuboid.toString()
System.out.print(itr1.next());
System.out.println();
} -
Including AS3 external class file
How do I include 2 or more external action script files in my FLA document.The first one is easy and taken care by setting the class property of the FLA document to the class file name. But if I have several external class files? I have tried the 'include' directive but the compiler complains - any suggestions?
Thanks
Joseph KarovTo import the other Class, just start typing its name in an expression, and hold down the control key while hitting the space bar. Both the Flash IDE and Flash Builder will bring up a code completion dropdown. When you select the Class, the import statement will be generated.
For example, if you are in Foo and you type:
protected var bar:Bar;
Then when you have typed in the "Ba" part of the word Bar after the colon, if you use the Ctrl-Space keyboard shortcut, it should show you your Bar Class, possibly among other Classes starting with "Ba." Select "Bar" with either your mouse or your cursor, and Flash will finish the word for you and generate the import statement. Note that you can now create and use instances of Bar, but Bar won't be "merged" into Foo, which it sounds like is what you want. To do that, you'll need to do what I suggested, which is to have one Class extend another Class.
To have one Class extend the other, change the line that says "public class Foo" to "public class Foo extends Bar". Note that the two Classes must have compatible functionality and have the same base Class. I'm assuming they do, or else trying to "include" the code wouldn't work either.
Another possible solution, depending on exactly what you're trying to acheive, is to apply the second Class to a symbol in the library and use that by placing it on the stage or accessing it through code. However, you haven't given us very much to go on, so it's really difficult to help you. -
Document -- XSL-- Document + Document --XSL-- Final Output
I am trying to do the following in a java program using both the XSQL java api's and the XML Parser for Java v2.
1. Create a Document from a SQL query using XSQL
- OracleXMLQuery qry = new OracleXMLQuery(conn,selectStatement);
- Document doc = qry.getXMLDOM();
2. Transform the resultant Document with an XSL stylesheet to create a new Document or Doc Fragment
- I am having trouble with this as the XML Parser calls to the XSL Stylesheet processor require an XMLDocument rather than a Document. How do I get around this?
3. Merge the Document result of 2 above with a Document from another XSQL query.
- I plan to do this by passing a node of the (XML)Document from 2 to the second query.
4. Finally apply a stylsheet to the combined (XML)Document.
I would greatly appreciate any help or suggestions for other ways to accomplish this.
Thanks,
ChrisMaybe a dumb question, but is there anyway to use the database to join the information that you appear to be joining at the XML level? It would obviously be much faster if you can come up with the query to do this... Maybe the situation doesn't lend itself, but it's worth a think.
Maybe you are looking for
-
Password problems [subject edited by moderator]
Has anyone had trouble getting password changes to take? I've tried to change it 3 times, and it APPEARS to be accepted, but does not let me install software updates.
-
Font not available in Office Word
I have loaded the VIVALDI.TTF font within all the library/font and it works with Mail, Safari, Photoshop, Acrobat etc... but it is still UNAVAILABLE for Office 2004 softwares (Word, Excel, Powerpoint). Any clue to help me use Vivaldi font in WORD ? T
-
MEDIASOURCE- won't burn a cd! Can't find a cd recorder device is fo
Hey, i just got a creative zen 20 gig installed the media source program fine. And i got to work fine it finds cds, rips them onto the computer and to the zen, but it when i try to burn a cd using the program it says it can't find a cd recording devi
-
Safari, iChat won't launch ?
Need advice, can't launch Safari or iChat. Or it will take them 10-15 minutes to launch. This started after I was trying to do a secure erase on an external firewire hard drive. I think Disk Utility hung because the progress bar wasn't advancing afte
-
Hello, I need help for a little problem. Is it possible to detect the actual player/stage size in the browser from within the flash movie? A flash movie has its own width and height, but if the player dimensions are set to be scaled to, for example,