Can someone spot why my variable is being dropped between scripts?
T-Code 1/Flavor1/Script 1:
Copy Value – variable1 ‘instruction’ (from screen)
Copy Value – variable2 ‘anchor’ (from screen)
Pre-Process …..
If Success
Call Script2:
/nDP91 (Change T-Code) Refresh Screen
Paste value ‘anchor’
Push (i.e. trigger DP91 with the appropriate source sales order)
Refresh Screen (we are now in T-code2/Flavor2)
If NO Message (sbar empty) – Progress DP91 Resource Related Billing
Paste value ‘instruction’ to flavor work area for use later THIS DOES NOT WORK??
We are now sitting in a flavour of DP91 but my navigation reference ‘instruction’ is lost
If Message (no RRB to work with)
Use saved variables and circle back to T-Code 1/Flavor1 (This works fine and 'instruction' as part of that movement)
If NOT Success
Error Message
Any thought much appreciated.
Can you post your script screenshots?
Thanks,
Bhaskar
Similar Messages
-
Action Script 3, can someone spot where my code is wrong?
I want to have my characters controlled separately, with 'FireBoy' moving using the left, up and right keys and with 'WaterGirl' moving with the a, w and d keys. However upon editing my code somehow WaterGirl now moves with the right key instead of the d key. Please can someone spot where I have made a mistake and advise me on how to resolve the problem.
My code for main.as is:
package
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
* @author Harry
public class Main extends Sprite
private var leftDown:Boolean = false;
private var rightDown:Boolean = false;
private var aDown:Boolean = false;
private var dDown:Boolean = false;
private var FireBoy:Hero = new Hero();
public var StartButton:Go;
public var WaterGirl:Female = new Female();
public var Door1:Firedoor;
public var Door2:Waterdoor;
public var Fire:Lava;
public var Water:Blue;
public var Green:Gem;
public function Main():void
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
public function init(e:Event = null):void
StartButton = new Go();
StartButton.x = 100;
StartButton.y = 5;
addChild(StartButton);
StartButton.addEventListener(MouseEvent.CLICK, startgame);
private function startgame(e:Event = null):void
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
removeChild(StartButton);
FireBoy.y = 495;
addChild(FireBoy);
stage.addEventListener(Event.ENTER_FRAME, HerocheckStuff);
stage.addEventListener(KeyboardEvent.KEY_DOWN, HerokeysDown);
stage.addEventListener(KeyboardEvent.KEY_UP, HerokeysUp);
WaterGirl.x = 70;
WaterGirl.y = 495;
addChild(WaterGirl);
stage.addEventListener(Event.ENTER_FRAME, FemalecheckStuff);
stage.addEventListener(KeyboardEvent.KEY_DOWN, FemalekeysDown);
stage.addEventListener(KeyboardEvent.KEY_UP, FemalekeysUp);
Door1 = new Firedoor();
stage.addChild(Door1);
Door1.x = 5;
Door1.y = 62;
Door2 = new Waterdoor();
stage.addChild(Door2);
Door2.x = 100;
Door2.y = 62;
Fire = new Lava();
stage.addChild(Fire);
Fire.x = 160;
Fire.y = 570;
Water = new Blue();
stage.addChild(Water);
Water.x = 350;
Water.y = 160;
Green = new Gem()
stage.addChild(Green);
Green.x = 500;
Green.y = 100;
graphics.beginFill(0x804000, 1);
graphics.drawRect(0, 0, 800, 40);
graphics.endFill();
graphics.beginFill(0x804000, 1);
graphics.drawRect(0, 170, 600, 40);
graphics.endFill();
graphics.beginFill(0x804000, 1);
graphics.moveTo(800, 200);
graphics.lineTo(800, 700);
graphics.lineTo(400, 700);
graphics.lineTo(100, 700);
graphics.endFill();
graphics.beginFill(0x804000, 1);
graphics.drawRect(0, 580, 800, 40);
graphics.endFill();
public function Collision():void
if (WaterGirl.hitTestObject(Fire))
WaterGirl.x = 70;
WaterGirl.y = 495;
if (FireBoy.hitTestObject(Water))
FireBoy.x = 15;
FireBoy.y = 495;
public function HerocheckStuff(e:Event):void
if (leftDown)
FireBoy.x -= 5;
if (rightDown)
FireBoy.x += 5;
FireBoy.adjust();
Collision();
Check_Border();
public function HerokeysDown(e:KeyboardEvent):void
if (e.keyCode == 37)
leftDown = true;
if (e.keyCode == 39)
rightDown = true;
if (e.keyCode == 38)
FireBoy.grav = -15;
Collision();
Check_Border();
public function HerokeysUp(e:KeyboardEvent):void
if (e.keyCode == 37)
leftDown = false;
if (e.keyCode == 39)
rightDown = false;
public function FemalecheckStuff(e:Event):void
if (aDown)
WaterGirl.x -= 5;
if (rightDown)
WaterGirl.x += 5;
WaterGirl.adjust2();
Collision();
Check_Border();
public function FemalekeysDown(e:KeyboardEvent):void
if (e.keyCode == 65)
aDown = true;
if (e.keyCode == 68)
dDown = true;
if (e.keyCode == 87)
WaterGirl.grav = -15;
Collision();
Check_Border();
public function FemalekeysUp(e:KeyboardEvent):void
if (e.keyCode == 65)
aDown = false;
if (e.keyCode == 68)
dDown = false;
public function Check_Border():void
if (FireBoy.x <= 0)
FireBoy.x = 0;
else if (FireBoy.x > 750)
FireBoy.x = 750;
if (WaterGirl.x <= 0)
WaterGirl.x = 0;
else if (WaterGirl.x > 750)
WaterGirl.x = 750;
My code for Hero.as (FireBoy) is:
package
import flash.display.Bitmap;
import flash.display.Sprite;
public class Hero extends Sprite
[Embed(source="../assets/FireBoy.jpg")]
private static const FireBoy:Class;
private var FireBoy:Bitmap;
public var grav:int = 0;
public var floor:int = 535;
public function Hero()
FireBoy = new Hero.FireBoy();
scaleX = 0.1;
scaleY = 0.1;
addChild(FireBoy);
public function adjust():void
this.y += grav;
if(this.y+this.height/2<floor)
grav++;
else
grav = 0;
this.y = floor - this.height / 2;
if (this.x - this.width / 2 < 0)
this.x = this.width / 2;
if (this.x + this.width / 2 > 800)
this.x = 800 - this.width / 2;
And finally my code for Female.as (WaterGirl) is:
package
import flash.display.Bitmap;
import flash.display.Sprite;
* @author Harry
public class Female extends Sprite
[Embed(source="../assets/WaterGirl.png")]
private static const WaterGirl:Class;
private var WaterGirl:Bitmap;
public var grav:int = 0;
public var floor:int = 535;
public function Female()
WaterGirl = new Female.WaterGirl();
scaleX = 0.1;
scaleY = 0.1;
addChild(WaterGirl);
public function adjust2():void
this.y += grav;
if(this.y+this.height/2<floor)
grav++;
else
grav = 0;
this.y = floor - this.height / 2;
if (this.x - this.width / 2 < 0)
this.x = this.width / 2;
if (this.x + this.width / 2 > 800)
this.x = 800 - this.width / 2;You should make use of the trace function to troubleshoot your processing. Put traces in the different movement function conditionals to see which is being used under which circumstances. You might consider putting the movement code into one function since they all execute when you process a keyboard event anyways.
-
Can someone explain why upgrading to PSE 12 resulted in two kinds of people tags?
Can someone explain why upgrading to PSE 12 resulted in two kinds of people tags? One is the new Group tag (with its own two-person icon) and the other tag is the original People tag (one perswon silhouette icon) from previous version. If person already had been tagged the new People Group will not work. Anyone else having a problem or has found a solution?
jlovettjr wrote:
I would have no problem with using the new People tabs except for two things:
1) There are pictures of people that facial recognition cannot handle. An example would be a profile view. These have already been tagged with old people tags. The new People Tab is dependent on facial recognition and will not accept these.
I don't use facial recognition at all, sorry.
2) The mystery is that the conversion from old to new was not automatic during the upgrade. Hours on telephone with Adobe tech did not resolve how one reconciled the two different tags. It appears to be more than a problem of naming the tags.
As I explained, there was no conversion at all with my own categories, and I was too happy for that. From a number of other posts on that subject, I don't think that reconciling the two different kinds of tags is possible. I think I'll try a new conversion from an old PSE6 catalog so that I can play with the new scheme; that should work even without face tagging. -
Can someone explain why the Secure Easy Setup light on a...
Can someone explain why the Secure Easy Setup light on a WRT54G would change from a steady green to steady orange after firmware upgrade? Everything is connecting properly, and I see no change in performance of network other than light change described. Thanks.
The way I understand the Secure Easy Setup button is this.
It will be orange when the router is in normal operation mode. The light turns green when you press the Cisco Systems button (that is orange normally) so that the router will search for the web device you are trying to connect to the router. If you want to disable this feature all together go into your router settings page at 192.168.1.1
Go to the Wireless tab, and then the Advanced Wireless Settings sub-heading, once in there look for the option SecureEasysetup and simply set it to disable (enabled is default) then click the save now and apply the settings. The light should be out now meaning you don't have the Secure Setup feature enabled.
It is just a personal choice to have it on or off, it should not affect router or internet performance unless you hit the button trying to connect a device to the network.
Message Edited by MontanaXVI on 12-14-2007 07:12 PM -
Can someone tell why when I delete an item in iCloud it is automatically deleted from my MacBook Pro and also what to do to avoid losing the data ?
I have just received an email from the Apple Support Community (created by Kappy) with a list of useful links (created by Kappy) about how to use iCloud which I feell might help other users and which I have taken the liberty to enclose in this reply
Apple - iCloud - Your content. On all your devices.
Apple iCloud - Pertinent Questions
Apple IDs and iCloud
How to stay synced with iCloud | Crave - CNET
iCloud Help
iCloud- What you need to know | Macworld
iOS 5 & iCloud Tips- Sharing an Apple ID With Your Family
Learn more about iCloud
iCloud- Limits for Contacts, Calendars, Reminders, and Bookmarks
iCloud- Troubleshooting iCloud Contacts -
Can someone explain why the search facility in my icloud mail is do f*&£ing S&*t? It never works, whether I access it in Google Chrome or Firefox. *****
SeamusUK wrote:
Can someone explain why ....
Probably not.
If you have any suggestions that you think might enhance iCloud you can send Apple your feedback here. -
My iPhone 4s gets really warm. Can someone explain why? It gets warm when I'm browsing.
computer CPUs use very small wires that heat up when electricity is passed through them. Its actually one of the major limiting factors in miniaturization, making the wires too small and they melt.
-
Hello
There is a bug in Mac InDesign CS4 and CS5 which causes InDesign to crash if text containing a variable is copied. I am hoping this bug is fixed in CS5.5.
So can someone with Mac CS5.5 try this for me and report back:
1. create a variable, or use one already created by Adobe
2. insert it into some text
3. copy the text
4a. try pasting it into another part of the same document
4b. try pasting it into an external document, for example an Excel file.
Hopefully it won't crash and you will be able to tell me whether it is fixed or not! If variables do not cause InDesign to crash when copied then it might be worthwhile for me to upgrade to CS5.5.These problems are rarely easy to debug.
It appears from your crash report:
5 com.adobe.PDFL 0x216ef8e3 PDDocGetMergedXAPKeywords + 86221
That the problem is in the Adobe PDF Library (not surprising, this is what reads PDF files) when getting "merged XAP keywords," whatever those are.
I believe the XAP: metadata has been superceded by XMP metadata, so this suggests your PDF files have corrupt XMP metadata, or XMP metadata that InDesign cannot deal with.
You might try running some of the preflights and fixups in Acrobat that relate to analysis of XMP metadata,
or simply removing XMP Metadata from the PDF entirely, again in Acrobat.
It sounds like this is a genuine InDesign bug (even if your PDF file was damaged, it should not crash ID!), so you should open a case with Adobe Support and get them to file a bug (http://adobe.com/go/supportportal). Optimistically, such a bug is unlikely to be fixed in time for CS6, so don't expect miracles. Think of it as making sure your bug doesn't hurt other people two years from now. -
Can someone see why im getting error in this query ?
I had 2 queries , instead of using left join i put them together. Now i get error , can someone just take a look to see if syntax wrong somewhere ?
select * from
select i.ips,
a.ips,
a.question_type,
sum(a.score) score,
p.project_name,
p.project_segment,p.location,p.project_exec_model,
p.project_exec_model||' - '||p.project_config pmodel,
one.score schedule,two.score cost,three.score execution,four.score commercial,
nvl(one.score,0)+nvl(two.score,0)+nvl(three.score,0)+nvl(four.score,0) as total,
(select sum(prev_score) prev from XT_RISK_PAST2 where ips = i.ips) prev_score,
(select max(createdt) from tbl_risk_answer where (ips,sample_num) in
(select ips,max(sample_num) from VW_RISK_SCORE group by ips) and ips=i.ips) last_dt
from
(select v.project_id,v.ips,v.sample_num,v.question_id,v.header_desc,v.section_area,v.score,
decode(bi_recurse(q.active_question,1,2),2,'OTR','-')||decode(bi_recurse(q.active_question,1,1),1,'ITO','-') question_type
from VW_RISK_SCORE v left join tbl_risk_question q on v.question_id=q.question_id
where (v.project_id,v.sample_num) in
(select project_id,max(sample_num) sample_num from VW_RISK_SCORE group by project_id)
) a,
(select distinct ips from VW_RISK_SCORE) i,
(select ips, sum(score) score from VW_RISK_SCORE where section_area=1 group by ips) one,
(select ips, sum(score) score from VW_RISK_SCORE where section_area=2 group by ips) two,
(select ips, sum(score) score from VW_RISK_SCORE where section_area=3 group by ips) three,
(select ips, sum(score) score from VW_RISK_SCORE where section_area=4 group by ips) four,
tbl_risk_project p
where i.ips=one.ips(+) and i.ips=two.ips(+) and i.ips=three.ips(+) and i.ips=four.ips(+) and ito on scores.ips=ito.ips
and i.ips=p.ips and a.question_type='-ITO' group by i.ips,a.ips, a.question_type, p.project_name, p.project_segment, p.location, p.project_exec_model, p.project_exec_model||' - '||p.project_config, one.score, two.score, three.score, four.score, nvl(one.score,0)+nvl(two.score,0)+nvl(three.score,0)+nvl(four.score,0), (select sum(prev_score) prev from XT_RISK_PAST2 where ips = i.ips), (select max(createdt) from tbl_risk_answer where (ips,sample_num) in
(select ips,max(sample_num) from VW_RISK_SCORE group by ips) and ips=i.ips)
) scores and here is error I get.
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 12
ORA-00920: invalid relational operator
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.
Error at Line: 30 Column: 4You would move them to the from-clause, just like one, two, three and four.
Something like:
untested for obvious reasons
select *
from (select i.ips,
a.ips,
a.question_type,
sum(a.score) score,
p.project_name,
p.project_segment,
p.location,
p.project_exec_model,
p.project_exec_model || ' - ' || p.project_config pmodel,
one.score schedule,
two.score cost,
three.score execution,
four.score commercial,
nvl(one.score, 0) + nvl(two.score, 0) + nvl(three.score, 0) +
nvl(four.score, 0) as total,
(select sum(prev_score) prev
from xt_risk_past2
where ips = i.ips) prev_score,
(select max(createdt)
from tbl_risk_answer
where (ips, sample_num) in
(select ips, max(sample_num)
from vw_risk_score
group by ips)
and ips = i.ips) last_dt
from (select v.project_id,
v.ips,
v.sample_num,
v.question_id,
v.header_desc,
v.section_area,
v.score,
decode(bi_recurse(q.active_question, 1, 2),
2,
'OTR',
'-') ||
decode(bi_recurse(q.active_question, 1, 1),
1,
'ITO',
'-') question_type
from vw_risk_score v
left join tbl_risk_question q
on v.question_id = q.question_id
where (v.project_id, v.sample_num) in
(select project_id, max(sample_num) sample_num
from vw_risk_score
group by project_id)) a,
(select distinct ips from vw_risk_score) i,
(select ips, sum(score) score
from vw_risk_score
where section_area = 1
group by ips) one,
(select ips, sum(score) score
from vw_risk_score
where section_area = 2
group by ips) two,
(select ips, sum(score) score
from vw_risk_score
where section_area = 3
group by ips) three,
(select ips, sum(score) score
from vw_risk_score
where section_area = 4
group by ips) four,
tbl_risk_project p
-- moved part I
(select ips,
sum(prev_score) prev
from xt_risk_past2
where ips = i.ips) five --or whatever
-- moved part II
(select ips,
max(createdt) maxcreatedt
from tbl_risk_answer
where (ips, sample_num) in (select ips, max(sample_num)
from vw_risk_score
group by ips)
group by ips) six -- or whatever
where i.ips = one.ips(+)
and i.ips = two.ips(+)
and i.ips = three.ips(+)
and i.ips = four.ips(+)
and i.ips = five.ips -- outerjoin if needed
and i.ips = five.ips -- outerjoin if needed
and ito on scores.ips = ito.ips
and i.ips = p.ips
and a.question_type = '-ITO'
group by i.ips,
a.ips,
a.question_type,
p.project_name,
p.project_segment,
p.location,
p.project_exec_model,
p.project_exec_model || ' - ' || p.project_config,
one.score,
two.score,
three.score,
four.score,
nvl(one.score, 0) + nvl(two.score, 0) +
nvl(three.score, 0) + nvl(four.score, 0),
five.prev,
six.maxcreatedt
) scoresI wonder how all this is going to perform by the way....all those scalar subqueries and outer joins are expensive....
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1594885400346999596
Read up on Subquery Factoring/WITH-clause, and try to rewrite parts of your query.
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:4423923392083 -
Since I upgraded to 3.6.3 my bookmarks folder has become nearly half the size upon exporting it in html format. I normally refresh my working copy of Mozilla by saving the bookmarks and then erasing all aspects of Firefox and starting over from scratch. I am concerned that if I rely upon this smaller folder I may be losing data. Can someone tell me what is happening here? It could be that this is just an improvement in Firefox but I do not know how to test the waters to see if all my data is saved.
Are you comparing the size of the bookmarks.html file that is exported from Firefox 3.6.3 to a bookmarks.html file that was exported from earlier versions of Firefox?
Really shouldn't be a difference, there hasn't been a change to Firefox regarding the bookmarks.html file in years. -
Can someone explain why my keyboard want pop up?
my ipad keyboard want pop up for some reason can someone explian wky?
The iPad isn't paired to a bluetooth keyboard (Settings > Bluetooth) ? If not and you don't get the on-screen keyboard when tapping on a text entry field then try a reset and see if it shows after the iPad has restarted : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
-
I am having difficulties downloading books to my ilibrary. Can someone assist?
Have you submitted your proof of eligibility? Are you able to find the software listed on your product page?
-
My memory is messed up, can someone answer the question regarded the memory?
Try to finish the download then delete the show if not a resotre is needed
-
Can someone explain why the 6270 has no software/f...
Maybe someone can answer, why we don't have any firmware for this phone. Is there a update.
If you mean that it's not supported by Nokia Software Updater, I think that more models are being added to the NSU all the time.
That isn't to say that there are no newer versions of the the other phone models.
Have you checked that you have the latest version?
640K Should be enough for everybody
El_Loco Nokia Video Blog -
Can someone explain why one code works and the other one doesn't?
Hi,
I have been doing a little work with XML today and I wrote the following code which did not function properly. In short, it was as if there were elements in the NodeList that disappeared after the initial call to NodeList.getElementsByTagName("span"); The code completely drops through the for loop when I make a call to getTextContent, even though it is not a controlling variable and it does not throw an exception! I'm befuddled. The second portion of code works. For what it is worth, tidy is the HTML cleaner that's been ported to java (JTidy) and parseDOM(InputStream, OutputStream) is supposed to return a Document, which it does! So why I have to call a DocumentBuilderFactory and then get a DocumentBuilder is beyond me. If I don't call Node.getTextContent() the list is processed properly and calls to toString() indicate that the class nodes are in the list! Any help would be appreciated!
import com.boeing.ict.pdemo.io.NullOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Properties;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.tidy.Tidy;
public class HTMLDocumentProcessor {
// class fields
private Properties tidyProperties = null;
private final String tidyConfigFile =
"com/boeing/ict/pdemo/resources/TidyConfiguration.properties";
* Creates a new instance of HTMLDocumentProcessor
public HTMLDocumentProcessor() {
initComponents();
private void initComponents() {
try {
tidyProperties = new Properties();
tidyProperties.load(ClassLoader.getSystemResourceAsStream(tidyConfigFile));
} catch (IOException ignore) {
public Document cleanPage(InputStream docStream) throws IOException {
Document doc = null;
NullOutputStream nos = new NullOutputStream(); // A NullOutputStream is
// is used to keep all the
// error output from printing
// check to see if we were successful at loading properties
if (tidyProperties.isEmpty()) {
System.err.println("Unable to load configuration file for Tidy");
System.err.println("Proceeding with default configuration");
Tidy tidy = new Tidy();
// set some local, non-destructive settings
tidy.setQuiet(true);
tidy.setErrout(new PrintWriter(nos));
tidy.setConfigurationFromProps(tidyProperties);
doc = tidy.parseDOM(docStream, nos);
// assuming everything has gone ok, we return the root element
return doc;
public static void main(String[] args) {
try {
String fileName = "C:/tmp/metars-search.htm";
File htmlFile = new File(fileName);
if (!htmlFile.exists()) {
System.err.println("File : " + fileName + " does not exist for reading");
System.exit(0);
FileInputStream fis = new FileInputStream(htmlFile);
HTMLDocumentProcessor processor = new HTMLDocumentProcessor();
Document doc = processor.cleanPage(fis);
if (doc == null) {
System.out.println("cleanPage(InputStream) returned null Document");
System.exit(0);
NodeList spanTags = doc.getElementsByTagName("span");
int numSpanTags = spanTags.getLength();
System.out.println("Number of <span> tags = " + numSpanTags);
for (int i = 0; i < numSpanTags; i++) { // Loop falls through here!
System.out.println("Span tag (" + i + ") = " +
spanTags.item(i).getTextContent());
} catch (Exception e) {
e.printStackTrace();
} finally {
System.exit(0);
}This segment of code works!
import com.boeing.ict.pdemo.io.NullOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.tidy.Tidy;
import org.xml.sax.SAXException;
* Class designed to remove specific notam entries from the
* HTML document returned in a request. The document will contain
* either formatted (HTML with CSS) or raw (HTML, pre tags). The
* Formatted HTML will extract the paragraph body information from the
* document in it's formatted state. The raw format will extract data
* as simple lines of text.
* @author John M. Resler (Capt. USAF, Ret.)<br/>
* Class : NotamExtractor<br/>
* Compiler : Sun J2SE version 1.5.0_06<br/>
* Date : June 15, 2006<br/>
* Time : 11:05 AM<br/>
public class HTMLDocumentProcessor {
// class fields
private Properties tidyProperties = null;
private final String tidyConfigFile =
"com/boeing/ict/pdemo/resources/TidyConfiguration.properties";
* Creates a new instance of HTMLDocumentProcessor
public HTMLDocumentProcessor() {
initComponents();
private void initComponents() {
try {
tidyProperties = new Properties();
tidyProperties.load(ClassLoader.getSystemResourceAsStream(tidyConfigFile));
} catch (IOException ignore) {
public Document cleanPage(InputStream docStream) throws IOException {
Document doc = null;
NullOutputStream nos = new NullOutputStream(); // A NullOutputStream is
// is used to keep all the
// error output from printing
ByteArrayOutputStream bos = new ByteArrayOutputStream();
// check to see if we were successful at loading properties
if (tidyProperties.isEmpty()) {
System.err.println("Unable to load configuration file for Tidy");
System.err.println("Proceeding with default configuration");
Tidy tidy = new Tidy();
// set some local, non-destructive settings
tidy.setQuiet(true);
tidy.setErrout(new PrintWriter(nos));
tidy.setConfigurationFromProps(tidyProperties);
doc = tidy.parseDOM(docStream, bos);
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = null;
try {
docBuilder = docFactory.newDocumentBuilder();
} catch (ParserConfigurationException ex) {
ex.printStackTrace();
try {
doc = docBuilder.parse(new ByteArrayInputStream(bos.toByteArray()));
} catch (IOException ex) {
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
// assuming everything has gone ok, we return the root element
return doc;
public static void main(String[] args) {
try {
String fileName = "C:/tmp/metars-search.htm";
File htmlFile = new File(fileName);
if (!htmlFile.exists()) {
System.err.println("File : " + fileName + " does not exist for reading");
System.exit(0);
FileInputStream fis = new FileInputStream(htmlFile);
HTMLDocumentProcessor processor = new HTMLDocumentProcessor();
Document doc = processor.cleanPage(fis);
if (doc == null) {
System.out.println("cleanPage(InputStream) returned null Document");
System.exit(0);
NodeList spanTags = doc.getElementsByTagName("span");
int numSpanTags = spanTags.getLength();
for (int i = 0; i < numSpanTags; i++ ) {
System.out.println(spanTags.item(i).getTextContent().trim());
} catch (Exception e) {
e.printStackTrace();
} finally {
System.exit(0);
}Thank you Dr but the following is true:
I placed this code in the for loop before I posted the question :
for (int i = 0; i < numSpanTags; i++) { // Loop falls through here!
System.out.println("Span tag (" + i + ") = " + spanTags.item(i));
}And I receive 29 (The correct number) of non-null references to objects (Node objects) in the NodeList.
When I replace the exact same for loop with this code :
for (int i = 0; i < numSpanTags; i++) { // Loop falls through here!
System.out.println("Span tag (" + i + ") = " + spanTags.item(i).getTextContent());
}Nothing prints. This discussion has never been about "clever means to suppress exceptions" it has been precisely about why a loop that has the
exact same references, exact same indices prints one time and doesn't print the other and does not throw an exception. If you can answer
that question then I am interested. I am not interested in pursuing avenues that are incorrect, not understood and most importantly shot from the hip without much thought.
Maybe you are looking for
-
How to Read a CSV file using pure PL/SQL
Hi friends - Is there a possibility to read a .TXT/CSV file from a local machine and display the contents on the form fields each record at one time. The logic to flow through the records can be build, but the problem is where to begin from to start
-
Problem with the Display Driver
Hi. I just got this message when I started Adobe Photoshop today, that's the CS4 edition, about that there was a problem with the Display driver: "Photoshop have encountered a problem with the display driver, and has temporarily disabled GPU enhancem
-
I know that this topic has been discussed before but I cannot find the actual postings. I would like to know if there has been an update as to when Apple will fix the alarm position that seems to always be at the upper right hand corner of the monito
-
Sapscript - print a list with all source code of the windows in layout
hi all, i need a way to print all source code of the layout (include the source of all windows in the layout). thanks, dany
-
Wireless Charging Stand NFC Not Working
I am trying to figure out how to configure the NFC for the DT-910 Wireless Charging Stand for my Nokia Lumia 920. It charges fine, but I cannot figure out how to get the NFC to work. When I go to the Accessories Settings, nothing is listed. Do I need