Create web pages from xml files using Servets or JSP

I�m new in this tecnology and I have to create a web pages from information that I get from a XML files. I would like to know if there is a place where I can find examples of code or any book that could help me.

Two places with loads of information on this:
http://xml.apache.org
Look at Xalan or Cocoon.
Also, there was an article on http://www.javaworld.com on XML with JSP.

Similar Messages

  • Printing web page to pdf file using Acrobat Standard 9

    When I print a web page to a pdf file, the text in the file is mostly garbled.  I have no problems in creating pdf files from MS office or other software.  I have Windows 7 Home.
    Any help will be appreciated.
    Thanks

    I do have Internet Explorer 9 and I was able to print web pages correctly following  your suggestions.
    Thanks for your help.
    Date: Sat, 12 Nov 2011 06:53:59 -0700
    From: [email protected]
    To: [email protected]
    Subject: Printing web page to pdf file using Acrobat Standard 9
        Re: Printing web page to pdf file using Acrobat Standard 9
        created by Bill@VT in Acrobat Windows - View the full discussion
    There were problems with IE9 on it's initial release and that may be what you are seeing if that is the browser (you did not indicate the browser and that may be a key). If you have a different browser you might try that one with the same pages to see if it browser related.
    By saying garbled it sounds like the fonts did not make it or you have selected "Use Local Fonts" in Acrobat. Try checking the latter first. Then check if the fonts are embedded in the PDF by checking the document properties (ctrl-D). If they are not, go back to the browser and select the press or print job options before printing and see if they get embedded and if your problem is resolved.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4021509#4021509
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4021509#4021509. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Acrobat Windows by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to delete a perticular node from xml file using java code

    Hii All,
    Now i am trying to delete a perticular node from xml file.Like...
    XML file:
    <Licence>
    <SERVER>
    <was id="1">1</was>
    <was id="2">2</was>
    </SERVER>
    </LICENCE>
    I am working in messaging service using JABBER framework with whiteboard facility.
    Here Some commands i have created to add,modify,delete nodes from xml file.They Are
    1.If u want to add a new node then.
    create Licence.SERVER <ss id="3">ddd</ss> lic.xml
    (here u want to add a new node called "ss" under Licence.SERVER.
    And lic.xml is tyhe xml file name where it was saved.
    2.If u want to delete a node(Suppose <was id="1">),then the command should be
    delete Licence.SERVER.was:id='"1" lic.xml
    A problem arises that here it find two was attributes.And it delete the last was attribute,not the requested node.
    PLEASE HELP ME IN SOLVING THIS CODE..
    ------------------------------------

    Looks like you clicked on "Post" before you pasted in the code you were talking about.

  • Dynamically create Value Objects from XML file

    Hi
    I want to create a value object from Xml file dynamically,like in the xml file i have the name of the variable and the datatype of the variable.is it possible do that,if so how.

    Read about apache's Digester tool. This is part of the Jakartha project. This tool helps in creating java objects from the XML files. I am not sure, if that is what u r looking for.

  • Couldn't parse image from XML file using NSXMLParser

    Hi all, Since i am newbie to developing iPhone application, i have problem in parsing XML data.
    I use the following code for parsing XML file, this is RootViewController.h file
    #import <UIKit/UIKit.h>
    #import "SlideMenuView.h"
    #define kNameValueTag 1
    #define kColorValueTag 2
    #define kSwitchTag 100
    @class DetailViewController;
    @interface RootViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
    DetailViewController *detailViewController;
    UITableView *myTable;
    UIActivityIndicatorView *activityIndicator;
    UIButton *btn;
    CGSize cellSize;
    NSXMLParser *rssParser;
    NSMutableArray *stories;
    NSMutableDictionary *item;
    NSString *currentElement;
    NSMutableString *currentTitle, *currentDate, *currentSummary, *currentLink, *currentImage;
    SlideMenuView *slideMenu;
    NSMutableArray *buttonArray;
    UIButton *rubic;
    UIButton *buurt;
    UIButton *beeld;
    UILabel *lbl;
    NSString *url;
    @property (nonatomic, retain) UITableView *myTable;
    @property (nonatomic, retain) DetailViewController *detailViewController;
    @property (nonatomic, retain) SlideMenuView *slideMenu;
    @property (nonatomic, retain) UIButton *btn;
    @property (nonatomic, retain) NSMutableArray *buttonArray;
    @property (nonatomic, retain) UIButton *rubic;
    @property (nonatomic, retain) UIButton *buurt;
    @property (nonatomic, retain) UIButton *beeld;
    @property (nonatomic, retain) UILabel *lbl;
    @end
    below is the RootViewController.m file,
    #import <Foundation/Foundation.h>
    #import "RootViewController.h"
    #import "DetailViewController.h"
    #import "SlideMenuView.h"
    @implementation RootViewController
    @synthesize rubic, buurt, beeld, detailViewController, myTable, btn, buttonArray, slideMenu, lbl;
    - (void)parseXMLFileAtURL:(NSString *)URL {
    stories = [[NSMutableArray alloc] init];
    //you must then convert the path to a proper NSURL or it won't work
    NSURL *xmlURL = [NSURL URLWithString:URL];
    // here, for some reason you have to use NSClassFromString when trying to alloc NSXMLParser, otherwise you will get an object not found error
    // this may be necessary only for the toolchain
    rssParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
    // Set self as the delegate of the parser so that it will receive the parser delegate methods callbacks.
    [rssParser setDelegate:self];
    // Depending on the XML document you're parsing, you may want to enable these features of NSXMLParser.
    [rssParser setShouldProcessNamespaces:NO];
    [rssParser setShouldReportNamespacePrefixes:NO];
    [rssParser setShouldResolveExternalEntities:NO];
    [rssParser parse];
    - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
    NSString * errorString = [NSString stringWithFormat:@"Unable to download story feed from web site (Error code %i )", [parseError code]];
    NSLog(@"error parsing XML: %@", errorString);
    UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [errorAlert show];
    - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
    //NSLog(@"found this element: %@", elementName);
    currentElement = [elementName copy];
    if ([elementName isEqualToString:@"item"]) {
    // clear out our story item caches...
    item = [[NSMutableDictionary alloc] init];
    currentTitle = [[NSMutableString alloc] init];
    currentDate = [[NSMutableString alloc] init];
    currentSummary = [[NSMutableString alloc] init];
    currentLink = [[NSMutableString alloc] init];
    currentImage = [[NSMutableString alloc] init];
    - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
    //NSLog(@"ended element: %@", elementName);
    if ([elementName isEqualToString:@"item"]) {
    // save values to an item, then store that item into the array...
    [item setObject:currentTitle forKey:@"title"];
    [item setObject:currentSummary forKey:@"summary"];
    [item setObject:currentDate forKey:@"date"];
    [item setObject:currentImage forKey:@"enclosure"];
    [stories addObject:[item copy]];
    NSLog(@"adding story: %@", currentTitle);
    - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
    //NSLog(@"found characters: %@", string);
    // save the characters for the current item...
    if ([currentElement isEqualToString:@"title"]) {
    [currentTitle appendString:string];
    } else if ([currentElement isEqualToString:@"description"]) {
    [currentSummary appendString:string];
    } else if ([currentElement isEqualToString:@"pubDate"]) {
    [currentDate appendString:string];
    } else if ([currentElement isEqualToString:@"enclosure"]) {
    [currentImage appendString:string];
    - (void)parserDidEndDocument:(NSXMLParser *)parser {
    [activityIndicator stopAnimating];
    [activityIndicator removeFromSuperview];
    NSLog(@"all done!");
    NSLog(@"stories array has %d items", [stories count]);
    [myTable reloadData];
    - (void)loadView {
    //self.title = @"GVA_iPhone";
    //UIImage *img = [UIImage imageNamed: @"gva_v2.1.png"];
    CGRect frame = [[UIScreen mainScreen] bounds];
    UIView *aView = [[UIView alloc] initWithFrame:frame];
    aView.backgroundColor = [UIColor grayColor];
    self.view = aView;
    [aView release];
    lbl = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 33.0, 320.0, 30.0)];
    lbl.backgroundColor = [UIColor colorWithRed:21.0/255.0 green:113.0/255.0 blue:194.0/255.0 alpha:1.0];
    lbl.textColor = [UIColor whiteColor];
    lbl.font = [UIFont boldSystemFontOfSize:18.0];
    [self.view addSubview:lbl];
    [lbl release];
    buttonArray = [[NSMutableArray alloc] init];
    for(int i = 1; i < 4; i++)
    // Rounded rect is nice
    //UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    // Give the buttons a width of 100 and a height of 30. The slide menu will take care of positioning the buttons.
    // If you don't know that 100 will be enough, use my function to calculate the length of a string. You find it on my blog.
    [btn setFrame:CGRectMake(0.0f,3.0f, 120.0f, 30.0f)];
    switch(i){
    case 1:
    [btn setTitle:[NSString stringWithFormat:@" Snel", i+1] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
    lbl.text = @" Snel";
    [btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [buttonArray addObject:btn];
    break;
    case 2:
    [btn setTitle:[NSString stringWithFormat:@" Binnenland", i+1] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [buttonArray addObject:btn];
    break;
    case 3:
    [btn setTitle:[NSString stringWithFormat:@" Buitenland", i+1] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:@"topbg02.png"] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(buttonTouched:) forControlEvents:UIControlEventTouchUpInside];
    [buttonArray addObject:btn];
    break;
    [btn release];
    slideMenu = [[SlideMenuView alloc]initWithFrameColorAndButtons:CGRectMake(0.0, 3.0, 330.0, 30.0) backgroundColor:[UIColor blackColor] buttons:buttonArray];
    [self.view addSubview:slideMenu];
    UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 63.0, 320.0, 310.0)];
    aTableView.dataSource = self;
    aTableView.delegate = self;
    aTableView.rowHeight = 120;
    self.myTable = aTableView;
    [aTableView release];
    [self.view addSubview:myTable];
    rubic = [[UIButton alloc]initWithFrame:CGRectMake(0.0, 370.0, 105.0, 50.0)];
    [rubic setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [rubic setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
    [rubic addTarget:self action:@selector(buttonBinn:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:rubic];
    UILabel *lblRub = [[UILabel alloc]initWithFrame:CGRectMake(10.0, 385.0, 45.0, 12.0)];
    lblRub.text = @"Rubriek";
    lblRub.font = [UIFont boldSystemFontOfSize:11.0];
    lblRub.backgroundColor = [UIColor clearColor];
    lblRub.textColor = [UIColor whiteColor];
    [self.view addSubview:lblRub];
    UIImageView *imgCat = [[UIImageView alloc] initWithFrame:CGRectMake(58.0, 375.0, 39.0, 36.0)];
    imgCat.image = [UIImage imageNamed:@"category_icon.png"];
    [self.view addSubview:imgCat];
    buurt = [[UIButton alloc] initWithFrame:CGRectMake(105.0, 370.0, 108.0, 50.0)];
    [buurt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    [buurt addTarget:self action:@selector(buttonBuurt:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:buurt];
    UILabel *lblGlo = [[UILabel alloc]initWithFrame:CGRectMake(112.0, 385.0, 59.0, 12.0)];
    lblGlo.text = @"In de Buurt";
    lblGlo.font = [UIFont boldSystemFontOfSize:11.0];
    lblGlo.backgroundColor = [UIColor clearColor];
    lblGlo.textColor = [UIColor whiteColor];
    [self.view addSubview:lblGlo];
    UIImageView *imgGlo = [[UIImageView alloc] initWithFrame:CGRectMake(173.0, 375.0, 39.0, 36.0)];
    imgGlo.image = [UIImage imageNamed:@"globe_icon.png"];
    [self.view addSubview:imgGlo];
    beeld = [[UIButton alloc]initWithFrame:CGRectMake(213.0, 370.0, 108.0, 50.0)];
    [beeld setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    [beeld addTarget:self action:@selector(buttonBeeld:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:beeld];
    UILabel *lblCam = [[UILabel alloc]initWithFrame:CGRectMake(228.0, 385.0, 45.0, 12.0)];
    lblCam.text = @"In Beeld";
    lblCam.font = [UIFont boldSystemFontOfSize:11.0];
    lblCam.backgroundColor = [UIColor clearColor];
    lblCam.textColor = [UIColor whiteColor];
    [self.view addSubview:lblCam];
    UIImageView *imgCam = [[UIImageView alloc] initWithFrame:CGRectMake(276.0, 375.0, 39.0, 36.0)];
    imgCam.image = [UIImage imageNamed:@"camera_icon.png"];
    [self.view addSubview:imgCam];
    if([stories count] == 0) {
    [self parseXMLFileAtURL:@"http://iphone.concentra.exuvis.com/feed/rss/article/2/binnenland.xml"];
    cellSize = CGSizeMake([myTable bounds].size.width,60);
    - (IBAction)buttonPressed:(id)sender {
    lbl.text = ((UIButton*)sender).currentTitle;
    - (IBAction)buttonClicked:(id)sender {
    lbl.text = ((UIButton*)sender).currentTitle;
    - (IBAction)buttonTouched:(id)sender {
    lbl.text = ((UIButton*)sender).currentTitle;
    -(void)buttonBinn:(id)sender
    [rubic setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
    [buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    [beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    -(void)buttonBuurt:(id)sender
    [buurt setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
    [beeld setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    [rubic setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    -(void)buttonBeeld:(id)sender
    [beeld setBackgroundImage:[UIImage imageNamed:@"MOUSEOVER.png"] forState:UIControlStateNormal];
    [rubic setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    [buurt setBackgroundImage:[UIImage imageNamed:@"bottombg01.png"] forState:UIControlStateNormal];
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (void)dealloc {
    [myTable release];
    [detailViewController release];
    [super dealloc];
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [stories count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GVAiPhone"];
    if (cell == nil) {
    //CGRect cellFrame = CGRectMake(0, 0, 300, 65);
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"GVAiPhone"] autorelease];
    //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    //cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_icon.png"]];
    CGRect nameValueRect = CGRectMake(5, 5, 275, 35);
    UILabel *nameValue = [[UILabel alloc] initWithFrame:nameValueRect];
    nameValue.tag = kNameValueTag;
    nameValue.font = [UIFont fontWithName:@"Arial" size:15.0];
    nameValue.lineBreakMode = UILineBreakModeWordWrap;
    nameValue.numberOfLines = 2;
    [cell.contentView addSubview:nameValue];
    [nameValue release];
    CGRect colorValueRect = CGRectMake(5, 38, 275, 65);
    UILabel *colorValue = [[UILabel alloc] initWithFrame:colorValueRect];
    colorValue.tag = kColorValueTag;
    colorValue.font = [UIFont fontWithName:@"Arial" size:11.0];
    colorValue.textColor = [UIColor colorWithRed:130.0/255.0 green:135.0/255.0 blue:139.0/255.0 alpha:1.0];
    colorValue.lineBreakMode = UILineBreakModeWordWrap;
    colorValue.textAlignment = UITextAlignmentLeft;
    colorValue.numberOfLines = 6;
    [cell.contentView addSubview:colorValue];
    [colorValue release];
    // Set up the cell
    //cell.text = [theSimpsons objectAtIndex:indexPath.row];
    //cell.hidesAccessoryWhenEditing = YES;
    NSUInteger storyIndex = [indexPath row];
    NSDictionary *rowData = [stories objectAtIndex:storyIndex];
    UILabel *name = (UILabel *)[cell.contentView viewWithTag:kNameValueTag];
    name.text = [rowData objectForKey:@"title"];
    //name.lineBreakMode;
    //UIImage *image =[UIImage imageNamed: currentImage];imageWithContentsOfFile
    //image.size.width = 50;
    //iimage.size.height = 50;
    //cell.image = [UIImage imageNamed:currentImage];
    cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_icon.png"]];
    UILabel *color = (UILabel *)[cell.contentView viewWithTag:kColorValueTag];
    color.text = [rowData objectForKey:@"summary"];
    return cell;
    @end
    - here the actual problem is the xml node <enclosure> contains images but in using the method "didEndElement" , it doesn't parse into the <enclosure> node. ya so please help me in parsing and getting the image.
    Waiting for your help !!
    -Sathiya

    Hi, how did you solve your problem in detail. I'm having the same problem with this rss-feed: www.spiegel.de/index.rss
    I cannot parse the url of the images. I'm looking forward to your answer.

  • Delete elements from XML file using DOM and java

    Hi
    I want now is to remove element from my XML file
    for example
    i have following xml
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
              <firstLineText />
              <firstLineText>|line11</firstLineText>
              <firstLineText>|line12</firstLineText>
    </firstLineTexts>
    </printing>how do i remove all elements fireLineText
    my final output should be
    <?xml version="1.0" encoding="UTF-8"?>
    <printing>
    <firstLineTexts>
    </firstLineTexts>
    </printing>How do i do it using DOM,
    I can create instance of DOM and write it using TransformerFactory
    Ashish

    Hi
    I am trying the following code,
    but it is not working
                    NodeList nScene = doc.getElementsByTagName("firstLineTexts");
              NodeList nScene1 = nScene.item(0).getChildNodes();
              for (int i = 0; i < nScene1.getLength(); i++)
                   Node n = nScene1.item(i);
                        nScene.item(0).removeChild(n);
              }

  • Reading from XML file using DOM parser.

    Hi,
    I have written the following java code to read the XML file and print the values. It reads the XML file. It gets the node NAME and prints it. But it returns null when trying to get the node VALUE. I am unable to figure out why.
    Can anyone please help me with this.
    Thanks and Regards,
    Shweta
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    public class ReadNodes
    private static XMLDocument mDoc;
    public ReadNodes () {
         try {
    DOMParser lParser = new DOMParser();
    URL lUrl = createURL("mot.xml");
    System.out.println("after creating the URL object ");
    lParser.setErrorStream(System.out);
    lParser.showWarnings(true);
    lParser.parse(lUrl);
    mDoc = lParser.getDocument();
         System.out.println("after creating the URL object "+mDoc);
    lParser.reset();
    } catch (Exception e) {
    e.printStackTrace();
    } // end catch block
    } // End of constructor
    public void read() throws DOMException {
    try {
         NodeList lTrans = this.mDoc.getElementsByTagName("TRANSLATION");
         for(int i=0;i<lTrans.getLength();i++) {
              NodeList lTrans1 = lTrans.item(i).getChildNodes();
              System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getNodeName());
              System.out.println("lTrans1.item(0).getNodeValue : " + lTrans1.item(0).getNodeValue());
              System.out.println("lTrans1.item(1).getNodeName : " + lTrans1.item(1).getNodeName());
              System.out.println("lTrans1.item(1).getNodeValue : " + lTrans1.item(1).getNodeValue());
         } catch (Exception e) {
         System.out.println("Exception "+e);
         e.printStackTrace();
         } catch (Throwable t) {
              System.out.println("Exception "+t);
    public static URL createURL(String pFileName) throws MalformedURLException {
    URL url = null;
    try {
    url = new URL(pFileName);
    } catch (MalformedURLException ex) {
    File f = new File(pFileName);
    String path = f.getAbsolutePath();
    String fs = System.getProperty("file.separator");
    System.out.println(" path of file : "+path +"separator " +fs);
    if (fs.length() == 1) {
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    System.out.println("path is : "+path);
    // Try again, if this throws an exception we just raise it up
    url = new URL(path);
    } // End catch block
    return url;
    } // end method create URL
    public static void main (String args[]) {
         ReadNodes mXML = new ReadNodes();
         mXML.read();
    The XML file that I am using is
    <?xml version = "1.0"?>
    <DOCUMENT>
    <LANGUAGE_TRANS>
    <TRANSLATION>
    <CODE>3</CODE>
    <VALUE>Please select a number</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>5</CODE>
    <VALUE>Patni</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>6</CODE>
    <VALUE>Status Messages</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>7</CODE>
    <VALUE>Progress</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>8</CODE>
    <VALUE>Create Data Files...</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>9</CODE>
    <VALUE>OK</VALUE>
    </TRANSLATION>
    </LANGUAGE_TRANS>
    </DOCUMENT>

    because what you want is not the node value of CODE but the node value of the text nodes into it!
    assuming only one text node into it, try this:
    System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getFirstChild().getNodeValue());

  • Create an UDO from XML file

    Hello,
    I would want to create an UDO from an XML file. But I don't see any documentation about it.
    Do you know if there is any sample or something?
    Thanks in advance

    Hi Martin,
    I don't know if this is possible as I looked at the properties of the UDO object (SAPbobsCOM.UserObjectsMD) and there are no XML methods. As with the other meta data objects, like UserTablesMD and UserFieldsMD you have SaveXML and GetAsXML, but not with UDO.
    Hope it helps,
    Adele

  • Printing a web  page from the browser using JSP

    Hi sir,
    I want to know how to print a webpage that contains some
    report data where the web page contains a button as well when i click the button only the webpage contents(report data) should be send to the printer and should be printed.Here i should not use any javascript.By using pure java code in Jsp i need to do this.Pls.provide the code for this so that i will be grateful to u.Where it is very Urgent.I will be waiting for ur reply.
    Thanx,
    m.ananthu

    If you are reasonable sure that the user will be using a newer browser you could use the <LINK> tag to set an alternative print page. When the user clicks on the print button it calls a javascript funtion that does a window.print function call. The browser will then request the alternative print page and print this page instead of what is in teh browser.
    This will require two JSP pages but with proper use of includes you can reuse the code.
    Sorry I don't have any examples handy so you'll have to search the web but I know it works because I've done it for an intranet site.

  • Trouble loading images from XML files using AS

    I am creating a slideshow and found a script that will load
    the images via an XML document, but I believe the script is for an
    absolute references image such as <a href="
    http://www.myimages.com/image1.jpg">
    and I want to be able to have them in a file and reference the file
    in the XML such as :
    <pic>
    <image>images/04_02.jpg</image>
    <caption>Soleil Center 4</caption>
    </pic>
    When I test movie I get an error
    Error opening URL "path_to_image/01_02.jpg"
    Is there something I need to change in the AS to be able to
    reference a folder on my desktop (in the same directory as .fla
    file).
    here is the AS code:
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = [];
    description = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    image
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    description
    = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
    firstImage();
    } else {
    content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");
    listen = new Object();
    listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
    nextImage();
    Key.addListener(listen);
    previous_btn.onRelease = function() {
    prevImage();
    next_btn.onRelease = function() {
    nextImage();
    p = 0;
    this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
    preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
    preloader._visible = false;
    if (picture._alpha<100) {
    picture._alpha += 10;
    function nextImage() {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    picture_num();
    function prevImage() {
    if (p>0) {
    p--;
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    picture_num();
    function firstImage() {
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[0], 1);
    desc_txt.text = description[0];
    picture_num();
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    }

    something is still amiss here becuase I placed the xml and
    images at the root level and the images still do not load. I don't
    get any kind of error and Trace tells me the file is being loaded.
    took out the /images/ part so that in the XML it's now :
    <pic>
    <image>07_02.jpg</image>
    <caption>Image Description</caption>
    </pic>
    and here is the AS code:
    var image:Array = new Array();
    var description:Array = new Array();
    function loadXML(loaded) {
    if (loaded) {
    var xmlNode:XMLNode = this.firstChild;
    var total:Number = xmlNode.childNodes.length;
    for (var i:Number = 0; i<total; i++) {
    image.push(xmlNode.childNodes
    .childNodes[0].firstChild.nodeValue);
    description.push(xmlNode.childNodes.childNodes[1].firstChild.nodeValue);
    trace('File Name Value: '+xmlNode.childNodes);
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");
    listen = new Object();
    listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
    nextImage();
    Key.addListener(listen);
    previous_btn.onRelease = function() {
    prevImage();
    next_btn.onRelease = function() {
    nextImage();
    p = 0;
    this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
    preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
    preloader._visible = false;
    if (picture._alpha<100) {
    picture._alpha += 10;
    function nextImage() {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    picture_num();
    function prevImage() {
    if (p>0) {
    p--;
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    picture_num();
    function firstImage() {
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[0], 1);
    desc_txt.text = description[0];
    picture_num();
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    }

  • HELP:Loading XMLtype column from xml file using SQLLOADER

    Hi,
    My table structure is
    crtd_date date,
    xml_doc XMLType
    I have to insert the data dynamically from sqlloader,is it possible? - if it possible please help with controlfile.
    i wrote the controlfile like
    LOAD DATA
    INTO TABLE drvt_xml replace
    XMLType(xmldoc)
    FIELDS TERMINATED BY ',' optionally enclosed by '"'
    crtd_date SYSDATE,
    fname filler char,
    xmldoc lobfile(fname) terminated by eof
    )

    Hi,
    I am having the same issue wer u able to write the control file and did it work?
    If yes pls post ur control file.
    Thanks in advance!!

  • Create dynamic column from xml file

    Hi All,
           <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" backgroundColor="white" width="500" height="300" creationComplete="onload()" >
    <mx:Style>
        DataGrid {
            alternatingItemColors: #a1a1a1,#8bb8e6;       
            borderColor:#050505; borderStyle:outset;        
            color:#ffffff;       
            editable:false;         
               fontSize:11; fontWeight:bold; fontFamily:Tahoma;          
               horizontalGridLines:false;
               headerStyleName:myHeaderStyles;
                    headerSeparatorSkin:ClassReference("mx.skins.ProgrammaticSkin");    
        rollOverColor:#5CC2F7;    
        selectionColor:#E8C76D; sortableColumns:true;   
        textAlign:center; textRollOverColor:#FD0606; textSelectedColor:#1301FF;   
        variableRowHeight:true;
        verticalAlign:middle; verticalGridLines:false; verticalGridLineColor:#050505;   
    wordWrap: false; 
    .myHeaderStyles
                color: #ffffff;
                fontWeight: bold; fontFamily:Arial; fontSize:13;
    </mx:Style>
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
       import mx.charts.renderers.CircleItemRenderer;
       import mx.charts.series.ColumnSeries;
       [Bindable]
        public var myData:ArrayCollection;
    private var now:Date=new Date();
    private var str:String;
    private var st:String;
    public function onload():void
    str=String(now.getDate())+' '+String(now.getMonth())+' '+String(now.getFullYear())+' '+String(now.getHours())+' '+String(now.getMinutes()+' '+String(now.getSeconds()));
    trace(str);
    st=srv.url="Data/NumberChart.xml?rand="+str;
    trace(st);
    srv.send();
    public function onresult():void
    myData=ArrayCollection(srv.lastResult.Document.Record)
    trace(myData);
    ]]>
    </mx:Script>
    <!-- xml path (data passing) -->
      <mx:HTTPService id="srv"         result="onresult()"  /> 
      <mx:WipeRight id="myWR" duration="2000"/>
        <mx:WipeLeft id="myWL" duration="2000"/>   
        <mx:HBox label="Home Team" width="100%" height="100%" backgroundColor="white">
    <mx:DataGrid id="HomeTeam" dataProvider="{myData}" creationCompleteEffect ="{myWR}"   width="500" height="300"  headerBackgroundSkin="@Embed(source='assets/Tileimage4movieplayer_img.png')">
    <mx:columns>
    <mx:DataGridColumn id="Hcol1" headerText="Player" draggable="false" dataField="DisField" width="170" showDataTips="true" wordWrap="true"  />
    <mx:DataGridColumn id="Hcol2" headerText="Average" draggable="false" dataField="Value" width="170" showDataTips="true" wordWrap="true"  />
    <mx:DataGridColumn id="Hcol3" headerText="Matchs" draggable="false" dataField="Prefix" width="170" showDataTips="true" wordWrap="true"  />
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>
    and my xml code is...
    <?xml version='1.0' encoding='utf-8' ?>
    <Document Title='50 Runs Milestone'>
    <Record>
    <DisField>K Sangakkara</DisField>
    <Value>200.00</Value>
    <runs>50</runs>
    <Prefix>KXIP Vs DC</Prefix>
    </Record>
    <Record>
    <DisField>R Sharma</DisField>
    <Value>185.19</Value>
    <Prefix>KXIP Vs DC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>W Jaffer</DisField>
    <Value>151.52</Value>
    <Prefix>BRC Vs CSK</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>G Gambhir</DisField>
    <Value>135.14</Value>
    <Prefix>CSK Vs DD</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>M Boucher</DisField>
    <Value>125.00</Value>
    <Prefix>KKR Vs BRC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>A Gilchrist</DisField>
    <Value>119.05</Value>
    <Prefix>KXIP Vs DC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>S Asnodkar</DisField>
    <Value>113.64</Value>
    <Prefix>RR Vs BRC</Prefix>
    <runs>50</runs>
    </Record>
    </Document>
    it's working but i want to crete dynamic datagrid column how to do it any idea?

    I actually found this topic interesting, so I made the data and code generic and created a Flex Cookbook entry, adding the ability to remove columns as well:
    <?xml version='1.0' encoding='utf-8' ?>
    <Document>
      <Record>
        <name>Bob Smith</name>
        <age>48</age>
        <sales>$53,000.00</sales>
        <territory>Southeast</territory>
      </Record>
      <Record>
        <name>Susan Sharma</name>
        <age>37</age>
        <sales>$37,000.00</sales>
        <territory>Southwest</territory>
      </Record>
      <Record>
        <name>George Freebird</name>
        <age>52</age>
        <sales>$49,000.00</sales>
        <territory>Midwest</territory>
      </Record>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
      creationComplete="srv.send();" >
      <mx:Script>
        <![CDATA[
          import mx.controls.Alert;
          import mx.collections.ArrayCollection;
          [Bindable] public var myData:ArrayCollection;
          public function onresult():void{
            myData=ArrayCollection(srv.lastResult.Document.Record)
          private function modifyColumns(evt:MouseEvent):void{
            var ac:ArrayCollection = new ArrayCollection(SalesData.columns);
            var actionTaken:Boolean = false;
            if(evt.currentTarget.label=="Remove Column"){
              for each(var col1:DataGridColumn in ac){
                if(col1.headerText == headerTxt.text){
                  ac.removeItemAt(ac.getItemIndex(col1));
                  headerTxt.text = "";
                  SalesData.columns = ac.toArray();
                  actionTaken = true;
              if(actionTaken){
                mx.controls.Alert.show("Column " + headerTxt.text + " was removed.");
              }else{
                mx.controls.Alert.show("Column " + headerTxt.text + " not found.");
            }else if(evt.currentTarget.label=="Add Column"){
              for each(var col:DataGridColumn in ac){
                if(col.headerText == headerTxt.text){
                  mx.controls.Alert.show("Column " + headerTxt.text + " already exists.");
                  return;
              var dgc:DataGridColumn = new DataGridColumn();
              dgc.headerText = headerTxt.text;
              dgc.dataField = datafieldTxt.text;
              dgc.width = 100;
              ac.addItemAt(dgc, int(columnIndexTxt.text));
              SalesData.columns = ac.toArray();
              headerTxt.text = "";
              datafieldTxt.text = "";
              columnIndexTxt.text = "";
              mx.controls.Alert.show("Column " + headerTxt.text + " was added.");
        ]]>
      </mx:Script>
      <mx:HTTPService id="srv" url="data.xml" result="onresult()"/> 
      <mx:DataGrid id="SalesData" dataProvider="{myData}" width="500" height="300">
        <mx:columns>
          <mx:DataGridColumn headerText="Name" dataField="name" width="170"/>
          <mx:DataGridColumn headerText="Sales" dataField="sales" width="170"/>
          <mx:DataGridColumn headerText="Territory" dataField="territory" width="170"/>
        </mx:columns>
      </mx:DataGrid>
      <mx:Form label="Add or Remove a Column">
        <mx:FormItem label="Enter column header text:">
          <mx:TextInput id="headerTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Enter column datafield (if adding):">
          <mx:TextInput id="datafieldTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Enter zero based new column index (if adding):">
          <mx:TextInput id="columnIndexTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Click to add or remove column">
          <mx:HBox>
            <mx:Button label="Add Column" click="modifyColumns(event);"
              disabledColor="0xf1aa99"
              enabled="{headerTxt.text!=''&amp;&amp;datafieldTxt.text!=''&amp;&amp;columnIndexTxt.text! =''}"/>
            <mx:Button label="Remove Column" click="modifyColumns(event);"
              disabledColor="0xf1aa99" enabled="{headerTxt.text!=''}"/>
          </mx:HBox>
        </mx:FormItem>
      </mx:Form>
    </mx:Application>

  • I saved web page as html file, but can't open saved file as web page

    I did a FILE, SAVE PAGE AS, then chose 'WEB PAGE COMPLETE' - and a directory is created on my hard drive - with the directory name, for example - "c:\....\Ask a Question _ Mozilla Support.htm". (for this web page).
    When I try to open the saved web page from Firefox, using FILE, OPEN, I see a new window that looks like a file manager window, I then select that saved .html file and click OPEN, and a new window opens that looks like file manager - displaying with all the files in that directory - "Ask a Question _ Mozilla Support.htm". That is, it does not open and dislpay the web page as I expect it should (that I saved earlier).
    However, if I go to the file manager, I can see that directory is saved, and has the Windows Explorer icon associated with the directory "ask a question ....html", and also has a file type of HTML listed. If I double click that directory in file manager, Windows Explorer will open that directory and dis[play it as a web page, as I expected.
    I would like to know why Firefox does not open the directory name as a web page from the FILE, OPEN command, but instead shows me the directory contents(all the files in that directory)?
    BTW, if I try FILE, OPEN, using Windows Explorer the same thing happens - it opens a new window listing all the files in that directory.
    Is this the way the FILE, OPEN is supposed to work?
    It seems confusing, because if I am in any other program, for example WinWord, and do a FILE, OPEN command on a Word file, it opens the file as a Word Document - it does not just show the file in a "file manager window.
    But when I click FILE, OPEN on an HTML file(directory using Firefox, it does not open that html directory as a web page?

    I am in the Windows Explorer 'Details' view, and I see the folder with 'Type' of FILE FOLDER. In that folder are all the .js and .css and .png files - as cor-el said.
    ''But now I also see'' that there is also an htm file - ''with the exact same name ''as the folder, but it has a 'Type' of 'HTML Document'. When I have Firefox do a File, Open on the HTML Document - it does open the web page that I saved and does display it as a web page.
    I did not realize that Firefox saves both:
    1) a Directory '''(Type 'File Folder') '''''', and,
    2) an html file''' (Type 'HTML Document')
    ... '''and that they are the exact same names! '''
    I was clicking on the wrong one! Instead of clicking in the .html file, I was incorrectly clicking on the folder!
    (The archive add on looks interesting, but shouldn't I be able to open the saved web page, from the browser, using File, Open File) ?

  • How to automatically create fillable PDFs from XML

    We are looking for a way to create fillable PDFs that users can enter data into and save (so the PDF needs Reader Rights applied) and we want to be able to automatically create these PDFs from XML files. We are able to do what we want in a manual fashion using Acrobat Pro v8 but we need a way to automate this due to the volume of XML files that we will need to convert.
    Is there any way that this can be scripted from a command line interface with Acrobat.. like:
    Acrobat.exe –input FileName.xml –output FileName.pdf –applyReaderRights true
    If there is no command line options for this is there any way that this could be coded using .NET or any other programming language?

    You cannot automate applying usage rights with Acrobat. For that you'd need to use Adobe's LiveCycle Reader Extensions.
    How exactly are you currently converting XML into fillable forms? Are you using an XDP to somehow convert to an XFA-based PDF?

Maybe you are looking for

  • How to get application name or component name

    I have a requirement to make a Z table similar to the context change log table . I need to add application name to that.Is there a way one can retrieve application name of the current application from a function module or any other way?The table WDY_

  • Fatal Error and Freezing my screen

    Hello All, I need some help.  I allowed my wife to use one of her friends external hardrives on my computer and then after she was done opening her friend's PDF files, all of my scanned PDF files are now very very difficult to open and I keep getting

  • Lumia phone problem

    Lumia phone has a many problem like Bluetooth file saving, video sharing , lake of application due to windows phone over security please make window phone as window pc

  • Which iOS SDK is flex using?

    Hi, i cant find any information about the iOS SDK Version that flex is using when we compile the ipa file. I dont mean the flex sdk like 4.5.1 or AIR 2.7. When you got to Apple App Store with your iphone or ipad you see that very application has a SD

  • Retrive the names of step measurements using LabVIEW

    How do you retrieve the names of a multiple numeric step's measurements using LabVIEW?  I've constructed a vi to call from TestStand, and will pass it "ThisContext", but the vi doesn't complie.  That's how far I got.  The vi is attached.  The error m