Need help on XML Publiser
I have one query regarding Genrating report in XML Publisher.
1)i have developed report without layout in In Oracle Report.
2)Register it in Application and format as XML.
3)Create layout in xml publisehr.
4)Define Data Defination and Template.
5)Attach layout at SRS Window.
there are 3 user. user 1 has run the report he gets output based on some parameter.Now user 2 has run the reprot DO THE SAME PROCESS HAS TO DO BY USER 2 AS SAME ABOVE to gets the different output since the XML data is old? LIKE XML DATA MAPPING AND CREATING TEMPLATE.
Hi 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
Similar Messages
-
I need help with XML Gallery Fade in out transition. somebody please help me :(
I need help with XML Gallery Fade in out transition. somebody please help me
I have my post dont want to duplicate itThe problem doesn't lie with your feed, although it does contain an error - you have given a non-existent sub-category. You need to stick to the categories and sub-categories listed here:
http://www.apple.com/itunes/podcasts/specs.html#categories
Subscribing to your feed from the iTunes Store page work as such, but the episodes throw up an error message. The problem lies with your episode media files: you are trying to stream them. Pasting the URL into a browser produces a download (where it should play the file) of a small file which does not play and in fact is a text file containing (in the case of ep.2) this:
[Reference]
Ref1=http://stream.riverratdoc.com/RiverratDoc/episode2.mp3?MSWMExt=.asf
Ref2=http://70.33.177.247:80/RiverratDoc/episode2.mp3?MSWMExt=.asf
You must provide a direct link to the actual mp3 file. Streaming won't work. The test is that if you paste the URL of the media file (as given in the feed) into the address bar of a browser it should play the file. -
Need help on XML Publisher Template features
Hi,
We have a requirement to develop an Invoice Register report to display the invoices for a period. Details of each Invoice and Amount needs to be displayed in a single line. At the bottom of each page we have to display running total of the Invoices displayed till that page. At the beginning of each page we have to display the total amount of Invoices displayed in the previous page.
We had developed the report using Reports Builder and registered concurrent program with output type as PDF. We are working in Spanish environment (UTF-8 character set). The report is working properly and producing output as required. But Spanish characters appear as junk character on the report. From Metalink Notes 443778.1 and 338990.1, I understand that PDF output in UTF-8 character set is not supported. We need to use XML Publisher to generate the PDF output.
We have developed .rtf template. It is generating PDF output and Spanish characters appearing properly. But we are not able to get the running total at the bottom of each page or total of previous page amounts at the beginning of each page. In the output from Reports Builder, we could use various page level options (like reset at page level, etc.) to achieve the requirement. But in the template generated using .rtf, I do not have such options.
I am not sure if there are advanced features in .rtf template to achieve the requirement. Could anyone please advise me how I can achieve the requirement? It would be great if you could provide me some reference.
Thanks and Regards,
NabenduHi 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 -
Need help with xml video gallery
Hello everyone
I recently bought a xml video gallery. I'm loading the movie externally into another movie. When the xml gallery loads, it cancels all sounds.
I need to figure out where in the actionscription can i reverse the cancellation of sounds. Can anyone help? if possible, I can email, whomever is willing to help, the xml gallery to see if theres another reason the sound is being canceled.
Also, the sound of the gallery doesn't work til you click the volume scroller.
Here are two parts of actionscript included in the gallery:
part one:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.collection_mc._ x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_mc.main_mc. collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._width));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound();
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true;if you mean sound works well when the gallery is tested without being loaded into another swf but fails when loaded, change the highlighted line:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.colle ction_mc._x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_m c.main_mc.collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._w idth));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound(this);
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true; -
Need help with XML transformation
I am not sure this is the right place for this. But i will try it here. I am very troubled with my XSLT. Trying to transform a text Coupon which has the following html for it. So,
_1. INPUT is:_
<html>
<head>
</head>
<body>
<p>
This coupon is for a good guy whose first name is :
</p>
<p>
</p>
<p align="center">
Sadd
</p>
<p align="center">
</p>
<p align="right">
<b>also</b> whose <var>full_name</var> is Sadd Hossain
</p>
<p align="left">
</p>
<p align="left">
He is a <font size="3">software </font><font size="4">engineer for</font><font size="5">
S&H</font>
</p>
</body>
</html>
*2. output needed is:*
<?xml version="1.0" encoding="UTF-8"?>
<POSMESSAGE>
<TextMSG >
This coupon is for a good guy whose first name is :
</TextMSG>
<TextMSG >
</TextMSG>
<TextMSG align="center">
<emph>SADD</emph>
</TextMSG>
<TextMSG >
</TextMSG>
<TextMSG align="right" >
also whose full_name is Sadd Hossain
</TextMSG>
<TextMSG>
</TextMSG>
<TextMSG align="left" >
He is a software engineer
for S&H
</TextMSG>
</POSMESSAGE>
*3. XSLT for this*
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="body">
<POSMESSAGE>
<xsl:for-each select="p">
<TextMSG>
<!--xsl:if test="not[@align='']"-->
<xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute>
<!--/xsl:if-->
<xsl:attribute name="font"><xsl:value-of select="@size"/></xsl:attribute>
<xsl:value-of select="."/>
</TextMSG>
<xsl:for-each select="b">
<emph>
<xsl:value-of select="."/>
</emph>
</xsl:for-each>
</xsl:for-each>
</POSMESSAGE>
</xsl:template>
</xsl:stylesheet>
*4: the above xslt generating this output*
<?xml version="1.0" encoding="UTF-8"?>
<POSMESSAGE><TextMSG align="" font="">
This coupon is for a good guy whose first name is :
</TextMSG><TextMSG align="" font="">
</TextMSG><TextMSG align="center" font="">
SADD
</TextMSG><TextMSG align="center" font="">
</TextMSG><TextMSG align="right" font="">
also whose full_name is Sadd Hossain
</TextMSG><TextMSG align="left" font="">
</TextMSG><TextMSG align="left" font="">
He is a software engineer
for S&H
</
*5: Need help with this. what should my xslt look like to get the desired output???????????????*
any help or direction will be very much appreciated. Thank you_I have below suggestions:
1. Please use code option given in message editor toolbar for posting any formatted content like XML, Java code snippet etc.
2. replace & in your source XML with _& a m p ;_ (Without spaces, I have put spaces to make it visible here).
3. I have modified your XSLT according output XML you have given. I am not sure what you want to do with some elements like <b>, <font>, <var> etc. change below XSLT as you require for these elements.
Modified XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="body">
<POSMESSAGE>
<xsl:for-each select="p">
<TextMSG>
<xsl:if test=". != ''">
<xsl:for-each select="@align">
<xsl:attribute name="align">
<xsl:value-of select="."></xsl:value-of>
</xsl:attribute>
</xsl:for-each>
<xsl:value-of select="."/>
</xsl:if>
</TextMSG>
</xsl:for-each>
</POSMESSAGE>
</xsl:template>
</xsl:stylesheet>
OUTPUT:
<?xml version="1.0"?>
<POSMESSAGE>
<TextMSG>This coupon is for a good guy whose first name is :</TextMSG>
<TextMSG/>
<TextMSG align="center">Sadd</TextMSG>
<TextMSG/>
<TextMSG align="right">alsowhose full_name is Sadd Hossain</TextMSG>
<TextMSG/>
<TextMSG align="left">He is a softwareengineer forS&H</TextMSG>
</POSMESSAGE> -
Need help with XML delay URGENT!!!
Hi i need help making a flash movie to load everything from
xml. It has to load text, images and flv, but, it has to load them
and end them at the time said in the xml. So flash loads and
unloade the text or image or video at the time specified in the
XML! PLEASE HELP I NEED THIS DONE TODAY!!!!! VERY IMPORTANT!!!
Contact me by msn [email protected] or send mail or
reply here!!It was probably a little unclear initially (no offence
intended ) whether your problem was with getting the data from XML
or with the sequencing aspect. I assume that its the sequencing
aspect based on your recent reply.
So if it was me I would parse the loaded info into Date
objects for the load and remove times and have this information
handled by some sort of sequencing code.
At its simplest, you could compare the xml-derived date/times
for load/unload with the current system date/time and use a
setInterval function to initiate the load after the calculated
difference in milliseconds has passed. Similar for the removeclip
timing. -
This is my xml code file.
<?xml version="1.0" encoding="iso-8859-1"?>
<contato_lista xmlns="includes:net_schema.xml">
<contato ID="001">
<nome>Andr�teste</nome>
<ip>192.168.25.242</ip>
</contato>
<contato ID="002">
<nome>Gustavo</nome>
<ip>192.168.25.72</ip>
</contato>
</contato_lista>
I am trying to get the text from the tags <nome> and <ip> from the 2 tags <contato>. And this is the method I am using. I am trying to get the text in the tags <nome> in the array contatos_lista[], everytime I run the program I get empty. Please I need help. I am desperade.
Thanks in advace.
public String[] importaContatos() {
String contatos_lista[] = new String[ 12 ];
contatos_lista[0] = "N�o h� contatos";
Node nodeContato;
NodeList contatoChild;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
File contatos = new File("D:/userdir/mycodes/NetMessage/contatos.xml");
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse( contatos );
}catch (SAXParseException spe) {
}catch (ParserConfigurationException e){
}catch(SAXException e){
}catch (IOException e){
Node nodeElement = document.getDocumentElement();
Node nodeChild = nodeElement.getParentNode();
Node nodeContatoLista = nodeChild;
NodeList contatoListaChild = nodeContatoLista.getChildNodes();
//JOptionPane.showMessageDialog(null , contatos_lista[0]);
for (int i = 0; i <= contatoListaChild.getLength(); i++){
nodeContato = nodeContatoLista.getFirstChild();
nodeContato = nodeChild.getNextSibling();
contatoChild = nodeContato.getChildNodes();
int count = 0;
for (int y = 0; y < contatoChild.getLength(); y++){
contatos_lista[count] = contatoChild.item(y).getNodeValue();
count++;
return contatos_lista;
}This is my xml code file.
<?xml version="1.0" encoding="iso-8859-1"?>
<contato_lista xmlns="includes:net_schema.xml">
<contato ID="001">
<nome>Andr�teste</nome>
<ip>192.168.25.242</ip>
</contato>
<contato ID="002">
<nome>Gustavo</nome>
<ip>192.168.25.72</ip>
</contato>
</contato_lista>
I am trying to get the text from the tags <nome> and
<ip> from the 2 tags <contato>. And this is the method
I am using. I am trying to get the text in the tags
<nome> in the array contatos_lista[], everytime I run
the program I get empty. Please I need help. I am
desperade.
Thanks in advace.
public String[] importaContatos() {
String contatos_lista[] = new String[ 12 ];
contatos_lista[0] = "N�o h� contatos";
Node nodeContato;
NodeList contatoChild;
DocumentBuilderFactory factory =
ctory = DocumentBuilderFactory.newInstance();
try {
File contatos = new
tatos = new
File("D:/userdir/mycodes/NetMessage/contatos.xml");
DocumentBuilder builder =
r builder = factory.newDocumentBuilder();
document = builder.parse( contatos );
}catch (SAXParseException spe) {
}catch (ParserConfigurationException e){
}catch(SAXException e){
}catch (IOException e){
Node nodeElement =
ement = document.getDocumentElement();
Node nodeChild = nodeElement.getParentNode();
Node nodeContatoLista = nodeChild;
NodeList contatoListaChild =
Child = nodeContatoLista.getChildNodes();
//JOptionPane.showMessageDialog(null ,
(null , contatos_lista[0]);
for (int i = 0; i <=
0; i <= contatoListaChild.getLength(); i++){
nodeContato =
deContato = nodeContatoLista.getFirstChild();
nodeContato = nodeChild.getNextSibling();
contatoChild =
tatoChild = nodeContato.getChildNodes();
int count = 0;
for (int y = 0; y <
y = 0; y < contatoChild.getLength(); y++){
contatos_lista[count] =
atos_lista[count] =
contatoChild.item(y).getNodeValue();
count++;
return contatos_lista;
}This line appears to be wrong to me
Node nodeChild = nodeElement.getParentNode();
Why are you doing that?
Anyway it would be easier just to do
ement = document.getDocumentElement();
NodeList contatoListaChild = ement.getElementsByTagName("contato");
for (int i = 0; i <= contatoListaChild.getLength(); i++){
Element contato = contatoListaChild.item(i); -
Need help in xml bursting email bodt contents based on condition
Dear All,
I have a requirement as below.
I am developing a xml publisher report with bursting functionality, i need to set a email body based on some condition, so please help me out how i can set the email body dynamically in xml bursting file.
Note:The email body may be huge. for ex:
Dear ${LINE_MANAGER_POSITION},<br/><br/>
The probationary period for ${FULL_NAME} holding Worker Number ${EMPLOYEE_NUMBER} will end on ${PROBATION_END_DATE}. Please be sure to assess the employee carefully and fill out the attached Probationary Period Report, sign it, and send it to your HR Business Partner ${HR_BP_EMP_NAME} before ${PROB_END_DATE_BEFORE}. <br/><br/>
Please note: <br/>
<ul> <li> The maximum probationary period allowed by UAE labor law is six months starting from the Hire Date. Probation extensions beyond six months are not permitted.</li> </ul>
<ul> <li> During the probationary period, the Employee has the right to end ${GENDER} employment contract with five working days notice period.</li> </ul>
<ul> <li> According to UAE labor law, the Employee is considered a permanent Employee with limited or unlimited contract if ${A_HE_SHE} is not notified that ${A_HE_SHE} is not suitable for the position ${A_HE_SHE} is assigned to. Dubai Petroleum Establishment Human Resources Division will consider the probationary period to be successful if you do not complete and sign the Probationary Period Evaluation form for ${FULL_NAME} before ${PROB_END_DATE_BEFORE}.</li> </ul>
<ul> <li> If the Employee passes the probationary period successfully and is subsequently deemed unsuitable for the assigned Position then the HR disciplinary process prevails.</li> </ul>
For more information on the Employee probationary period process and assessment approaches, please <a href="_http://dullap01/livelink/livelink.exe/open/29695955"> click here </a> or contact your Human Resources Business Partner ${HR_BP_EMP_NAME} at <a>${HR_BP_EMAIL}</a><br/><br/><br/>
Yours sincerely, <br/>
Human Resources Division </font>
Thnaks
Deblogo's should be pulling are the logo's directly embedded in format template?
Suggest you download and use the [Bursting Designer|http://bipublisher.blogspot.com/2009/09/bi-publisher-bursting-designer.html] and review the log file for errors. You will need to change your templates to point locally on your pc.
Ike Wiggins
http://bipublisher.blogspot.com -
I need help with XML coding. Please reply
I recently created a podcast. I submitted it to iTunes. All was successful but the download speed was Horrible. I had about 10 people test it -- after that the ISP I use shifted my Domain to a Streaming Server. The Tech then changed the specs to my iTunes <guid>. I updated the info on iTunes, but since then no one has been able to download it from iTunes. The RSS feed on the page ( website) works, but if I type it in to an RSS feed, I am even having problems getting it to recognize it.
I feel the main problem is that the shifting of servers and changing the <guid> caused a major problem. Since my ISP and Tech rep is mainly Windows oriented, his expertise with Apple is very little. ( As is mine ).
I will insert a snippet of the code and ask for Help... I really need to fix this, because I have secured another Domain, and wish to create a new podcast.
(BTW if any one listens to any of them, I now have a mixing board and Mic.. so I am trying to better it.)
Website: www.riverratdoc.com
snippet of XML code
<enclosure url="http://stream.riverratdoc.com/RiverratDoc/episode1a.mp3" length="9551933" type="audio/mpeg" />
<guid isPermaLink="false">09072010EPS01</guid><!-- just make unique per episode -->
<pubDate>Fri, 9 Jul 2010 12:40:01 GMT</pubDate>
Thank you in advance
River Rat DocThe problem doesn't lie with your feed, although it does contain an error - you have given a non-existent sub-category. You need to stick to the categories and sub-categories listed here:
http://www.apple.com/itunes/podcasts/specs.html#categories
Subscribing to your feed from the iTunes Store page work as such, but the episodes throw up an error message. The problem lies with your episode media files: you are trying to stream them. Pasting the URL into a browser produces a download (where it should play the file) of a small file which does not play and in fact is a text file containing (in the case of ep.2) this:
[Reference]
Ref1=http://stream.riverratdoc.com/RiverratDoc/episode2.mp3?MSWMExt=.asf
Ref2=http://70.33.177.247:80/RiverratDoc/episode2.mp3?MSWMExt=.asf
You must provide a direct link to the actual mp3 file. Streaming won't work. The test is that if you paste the URL of the media file (as given in the feed) into the address bar of a browser it should play the file. -
Need Help Removing XML Photo Gallery on Button Click
Hi, I'm new to flash so this might seem like a dumb question, but I'm right in the middle of designing a photography site and need some help. I have 4 buttons in my timeline that go to the corresponding frame labels when clicked, above each frame label is a keyframe with actionscript applied to it, that will load an external XML photo gallery. I need the current photo gallery that's on the screen to disappear when I click on a new button to load the new XML photo gallery. this is the code that will be above each frame label with a few changes, then below this is the code for my buttons. Any help is greatly appreciated. Thank you Code: Select all var imageX:XML; var imageList:XMLList; var canvas:MovieClip = new MovieClip(); var picLoader:Loader; addChild(canvas); canvas.x = -155; canvas.y = 160; var req:URLRequest = new URLRequest("gallery.xml"); var imageLoader:URLLoader = new URLLoader(); imageLoader.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(req); function onComplete(e:Event):void { imageX = new XML(imageLoader.data); imageList = imageX.image; picLoader = new Loader(); picLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, imageLoaded); picLoader.load(new URLRequest (imageList[0].url)); } function imageLoaded(e:Event):void { canvas.addChild(picLoader); } Code for the buttons in different keyframe. Code: Select all stop(); kids_btn.addEventListener(MouseEvent.CLICK,onKidsClick); couples_btn.addEventListener(MouseEvent.CLICK,onCouplesClick); portraits_btn.addEventListener(MouseEvent.CLICK,onPortraitsClick); bellies_btn.addEventListener(MouseEvent.CLICK,onBelliesClick); function onKidsClick(e:MouseEvent):void { gotoAndStop("kids"); } function onCouplesClick(e:MouseEvent):void { gotoAndStop("couples"); } function onPortraitsClick(e:MouseEvent):void { gotoAndStop("portraits"); } function onBelliesClick(e:MouseEvent):void { gotoAndStop("bellies"); }
Hi, I'm new to flash so this might seem like a dumb question, but I'm right in the middle of designing a photography site and need some help. I have 4 buttons in my timeline that go to the corresponding frame labels when clicked, above each frame label is a keyframe with actionscript applied to it, that will load an external XML photo gallery. I need the current photo gallery that's on the screen to disappear when I click on a new button to load the new XML photo gallery. this is the code that will be above each frame label with a few changes, then below this is the code for my buttons. Any help is greatly appreciated. Thank you Code: Select all var imageX:XML; var imageList:XMLList; var canvas:MovieClip = new MovieClip(); var picLoader:Loader; addChild(canvas); canvas.x = -155; canvas.y = 160; var req:URLRequest = new URLRequest("gallery.xml"); var imageLoader:URLLoader = new URLLoader(); imageLoader.addEventListener(Event.COMPLETE, onComplete); imageLoader.load(req); function onComplete(e:Event):void { imageX = new XML(imageLoader.data); imageList = imageX.image; picLoader = new Loader(); picLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, imageLoaded); picLoader.load(new URLRequest (imageList[0].url)); } function imageLoaded(e:Event):void { canvas.addChild(picLoader); } Code for the buttons in different keyframe. Code: Select all stop(); kids_btn.addEventListener(MouseEvent.CLICK,onKidsClick); couples_btn.addEventListener(MouseEvent.CLICK,onCouplesClick); portraits_btn.addEventListener(MouseEvent.CLICK,onPortraitsClick); bellies_btn.addEventListener(MouseEvent.CLICK,onBelliesClick); function onKidsClick(e:MouseEvent):void { gotoAndStop("kids"); } function onCouplesClick(e:MouseEvent):void { gotoAndStop("couples"); } function onPortraitsClick(e:MouseEvent):void { gotoAndStop("portraits"); } function onBelliesClick(e:MouseEvent):void { gotoAndStop("bellies"); }
-
Stax reading /writing need help from xml guru plz
hi, i have been told that stax reading /writing should involve no overhead and that is why i use it and i am now able to write my large data to file, but using my reader i seem to run out of memory, using netbeans profiler i ahve found that char[] seems to be the problem,
by backtracing i ahve found that javax.xml.parser.SAXParser.parse calls the xerces packages which eventually leads to the char[ ], now my code for my reader is attatched here...
package utilities;
import Categorise.Collection;
import Categorise.Comparison;
import Categorise.TestCollection;
import java.io.IOException;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.Attributes;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import measures.Protocol;
* @author dthomas
public class XMLParser extends DefaultHandler
static Collection collection = new Collection();
List<Short> cList;
List<Comparison> comparisonList;
File trainFileName;
File testFileName;
TestCollection tc;
List<TestCollection> testCollectionList;
List<File> testFileNameList = new ArrayList<File>();
List<File> trainFileNameList = new ArrayList<File>();
boolean allTrainsAdded = false;
Protocol protocol;
List<File> trainingDirList;
File testingDir;
int counter = 0;
File[ ] trainingDirs;
File[ ] trainingFileNames;
File[ ] testFileNames;
TestCollection[ ] testCollections;
Comparison[ ] comparisons;
Comparison c;
short[ ] cCounts;
String order;
String value;
File trainDir;
/** Creates a new instance of XMLParser */
public XMLParser() {
public static Collection read( File aFile )
long startTime = System.currentTimeMillis();
System.out.println( "Reading XML..." );
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp;
try {
sp = spf.newSAXParser();
sp.parse( aFile, new XMLParser() );
} catch (IOException ex) {
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
} catch (ParserConfigurationException ex) {
ex.printStackTrace();
long endTime = System.currentTimeMillis();
long totalTime = ( endTime - startTime ) / 1000;
System.out.println( "Done..." + totalTime + " seconds" );
return collection;
public void startElement(String uri,String localName,String qName, Attributes attributes)
if( qName.equals( "RE" ) )
testCollectionList = new ArrayList<TestCollection>();
else if( qName.equals( "p") )
boolean isConcatenated = new Boolean( attributes.getValue( "c" ) );
boolean isStatic = new Boolean( attributes.getValue( "s" ) );
protocol = new Protocol( isConcatenated, isStatic );
else if( qName.equals( "trdl" ) )
trainingDirList = new ArrayList<File>();
else if( qName.equals( "trd" ) )
trainDir = new File( attributes.getValue( "fn" ) );
trainingDirList.add( trainDir );
else if( qName.equals( "td" ) )
testingDir = new File( attributes.getValue( "fn" ) );
else if( qName.equals( "TC" ) )
counter++;
System.out.println( counter );
comparisonList = new ArrayList<Comparison>();
testFileName = new File( attributes.getValue( "tfn" ) );
testFileNameList.add( testFileName );
tc = new TestCollection( );
tc.setTestFileName( testFileName );
else if ( qName.equals( "r" ) )
order = attributes.getValue( "o" );
value = attributes.getValue( "v" );
cList.add( Short.parseShort( order ), new Short( value ) );
else if( qName.equals( "c" ) )
cList = new ArrayList<Short>();
trainFileName = new File( attributes.getValue( "trfn" ) );
if( !allTrainsAdded )
trainFileNameList.add( trainFileName );
public void characters(char []ch,int start,int length)
//String str=new String(ch,start,length);
//System.out.print(str);
public void endElement(String uri,String localName,String qName)
if (qName.equals( "c") )
allTrainsAdded = true;
cCounts = new short[ cList.size() ];
for( int i = 0; i < cCounts.length; i++ )
cCounts[ i ] = cList.get( i );
c = new Comparison( trainFileName, tc );
c.setcCounts( cCounts );
this.comparisonList.add( c );
else if( qName.equals( "TC" ) )
comparisons = new Comparison[ comparisonList.size() ];
comparisonList.toArray( comparisons );
tc.setComparisons( comparisons );
testCollectionList.add( tc );
else if( qName.equals( "RE" ) )
testCollections = new TestCollection[ testCollectionList.size() ];
testCollectionList.toArray( testCollections );
collection.setTestCollections( testCollections );
testFileNames = new File[ testFileNameList.size() ];
testFileNameList.toArray( testFileNames );
collection.setTestingFiles( testFileNames );
//String[ ] testCategories = new String[ testCategoryList.size() ];
//testCategoryList.toArray( testCategories );
//collection.setTestCategories( testCategories );
trainingFileNames = new File[ trainFileNameList.size() ];
trainFileNameList.toArray( trainingFileNames );
collection.setTrainingFiles( trainingFileNames );
//String[ ] trainingCategories = new String[ trainCategoryList.size() ];
//trainCategoryList.toArray( trainingCategories );
//collection.setTrainingCategories( trainingCategories );
collection.setProtocol( protocol );
trainingDirs = new File[ trainingDirList.size() ];
trainingDirList.toArray( trainingDirs );
collection.setTrainingDirs( trainingDirs );
collection.setTestingDir( testingDir );
//else
//System.out.println("End element: {" + uri + "}" + localName);
}i thought it may have been a recursive problme, hence having so many instance variables instead of local ones but that hasn't helped.
all i need at the end of this is a Collection which holds an array of testCollections, which holds an array of cCounts and i was able to hold all of this in memory as all i am loading is what was in memory before it was written.
can someone plz help
ps when i use tail in unix to read the end of the xml file it doesnt work correctly as i cannot specify the number of lines to show, it shows all of the file as thought it is not split into lines or contains new line chars or anything, it is stored as one long stream, is this correct??
here is a snippet of the xml file:
<TC tfn="
/homedir/dthomas/Desktop/4News2/output/split3/alt.atheism/53458"><c trfn="/homed
ir/dthomas/Desktop/4News2/output/split0/alt.atheism/53586"><r o="0" v="0"></r><r
o="1" v="724"></r><r o="2" v="640"></r><r o="3" v="413"></r><r o="4" v="245"></
r><r o="5" v="148"></r><r o="6" v="82"></r><r o="7" v="52"></r><r o="8" v="40"><
/r><r o="9" v="30"></r><r o="10" v="22"></r><r o="11" v="16"></r><r o="12" v="11
"></r><r o="13" v="8"></r><r o="14" v="5"></r><r o="15" v="2"></r></c><c trfn="/
homedir/dthomas/Desktop/4News2/output/split0/alt.atheism/53495"><r o="0" v="0"><
/r><r o="1" v="720"></r><r o="2" v="589"></r><r o="3" v="349"></r><r o="
please if anyone has any ideas from this code why a char[] would use 50% of the memory taken, and that the average age seems to show that the same one continues to grow..
thanks in advance
danny =)hi, i am still having lo luck with reading the xml data back into memory, as i have said before, the netbeans profiler is telling me it is a char[] that is using 50% of the memory but i cannot see how a char[] is created, my code doesn't so it must be the xml code...plz help
-
Need help processing XML files
I'm fairly new to Java and have never worked with XML. I need to process several XML files and display them in a matrix for comparison and I'm not sure if I need to understand SAX, DOM or some other API. I'm not creating the files, I'm just parsing them to put into a table so they can be displayed for comparison. I could be processing up to several hundreds of files, so performance would also be an issue.
I'm just looking for options and possible areas I can begin to look for help. Can anyone tell me which APIs would help me acheive my goal?
Any help would be greatly appreciated.
ThanksThanks for the response Kev. I guess a better diescription of the problem would be to say that I want to display the attributes and values of the differnet files in a matrix.
For example...
Here are 2 sample xml files with the same tags and attributes.
XML FILE A
<tag1 name="Fred", country="ca">
<tag2 group-name="Group 1">
<tag3 color ="blue">
</tag3>
</tag2>
</tag1>
XML FILE B
<tag1 name="Sue", country="us">
<tag2 group-name="Group 2">
<tag3 color="red">
</tag3>
</tag2>
</tag1>
I would like to have them displayed as follows...
XML FILE A XML FILE B
tag1 name Fred Sue
tag1 country ca us
tag2 group-name Group 1 Group 2
tag3 Color Blue Red
HTML tags didn't work, so the matrix is bunched together, but I think you get the idea. My question is, which would be better to use SAX or DOM. I could be running this on as many as 50 or 60 files, so the matrix could get very large and performance could be an issue as multiple users could be doing this comparison at the same time. -
I have a very large unstructured document that I need to convert to XML. This document once had a structure applied to it but somehow this structure was deleted (not by me). Since the structure was deleted, a fair amount of content has been added to the file.
Ive been reading through PDF help files and trying to figure out how to solve this problem. I am very new to this so any help or input would really be great.
So far thoughts on converting to XML are:
1) Get structure back working in the original file. I do not know if there is a way to transfer the structure Pre-Loss to the new file. I have created a conversion table already that I can use. I have ran the CT and created what seems to be a structured document, but I think I may be missing further steps.
2) Export the element definitions to an EDD
3) Convert the EDD to a DTD
4) Create a template file (not sure how to do this?)
Finally export to XML. Before I start on this some feedback would be very welcomed. Sorry I am very inexperienced with all of this.Hello Frank,
with the conversion there is a problem concering the graphics/ xrefs.
after you have created the conversion table and structured your document you now can
save the document as xml file.
In the output you then will still have all graphics that are in the document, but the xrefs are missing.
convert the document via StructureTools > Utilities > Convert Documents to Structured Format.
In the output you then will have all the xrefs, but the graphics are missing.
However, it's possible that I'm not up-to-date her as I haven't tried this since quite some time now.
Point 2 and 3 from your list:
Normally it's the other way around: You have a DTD and import that as a new EDD file in FrameMaker.
Also I don't think that there really is a possiblity to export any element definitions from FrameMaker. But I'm happy, if you are able to disabuse me here.
Template file:
Any FM file. It just contains the page layout and the character formats etc.
What you need to do is to add a Structured Application containing all the information on where to find the Template, EDD, DTD and also the read and write rules.
With FrameMaker there are several Structured Applications delivered, e.g. DITA.
If you do not have enough experience to create a new structured application without any model, it's best to copy and modify one of these.
Regards,
Anna -
Hello, I would like to create an extention that will help to
manage a
glossary.
First I need to decide on the structure of the xml document
that will
contain all glossary entries. Since I don't have much
experience with XML in
extention content, I was wondering if there are certain
recommendations I
should follow.
What is preferable: using attributes that will holt the
content or rather
having xml-elements. What is easy to parce?
I would greatly appreciate any tips, help and suggestions.
Olyalyu.oO(olga)
>First I need to decide on the structure of the xml
document that will
>contain all glossary entries. Since I don't have much
experience with XML in
>extention content, I was wondering if there are certain
recommendations I
>should follow.
I would start as simple as possible, for example with
something like
this:
<glossary>
<entry>
<term>...</term>
<explanation>...</explanation>
</entry>
<entry>
<term>...</term>
<explanation>...</explanation>
</entry>
</glossary>
Of course it also depends on what you want to do with this
structure and
if you need additional informations.
>What is preferable: using attributes that will holt the
content or rather
>having xml-elements. What is easy to parce?
There's no real rule-of-thumb whether to use elements or
attributes.
If unsure, use elements.
Micha -
Hello experts,
I have to validate a xml against schema.I have used some java code & xerces jar ro solve this problem.It's working fine.But it's showing only first error & it's coming out.I want to list all the errors.Please help me by guiding how to achieve it.Right now the code I am using is easy enough , I just need to provide the schema file & xml file.But if I have to find out all the errors , do I need to parse it line by line?Please help.Thanx tonn in advance.Ya . this is possible if you have heard about XSLT transformation .
File xmlFile = new File("XmlFileToTransform");
File xsltFile = new File("U R SCHEMA");
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new NullResolver());
FileOutputStream fos = new FileOutputStream(out);
Writer out = new BufferedWriter(new OutputStreamWriter(fos,
"UTF8"));
SAXSource xmlSource = new SAXSource(reader, new InputSource(
xmlFile.toURI().getRawPath()));
Source xsltSource = new StreamSource(xsltFile);
Result result = new StreamResult(out);
// create an instance of TransformerFactory
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
trans.transform(xmlSource, result); // this will transform xml according to u r xslt file
out.close();see if this is helpful for u !
Maybe you are looking for
-
How to use a java class in difference project under a same workspace!
Hi, there: I have a problem. I want to reuse a java class which is located in another project of the same workspace. I do not know how to set the two project setting or how to import the java class. I deeply appreciate. Sheng-He
-
and i planned to use VMware...
-
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: https://js2.wlxrs.com/_D/F$Live.SiteContent.Messenger/4.2.61210/release/Microsoft.Live.
-
I love that the IMG provides an aspect-ratio control (as previous Motorola boxes on Comcast didn't seem to do). But, on mine at least, I can't use it when watching VOD. Is this by design, or is it a bug? Because HBO is so overprotective about their
-
How to recovery rar file?
Friends sent me an archive of photos and documents, but when I unpack it gives CRC error. Tell me how to cope with this problem.