Questions on XML
1) In Oracle, What are all the ways to generate a xml file for given XSD ?
2) Which is the best approach among them ?
An XML document may be generated from an XML Schema in JDeveloper.
Slect File>New.
Select General>XML.>XML Document from XML Schema.
Create an XML document with the Create XML Document from XML Schema Wizard.
Similar Messages
-
Export Question Slides XML to Moodle
I have several quizzes built in captivate 3 that i want to
export the questions as xml and then import them to moodle using
xml. I know i can run a scorm package on moodle with my quiz, but
i'm trying to actually use my questions as part of a moodle quiz so
i need to be able to import them as XML. when i just export my
captivate quiz as XML and then try the import Moodle XML function i
get errors. Any ideas?
Thanks,
DaveThanks so much for your help so far, Paul
Everything works great, except when trying to use the Export button from Reader. (It works as expected in Pro)
The file has been reader extended, so save works, but our developers need the ability to click that Export button from Reader and get an XML file. Any ideas if this is possible or how the code can be tweaked so it will work for Reader?
Thanks! -
I need help with a question regarding XML
I have an exam tomorrow, and I was checking exams from previous years. There is a multiple choice question regarding XML, and I don't know all the correct answers (some are pretty obvious).
It's plattform independent
It allows UML representation
It's a Text Only format
It's faster to process than native binary formats
It's a data exchange standard
It allows specification of the meaning of the data in the document
It comes from HTML
.NET and J2EE provide tools to handle itIn the beginning there was SGML... the newest HTML
standard is an XML defined language (although most
sites and pages are still not XML compliant). Soyou
can think of HTML as a subset of XML but XML isnot
by any means a subset of HTML.But wasn't XML's format based on the original HTML?
That is, XML is a generalization of the original
HTML. So, the "true"/"false" determination depends
on how you define "It comes from HTML" (I thought it
was derived from HTML, which would make the
statement "true" [IMHO], but I could be wrong).No XML is not derived from HTML. Markup languages existed well before HTML. HTML popularized them to a large extent but it was not the first by any means.
See http://en.wikipedia.org/wiki/Generalized_Markup_Language
Also Wiki states in it's XML article that XML is a subset of SGML (which through that article) is a descendent of GML
The language heirarchy from SGML is as follows
SGML ---- HTML (old spec and deprecated)
|
|
----- XML ----- XHTML (current XML spec)edit: the tree got screwed up. XML descends from SGML directly.
Message was edited by:
cotton.m -
Some questions on xml db content connector
As we know, Oracle XML DB Content Connector implements JSR-170 in XML DB 11g.
After reading the related document about XML DB Content Connector, I have some questions as follows.
1. Is XML DB Content Connector API available only for XML DB 11g? or can be used in xml db 10g?
2.The document said "You can find additional sample code in the following location:
$ORACLE_HOME/xdk/demo/jcr",
and where can I get the sample code if I haven't install oracle 11g?
ThanksPlease contact me at : [email protected] for further discussion.
-
Question about XML validation against schema
My question is probably a basic one about XML. I tried PurchaseOrder example from the book "J2EE Web Services" by Richard Monson-Haefel. A simplified version as followings -
Address.xsd -
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/Address"
xmlns:addr="http://xml.netbeans.org/schema/Address"
elementFormDefault="qualified">
<element name="address" type="addr:USAddress" />
<complexType name="USAddress">
<sequence>
<element name="name" type="string" />
<element name="street" type="string" />
<element name="city" type="string" />
<element name="state" type="string" />
<element name="zip" type="string" />
</sequence>
</complexType>
</schema>
PurchaseOrder.xsd -
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/PurchaseOrder"
xmlns:po="http://xml.netbeans.org/schema/PurchaseOrder"
xmlns:ad="http://xml.netbeans.org/schema/Address"
elementFormDefault="qualified">
<import namespace="http://xml.netbeans.org/schema/Address" schemaLocation="Address.xsd" />
<element name="purchaseOrder" type="po:PurchaseOrder" />
<complexType name="PurchaseOrder">
<sequence>
<element name="accountName" type="string" />
<element name="accountNumber" type="unsignedShort" />
<element name="shipAddress" type="ad:USAddress" />
<element name="total" type="float" />
</sequence>
<attribute name="orderDate" type="date" />
</complexType>
</schema>
Then PurchaseOrder.xml is -
<purchaseOrder orderDate="2007-12-12"
xmlns='http://xml.netbeans.org/schema/PurchaseOrder'
xmlns:addr="http://xml.netbeans.org/schema/Address"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://xml.netbeans.org/schema/PurchaseOrder ../xsd/PurchaseOrder.xsd'>
<accountName>Starwood</accountName>
<accountNumber>220</accountNumber>
<shipAddress>
<name>Data Center</name>
<street>1501 Washington St.</street>
<city>Braintree</city>
<state>MA</state>
<zip>02148</zip>
</shipAddress>
<total>250</total>
</purchaseOrder>
Then I did a XML validation but have this error -
cvc-complex-type.2.4.a: Invalid content was found starting with element 'name'. One of '{"http://xml.netbeans.org/schema/Address":name}' is expected. [19]
It complains <name> tag in <shipAddrss> needs namespace of "http://xml.netbeans.org/schema/Address". Why?
Is it possible to change XML so it does not need name space for elements inside <shipAddress>?
ThanksHi Madhura,
see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 16353 ms
C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
NOK - Validation error
Elapsed time: 994 ms
Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
The W3C servers are slow to return DTDs. Is the delay intentional?
Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
--> They don't want to have requests to their site from productive servers all around the world.
Regards,
Rüdiger -
Question? XML Publisher Desktop
Hi Folks,
I'm exploring this option for my organization and I have a question or two.
I have remote users logging in to develop their reports. Is the XML Publisher Desktop required to build their reports or is it only a nice to have? If they're sufficiently good at SQL and XML can they bypass this application?
If not, does the XML Publisher Desktop cost anything to install on these remote machines?
Thanks,
TonyHi Tony
They do not need the XMLP desktop, they can either build templates in MSWord or handcode the XSL directly. The tools do not cost any extra once you have licensed XMLP.
Regards
Tim -
Questions on XML Publisher/Site Level Configuration
We are using BI Publisher 5.6.3 in EBS 11i. I am looking for guidance on setting the FO Processing properties.
On the Administration/Configuration Tab there are no values visible for a number of the FO Processing properties including:
Use XML Publisher's XSLT processor
Enable Scalable feature of XSLT processor
Enable XSLT runtime optimization
Also, there are no entries in xdo_config_values table. Does this mean that site values are set to default? And if so, are these the correct values for the defaults?
Use XML Publisher's XSLT processor - TRUE
Enable Scalable feature of XSLT processor - FALSE
Enable XSLT runtime optimization - TRUE
If these are in fact the defaults, I have read in numerous threads that setting 'Enable Scalable feature of XSLT processor' to TRUE can help with performance. Does this only work if the XML is large, or will it also help if you have very complex .rtf templates (multiple levels of dynamic grouping, pagebreaks, nested tables, sums, etc.)? If the complexity is in the .rtf template itself, is it best to set this property 'Enable Scalable feature of XSLT processor' at the template level? When would it be best to set at the site level? At the data definition level?
I've tried changing this property on a few templates and the outcome doesn't seem predictable. In some cases it seems to improve performance and in other cases there is a decrease in performance. I can't seem to pinpoint why it works in some cases and not others.
Any additional information would be appreciated.
Thank you for your help,
Tam.
Edited by: Tam_11 on May 11, 2010 3:09 PMHi Nabendu.
BI publisher does have the option of showing a running total in PDF format usign a RTF template. If you look up the advanced rtf samples provided with the BI publisher plugin there is one example to show running totals, with the previous page total at the top.
you can find this located on your PC where the Word Plugin is installed. C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\samples\RTF templates
replace C:\ with the drive leeter of the drive where your desktop plugin is installed
Hope this Helps,
Domnic -
Question about XML mapping to ABAP internal table
Hi experts.
I'm trying to XML mapping. But it doesn't work well. Assume there are XML file as below.
<HEADER>
<ITEM>
<FOO>123</FOO>
<BAR>ABC</BAR>
</ITEM>
<ITEM>
<FOO>456</FOO>
<BAR>DEF</BAR>
</ITEM>
<HEADER>
and I want to trasformation it as below.
ITAB
FOO | BAR
123 | ABC
456 | DEF
How could I trasformation using "call transformation"?
Regards.Hi,
REPORT zind_xml_to_sap NO STANDARD PAGE HEADING.
Data Declaration *
DATA: client TYPE REF TO if_http_client, "Interface
host TYPE string,
port TYPE string,
proxy_host TYPE string,
proxy_port TYPE string,
path TYPE string,
scheme TYPE i,
xml TYPE xstring,
response TYPE string.
DATA: t_xml TYPE smum_xmltb OCCURS 0 WITH HEADER LINE. "XML Table structure used
"for retreive and output XML doc
DATA: g_stream_factory TYPE REF TO if_ixml_stream_factory. "Interface
DATA : return LIKE bapiret2 OCCURS 0 WITH HEADER LINE. "XML Table structure used for retreive
"and output XML doc
Parameters *
PARAMETER : p_add TYPE string LOWER CASE ,
p_dfile LIKE rlgrap-filename.
AT Selection-Screen on value-request for file *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dfile.
Get file
PERFORM 100_get_file.
Start-of-Selection *
START-OF-SELECTION.
Perform to upload xml data from URL to SAP internal table
PERFORM 200_xml_upload.
IF t_xml[] IS NOT INITIAL.
Perform to Download data from Internal Table to a text file in local drive
PERFORM 300_download.
write : / 'Data Uploaded to Internal Table Successfully'.
write : / 'XML Data Downloaded to Local path', p_dfile.
else.
write : / 'No Data for upload'.
ENDIF.
*if t_xml[] is INITIAL.
WRITE : address, 'Given URl cannot be Converted' .
else.
LOOP AT t_xml .
WRITE: t_xml-cname, t_xml-cvalue.
ENDLOOP.
endif.
*& Form get_file
Get File
FORM 100_get_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
file_name = p_dfile
ENDFORM. " 100_get_file
*& Form 200_xml_upload
form to upload xml data from URL to SAP internal table
FORM 200_xml_upload .
*Check HTTP:// and concatenate
IF p_add NS 'http://' OR p_add NS 'HTTP://'.
CONCATENATE 'http://' p_add
INTO p_add.
ENDIF.
Fetching the address of the URL
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = p_add
IMPORTING
client = client.
*Structure of HTTP Connection and Dispatch of Data
client->send( ).
*Receipt of HTTP Response
CALL METHOD client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
IF sy-subrc = 1.
MESSAGE 'HTTP COMMUNICATION FAILURE' TYPE 'I' DISPLAY LIKE 'E'.
EXIT.
ELSEIF sy-subrc = 2.
MESSAGE 'HTTP INVALID STATE' TYPE 'I' DISPLAY LIKE 'E'.
EXIT.
ELSEIF sy-subrc = 3.
MESSAGE 'HTTP PROCESSING FAILED' TYPE 'I' DISPLAY LIKE 'E'.
EXIT.
ELSE.
MESSAGE 'Problem in HTTP Request' TYPE 'I' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
ENDIF.
Get data of the xml to Response
response = client->response->get_cdata( ).
*FM converting the XML format to abap
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = response
IMPORTING
buffer = xml.
*FM converting XMl to readable format to a internal table.
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = xml
TABLES
xml_table = t_xml
return = return.
ENDFORM. " 200_xml_upload
*& Form 300_download
*form to Download data from Internal Table to a text file in local drive
FORM 300_download .
DATA filename TYPE string.
filename = p_dfile.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
WRITE_FIELD_SEPARATOR = 'X'
TABLES
data_tab = t_xml
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. -
Question about xml schemas and the use of unqualified nested elements
Hello,
I have the following schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://xml.netbeans.org/examples/targetNS"
targetNamespace="http://xml.netbeans.org/examples/targetNS"
elementFormDefault="unqualified">
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="age" type="xsd:int"/>
<xsd:element name="person">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="name"/>
<xsd:element ref="age"/>
<xsd:element name="height" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>I am just wondering why would someone have a nested element that is unqualified? here the "height" element.
Can anyone explain this to me please?
Thanks in advance,
Julien.
here is an instance xml document
<?xml version="1.0" encoding="UTF-8"?>
<person xmlns='http://xml.netbeans.org/examples/targetNS'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://xml.netbeans.org/examples/targetNS file:/E:/dev/java/XML/WebApplicationXML/web/newXMLSchemaThree.xsd'>
<name>toto</name>
<age>40</age>
<height>180</height>
</person>Don't worry about it.
There are two different styles of schemas. In one style, you define the elements, attributes, etc. at the top, and then use the "ref" form to refer to them. (I call this the "global" style.) The other style is to define elements inline where they are used. ("local" style)
Within some bounds, they work the same and which you use is a choice of you and the tools that generate the schemas.
A warning about the local style. It is possible to define an element in two different locations in the schema that are different. It will get past all schema validation, but it seems wrong to my sense of esthetics. With the global style, this will not happen.
So, how did this happen? Probably one person did the schema when it only had a name and age. Then, someone else added the height element. They either used a different tool, or preferred the other style. I'm aware of no difference in the document you have described between the two styles.
Dave Patterson -
Question about XML file transferring over the networking
Hi, I am now to Java, and now I am going to set up a simple network in the lab.
I have created a random array of data and transferred to XML file on my client. Now, I would like to send it to the server. I am wondering how I can put the XML file into my client, and do I need any parser to let the server show what random date it has received?
Anybody can give me any idea or some basic code? Thank you.
Now, I am referring the KnockKnock example in Java online tutorial. But, not clear how to deal with the XML File.
FengyuanFour crossposts.
http://forum.java.sun.com/thread.jspa?threadID=5158198&messageID=9600070#9600070
http://forum.java.sun.com/thread.jspa?threadID=5158200&messageID=9600074#9600074
http://forum.java.sun.com/thread.jspa?threadID=5158201&messageID=9600076#9600076
http://forum.java.sun.com/thread.jspa?threadID=5158202&messageID=9600078#9600078 -
A few questions with XML and Flash
Hi there.
I am currently trying to create a 3d carousel using AS2 and XML. I've made a lot of progress, but there ar e few things I am still struggling with and was hopoing that someone here could please steer me in the right direction.
Here is a URL where the Carousel can be found:
http://iongeo.com/ru_innovation_test_dev/carousel_test.html
Here are a few of the things I am wondering:
1. I would like to be ablle to add a back button movide clip, similar to how the tooltip movie clip is presented now; this movie clip would be able to allow users to go back home to the caousel. I can't seem to get it to load correctly however, I would imagine that it would be set up similarly to how the tooltip icon is set up now, but to be able to have an alpha of 100 when the text is loaded in.
2. I was also wondering how I mihgt be able to add links to my .xml document to be able to call in URLs on the web. I've tried several things using the CDATA approach, but can't seem to get it to work.
I would greatly appreciate any assistance privded and am very greatful for any consideration thac ould be provided. Please let me know if there is anything htat I should clarify on.
Below is my code for AS2 and XML so that you might see how things are currently working.
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 200;
var radiusY:Number = 75;
var centerX:Number = 300;
var centerY:Number = 150;
var speed:Number = 0.00;
var perspective:Number = 20;
var home:MovieClip = this;
theText._alpha = 0;
theHeader._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",8000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.header = nodes[i].attributes.header;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
function over()
//BONUS Section
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
//BONUS Section
home.tooltip._alpha = 100;
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,100,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,200,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
s.onRelease = unReleased;
function unReleased()
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/8000;
// inactive mouse time (in seconds) to start slowing the carousel
var inactiveMouseTime:Number =1;
// rate of slowing carousel;
var speedDamp:Number = .4;
var speedI:Number;
var startSlowTO:Number;
this.onMouseMove = function(){
clearInterval(speedI);
clearTimeout(startSlowTO);
startSlowTO = setTimeout(startSlowF,inactiveMouseTime);
speed = (this._xmouse-centerX)/8000;
function startSlowF(){
clearInterval(speedI);
speedI=setInterval(speedF,2000);
function speedF(){
speed = speedDamp*speed;
if(speed<.1){
clearInterval(speedI);
speed=0;
Here is an example of how things are loaded from XML:
<icons>
<icon image="Denver_test_icon.png" tooltip="Denver Icon Test" header="test header" content="Test Paragraph. Greeked:. Suspendisse condimentum sagittis luctus." />
</icons>Hi there.
I am currently trying to create a 3d carousel using AS2 and XML. I've made a lot of progress, but there ar e few things I am still struggling with and was hopoing that someone here could please steer me in the right direction.
Here is a URL where the Carousel can be found:
http://iongeo.com/ru_innovation_test_dev/carousel_test.html
Here are a few of the things I am wondering:
1. I would like to be ablle to add a back button movide clip, similar to how the tooltip movie clip is presented now; this movie clip would be able to allow users to go back home to the caousel. I can't seem to get it to load correctly however, I would imagine that it would be set up similarly to how the tooltip icon is set up now, but to be able to have an alpha of 100 when the text is loaded in.
2. I was also wondering how I mihgt be able to add links to my .xml document to be able to call in URLs on the web. I've tried several things using the CDATA approach, but can't seem to get it to work.
I would greatly appreciate any assistance privded and am very greatful for any consideration thac ould be provided. Please let me know if there is anything htat I should clarify on.
Below is my code for AS2 and XML so that you might see how things are currently working.
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 200;
var radiusY:Number = 75;
var centerX:Number = 300;
var centerY:Number = 150;
var speed:Number = 0.00;
var perspective:Number = 20;
var home:MovieClip = this;
theText._alpha = 0;
theHeader._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",8000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.header = nodes[i].attributes.header;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
function over()
//BONUS Section
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
function out()
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
function released()
//BONUS Section
home.tooltip._alpha = 100;
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,100,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,200,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
s.onRelease = unReleased;
function unReleased()
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
if(t != this._parent)
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
else
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
for(var i=0;i<numOfItems;i++)
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
function moveTip()
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
xml.load("icons.xml");
function mover()
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.onMouseMove = function()
speed = (this._xmouse-centerX)/8000;
// inactive mouse time (in seconds) to start slowing the carousel
var inactiveMouseTime:Number =1;
// rate of slowing carousel;
var speedDamp:Number = .4;
var speedI:Number;
var startSlowTO:Number;
this.onMouseMove = function(){
clearInterval(speedI);
clearTimeout(startSlowTO);
startSlowTO = setTimeout(startSlowF,inactiveMouseTime);
speed = (this._xmouse-centerX)/8000;
function startSlowF(){
clearInterval(speedI);
speedI=setInterval(speedF,2000);
function speedF(){
speed = speedDamp*speed;
if(speed<.1){
clearInterval(speedI);
speed=0;
Here is an example of how things are loaded from XML:
<icons>
<icon image="Denver_test_icon.png" tooltip="Denver Icon Test" header="test header" content="Test Paragraph. Greeked:. Suspendisse condimentum sagittis luctus." />
</icons> -
Question: Which XML parser is built into JDK14.2?
Is it Crimson, Xerces ?
Do you know which version ?
When using inbuilt XML parser with JDK 1.4.2 which API shoudl I look at ?
Is it only the standard JDK API at http://java.sun.com/j2se/1.4.2/docs/api ?It is crimson and its version is 1.1.3
-
Question: crossdomain.xml without web server
Hi, Flex Gurus,
In case where I want to use Flex to communicate with a
non-web server machine, e.g. mysql, where should the
crossdomain.xml reside on the non-web server machine?
thanks,
swWell at that point you would put it where ever Flex can load
the file locally and do Security.loadPolicyFile("url"). However if
you are going to be using a socket for the connection I'm pretty
sure crossdomain.xml isn't what you're looking for, with the recent
security changes to the Flash Player I think you are looking more
for a Socket Policy File. You can read up on what I'm talking about
here at the following link.
Policy
File -
Hi,
How can I "include" xml file to another xml file?
I want to different in one xml file some header reports...for once!!!
then to call (include) from all athers xml files to this header.
(instead all the time to write the same rows.. :))
Thanks.
I'm new in xml topic.XSLT seems to be your choice, but standard API's can also be used for this purpose.
-
Somple question about xml structure
xml file is :
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
</properties>
and want to use DOM in java to get the nodelist information,
Element root=doc.getDocumentElement();
NodeList nodelist = root.getChildNodes();
for(int i = 0;i<nodelist.getLength();i++)
System.out.println(nodelist.tostring());
System.out.println(nodelist.getLength());
System.out.println(nodelist.getNodeType());
but the output is:
<properties>
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
</properties>
3 //why here the nodelist.length is 3?which 3?
3
<properties>
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
</properties>
3
1
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
5 //why is 5? which 5?
3
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
5
1
<timeout>60</timeout>
1 //here is just 1?
3
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
5
3
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
5
1
<timeout>100</timeout>
1
3
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
5
3
<properties>
<category>
<timeout>60</timeout>
<timeout>100</timeout>
</category>
</properties>
3
3
why all the node.getNodeType is 3, 3 means that they are all Text type?
thankssome wrong.sorry
the code is :
Element root=doc.getDocumentElement();
NodeList nodelist = root.getChildNodes();
for(int i = 0;i<nodelist.getLength();i++)
System.out.println(nodelist.item(i).tostring());
System.out.println(nodelist.item(i).getLength());
System.out.println(nodelist.item(i).getNodeType());
} -
Question about XML DOM de-bugging.
I have programmed the following class as an excercise in using the DOM and in recursion.
I'm having trouble,however, in debugging my iterate() method.
Sometimes it fails to print certain outer tags.
I'm faily confident there aren't any problems in using entirely static methods in the class.
I simply want it to iterate over all Nodes in the xml document,
and print them to the file in correct order.
Is there anyone out there who could debug my iterate() method?
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.io.*;
public class DomParsing {
private static PrintStream stream;
public static void main (String [] args)
try
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
File file = new File("cd-catalog.xml");
Node child = null;
Document document = builder.parse(file);
Node element = (Node)document.getDocumentElement();
stream = new PrintStream(new File("SCREEN_OUTPUT.txt"));
iterate(element);
stream.close();
catch (Exception e)
{e.printStackTrace();}
public static void iterate(Node element) //bug in this method.
if(element instanceof Node)
peekNode(element);
peekAttributes(element);
Node [] children = getChildren(element);
if(children instanceof Node[])
for(int i=0;i<children.length;i++)
iterate(children);
element = getSibling(element);
if(element instanceof Node)
iterate(element);
else {
return;}
private static Node [] getChildren(Node element)
Node [] children = null;
if(element.hasChildNodes()){
NodeList nodes= element.getChildNodes();
children = new Node [nodes.getLength()];
for(int i=0;i<nodes.getLength();i++)
{children[i] = nodes.item(i);}
return children;}
private static Node getSibling(Node element)
return element.getNextSibling();}
private static void peekNode(Node node)
if((node instanceof Node) && (stream instanceof PrintStream))
if(node.getNodeName()!=null && (!node.getNodeName().equals("#text")))
{stream.println(new String(node.getNodeName()));
if(node.getNodeValue()!=null)
{stream.println(new String(node.getNodeValue()));
private static void peekAttributes(Node element)
if(element.hasAttributes())
NamedNodeMap map = element.getAttributes();
for(int i=0;i<map.getLength();i++)
Attr attribute = (Attr)map.item(i);
peekNode((Node)attribute);}Never fear, Ihave found my answer!
I had unwitingly disasociated recursive steps,
instead of correctly associated.
The following runs correctly in
all my instances:
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.io.*;
import java.util.*;
public class DomParsing {
//Main method call to leverage the Iterator Class.
public static void main (String [] args)
Iterator iterator = new Iterator("tomcat-users.xml");
class Iterator {
private LinkedList<String> myDocument;
//private PrintStream stream;
//Constructor accesses xml file for parsing work.
public Iterator (String fileName)
try{
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
File file = new File(fileName);
Node child = null;
Document document = builder.parse(file);
Node element = (Node)document.getDocumentElement();
//stream = new PrintStream(new File("SCREEN_OUTPUT.txt"));
myDocument = new LinkedList<String>();
System.out.println("___________________________________________________");
iterate(element);
//stream.close();
ListIterator<String> nodes = myDocument.listIterator();
while(nodes.hasNext())
System.out.println(nodes.next().trim());
System.out.println("___________________________________________________");
catch (Exception e)
{e.printStackTrace();}
//This method is intended to be called recursively
//to set up a "tree" arrangement in memory
//representing an xml document tree.
private void iterate(Node element) {
if (element == null)
return;
if(element instanceof Node)
peekNode(element);
peekAttributes(element);
Node [] children = getChildren(element);
if(children instanceof Node[])
for(int i=0;i<children.length;i++)
iterate(children);
Node sibling = getSibling(element);
if(sibling instanceof Node)
{iterate(sibling);}
//Returns array of all Children Nodes of an Element.
private Node [] getChildren(Node element)
Node [] children = null;
if(element.hasChildNodes()){
NodeList nodes= element.getChildNodes();
children = new Node [nodes.getLength()];
for(int i=0;i<nodes.getLength();i++)
{children[i] = nodes.item(i);}
return children;}
//Obtains the next Sibling element
private Node getSibling(Node element)
return element.getNextSibling();}
//These print any Node and any data,
//from Element,attribute,attribute values,
//sibling,child, etc..
private void peekNode(Node node)
if((node instanceof Node))// && (stream instanceof PrintStream))
if(node.getNodeName()!=null && (!node.getNodeName().equals("#text")))
{//stream.println(new String(node.getNodeName().trim()));
myDocument.add(node.getNodeName().trim());
//System.out.println(node.getNodeName().toString());
if(node.getNodeValue()!=null)
{//stream.println(new String(node.getNodeValue().trim()));
myDocument.add(node.getNodeValue().trim());
//System.out.println(node.getNodeValue().toString());
//This examines the xml attributes on and element node.
private void peekAttributes(Node element)
if(element.hasAttributes())
NamedNodeMap map = element.getAttributes();
for(int i=0;i<map.getLength();i++)
Attr attribute = (Attr)map.item(i);
peekNode((Node)attribute);}
Maybe you are looking for
-
Scheduling a job in another system
Hello, I am looking for a FM or a report through which I can schedule a background job (a simple report program without a variant) in another system. Frequency option should be available since I want this scheduled job to be executed every day. Thank
-
Classify G/L Accounts for Document Splitting-----urgent
Hi all Classify G/L Accounts for Document Splitting in this step which g/l account can i assign pls suggest Explain this account i want to post This entry 40 Purchase service 4000------profit center 1000 40 purchase servise 6000------profit center 2
-
Why was my podcast rejected?
So I recently submitted a podcast for myself. It was a DJ podcast and was accepted just fine. The other day I submitted one for my partner in my DJ business. I got an e-mail today saying his was rejected and I am not sure why. Mine is EDM and his is
-
I eont run report as html file
hi i wont to see my result from report as html file i do it when i use driverx and it's work but i wont when i call the report from the form i wont it generate html file and run direct in IE i found this code and i use it DECLARE repid REPORT_OBJECT;
-
Ive migrated my apps from an old mac to my new mac. When i try to open my CS5 programs it get a pop up that says i need to install the legacy java SE 6. Ive done that and it still does not open?