XML Development Using Borland JBuilder 8

Size: px
Start display at page:

Download "XML Development Using Borland JBuilder 8"

Transcription

1 XML Development Using Borland JBuilder 8 Jumpstart XML development with the Apache XML framework, supported in JBuilder 8 A Borland White Paper Kathy L. Alexion, Systems Engineer January 2003

2 Contents Introduction... 3 JBuilder 8 wizards for XML... 3 Framework Component... 4 Description... 4 XML basics... 5 Create a project... 5 XML to DTD... 5 DTD to XML... 8 XML and databinding...12 Databinding wizards Creating a class Apache Cocoon...20 XSL with XML Running Cocoon with JBuilder SAX Handler wizard...35 XML DBMS...45 Conclusion...51 Appendix A...51 Borland XML: marshalling and unmarshalling Appendix B...53 The Database Pilot

3 Introduction Borland JBuilder Enterprise is a comprehensive set of award-winning visual development tools for creating enterprise-scale applications written entirely in the Java programming language for the Java 2 platform. JBuilder 8 Enterprise provides out-of-the box support for Apache XML framework components, as well as being compliant with the W3C (World Wide Web Consortium) specifications. JBuilder 8 wizards for XML Presentation, transformation, and validation of XML documents is supported within the JBuilder 8 wizard suite. Data binding and the programmatic manipulation of XML documents along with support for transferring data between XML and databases is also available. With the Apache framework supported in JBuilder 8, the XML wizard suite includes a SAX Parser generation wizard along with library definitions for JAXP (Java API for XML Processing) and DOM (Document Object Model). For performing presentation transformations, a wizard created on top of the Cocoon publishing engine is conveniently included. Transformation and validation is supported within the Cocoon publishing wizard in JBuilder. JBuilder 8 includes tools for data binding and the programmatic manipulation of XML documents: Borland XML for generating Java sources from Documentation Type Definition (DTD), and Castor for generating Java sources from schema. The wizard suite includes tools for transferring data to and from databases (XML-DBMS wizard for model-based database support), along with conversion support and verification including: DTD to XML and XML to DTD. The following is the list of XML framework components, which can be easily developed and verified using JBuilder 8 wizards. 3

4 Framework Component XML (Extensible Markup Language) DTD (Document Type Definition) Apache TM Cocoon Publishing Framework for XML XSL (Extensible Style Language) SAX (Simple API for XML) Description XML allows developers to create and customize their own markup tags, and it enables the transfer, validation, and interaction of data within and between applications. A type of file associated with XML documents, which defines how the markup tags or markup declarations should be interpreted by the application presenting the document. It is a servlet-based, Java publishing framework for XML that allows separation of content, style, and logic and uses Extensible Style Language (XSL) transformation to merge them. A specification from the W3C, which defines the language for separating/creating style (sheets) from content when creating HTML or XML pages. JBuilder utilizes the Apache Xalan stylesheet processor for transformation of XML documents. Xalan uses stylesheets written in Extensible Style Language Transformations (XSLT) for transformation. An Extensible Style Language (XSL) stylesheet contains instructions for transforming XML documents from one document type into another document type (XML, HTML, PDF, WML, or other). SAX is a standard API for event-based XML parsing. The JBuilder Sax Handler wizard utilizes the Apache Xerces parsing engine that enables custom parsing of XML documents. Borland XML A programmable class generator used for databinding to generate JavaBean classes from DTD, enabling the use of simple JavaBean programming conventions to manipulate XML data without worrying about the XML details. Castor An open source databinding framework which provides a Java to XML binding. Castor has the ability to generate Java classes from schema files (.xsd). Table 1: List of XML components and technologies supported by JBuilder 8 4

5 XML basics With the Borland XML to DTD and DTD to XML generation wizards, you can rapidly create.xml from a.dtd and.dtd from.xml. By either opening the JBuilder Object Gallery or by a right-click of the mouse on your.dtd or.xml file, you have quick access to file generation as well as verification. Create a project Start JBuilder 8. Click File -> New -> Select Project tab from the Object Gallery. Click Project. Click OK. In the Project Wizard Step 1 of 3 specify a Directory Name and a Project Name. For this exercise, the project directory is E:/Example/XMLPrj and Project Name is XML. Leave the Template as (Default Project). Click Finish. XML to DTD Create an XML file (for pre-existing XML files, skip this step): In JBuilder, above the project pane, click the Add Files/Packages button as shown in Figure 1. Figure 1: Add Files/Packages button Enter the name XMLShoppingCart.xml into the File name field as shown in Figure 2. 5

6 Figure 2: Dialog box for XMLShoppingCart.xml creation Click OK. A blank.xml file is created. Copy and paste the following text (Figure 3) into your newly created XMLShoppingCart.xml file. Make sure to save this file to your XMLPrj directory. <?xml version="1.0"?> <XMLShoppingCart> <CustomerId>pcdata</CustomerId> <FirstName>pcdata</FirstName> <LastName>pcdata</LastName> <Address>pcdata</Address> <ZipCode>pcdata</ZipCode> <Item>pcdata</Item> <Qty>pcdata</Qty> <Company>pcdata</Company> 6

7 <JobCountry>pcdata</JobCountry> <FullName>pcdata</FullName> </XMLShoppingCart> Figure 3: Sample XML Text Note: If you have a pre-existing XML document, you can skip the previous step. In JBuilder, Choose File-> New -> Select the XML tab, Choose XML to DTD In the XML-DTD dialog box, choose the directory where your (input).xml file is located. Click the [ ] ellipses button and navigate to your project directory, or directory of your choice. Locate and select your.xml file. The Output DTD file directory will automatically be populated. See Figure 4. Figure 4: XML to DTD wizard window 7

8 Click OK. JBuilder will generate the.dtd file from your.xml file. See Figure 5 below. <?xml version="1.0" encoding="utf-8"?> <!ELEMENT XMLShoppingCart ( CustomerId, FirstName, LastName, Address, ZipCode, Item, Qty, Company, JobCountry, FullName ) > <!ELEMENT FullName ( #PCDATA ) > <!ELEMENT Item ( #PCDATA ) > <!ELEMENT Company ( #PCDATA ) > <!ELEMENT Address ( #PCDATA ) > <!ELEMENT JobCountry ( #PCDATA ) > <!ELEMENT LastName ( #PCDATA ) > <!ELEMENT ZipCode ( #PCDATA ) > <!ELEMENT CustomerId ( #PCDATA ) > <!ELEMENT FirstName ( #PCDATA ) > <!ELEMENT Qty ( #PCDATA ) > Figure 5: Generated DTD DTD to XML JBuilder allows you to generate XML from DTD as well. 8

9 Right-click the XMLShoppingCart.dtd as shown in Figure 6. Figure 6: Right-click menu on the.dtd file You have many options with this menu. In this example, XML will be generated from this.dtd file, click Generate XML. The DTD to XML dialog box will appear as shown in Figure 7. Figure 7: DTD to XML wizard 9

10 The Input DTD file field should already be populated with the appropriate directory and.dtd. file. Select the Root element drop down list and choose XMLShoppingCart. In the Output XML file field, choose the [ ] ellipses button and rename XMLShoppingCart.xml to DTDGen_ShoppingCart.xml. Under the Identifiers option, System edit field, type in the name of the.dtd file that the XML file will be referencing, in our case it is XMLShoppingCart.dtd. Click OK. JBuilder has generated the XML File from your.dtd as shown in Figure 8. <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE XMLShoppingCart SYSTEM "XMLShoppingCart.dtd"> <XMLShoppingCart> <CustomerId>pcdata</CustomerId> <FirstName>pcdata</FirstName> <LastName>pcdata</LastName> <Address>pcdata</Address> <ZipCode>pcdata</ZipCode> <Item>pcdata</Item> <Qty>pcdata</Qty> <Company>pcdata</Company> <JobCountry>pcdata</JobCountry> <FullName>pcdata</FullName> </XMLShoppingCart> Figure 8: Generated XML from.dtd Note: You can also access the DTD to XML wizard by choosing File -> New. In the Object Gallery, select the XML tab, choose DTD to XML. Right-click the DTDGen_ShoppingCart.xml file as shown in Figure 9. 10

11 Figure 9: Right-click menu on a.xml file Choose Validate. JBuilder will validate that your.xml file for correct content and tag matching. You should receive a dialog box stating that your.xml document is valid as shown in Figure 10. Figure 10: Valid XML box Click OK. You have successfully created an.xml file, generated DTD, and then generated an.xml file from the DTD utilizing the JBuilder XML/DTD wizards. 11

12 XML and databinding Databinding wizards The Databinding wizard in JBuilder allows you to use Borland XML or Castor. See Introduction section for a definition of these components. With Borland XML, you can rapidly create Java files, instantly by inputting your.dtd file. The setter and getter methods for the attributes (column names) in your.dtd file are automatically generated which means you save time on coding. Borland XML also generates the methods for marshalling and unmarshalling objects, so all you have to do is invoke the methods. They have been created for you. For this paper, we will be using Borland XML. Choose File -> New. Choose the XML tab, select Databinding. The Databinding wizard will start up as shown in Figure 11. Figure 11: Databinding wizard 12

13 Choose Borland XML in the drop down list. Click Next. Navigate to your XMLPrj directory and choose the XMLShoppingCart.dtd file as shown in Figure 12. Figure 12: Databinding wizard Step 2 Choose XMLShoppingCart as the Root Element. Click Finish. If you expand the xmlprj package in the project pane, you can see that JBuilder has generated the class files based on the XMLShoppingCart.dtd file as shown in Figure 13 after utilizing the Databinding wizard with Borland XML. 13

14 Figure 13: Generated Java classes after using the Databinding wizard with Borland XML If you select the XMLShoppingCart.java file, you will be able to see the generated methods. Specifically examine the marshal and unmarshalling methods that were generated. By using these methods, you can write to an XML document from a JavaBean object (marshalling), or you can read an XML document into JavaBean objects (unmarshalling). See Appendix A for more information about marshalling and unmarshalling. In the next section, you will learn how to use these methods. Create a project. (For instructions on how to do this, see section entitled Create a project ). Create an.xml file called ShoppingCart.xml. (See section XML to DTD for instructions on creating a new file). Paste the text below, into the.xml file: 14

15 <?xml version="1.0"?> <!DOCTYPE ShoppingCart SYSTEM "ShoppingCart.dtd"> <ShoppingCart> <ShoppingCart> <CustomerId>1</CustomerId> <FirstName>Jessica</FirstName> <LastName>Baker</LastName> <Address>250 Bayberry Road</Address> <ZipCode>02895</ZipCode> <Item>Jbuilder Enterprise</Item> <Qty>25</Qty> <Company>XYZ Company</Company> <JobCountry>USA</JobCountry> <FullName>Baker, Jessica</FullName> </ShoppingCart> <ShoppingCart> <CustomerId>5</CustomerId> <FirstName>Brian</FirstName> <LastName>Smith</LastName> <Address>10673 W Coast Dr</Address> <ZipCode>95066</ZipCode> <Item>OptimizeIt</Item> <Qty>50</Qty> <Company>Foo Company</Company> <JobCountry>USA</JobCountry> <FullName>Smith, Brian</FullName> </ShoppingCart> <ShoppingCart> <CustomerId>77</CustomerId> <FirstName>Carter</FirstName> <LastName>Ritz</LastName> <Address>22 Bell St</Address> <ZipCode>77375</ZipCode> <Item>JBuilder Enterprise</Item> <Qty>130</Qty> <Company>TechABC Company</Company> <JobCountry>USA</JobCountry> <FullName>Ritz, Carter</FullName> </ShoppingCart> </ShoppingCart> Save your new ShoppingCart.xml file. 15

16 Create another file and name it ShoppingCart.dtd. Copy and paste the text, below, into that file: <?xml version="1.0" encoding="utf-8"?> <!ELEMENT FullName ( #PCDATA ) > <!ELEMENT Item ( #PCDATA ) > <!ELEMENT Company ( #PCDATA ) > <!ELEMENT Address ( #PCDATA ) > <!ELEMENT JobCountry ( #PCDATA ) > <!ELEMENT LastName ( #PCDATA ) > <!ELEMENT ZipCode ( #PCDATA ) > <!ELEMENT CustomerId ( #PCDATA ) > <!ELEMENT FirstName ( #PCDATA ) > <!ELEMENT ShoppingCart ( ShoppingCart?, CustomerId?, FirstName?, LastName?, Address?, ZipCode?, Item?, Qty?, Company?, JobCountry?, FullName? ) > <!ELEMENT Qty ( #PCDATA ) > Save your new ShoppingCart.dtd file. Right-click the ShoppingCart.dtd file and choose Generate Java. In the Databinding wizard, make sure Borland XML is selected. Choose Next. In the Root element drop down list, select Shopping Cart. Choose Finish. The.java files have been generated. See XML and Databinding for additional information. Creating a class Create a new class, by choosing File -> New. The Object Gallery will appear. Click the General tab. Choose Class. In the Class wizard, type in SC_BorlandXML for the class name. Leave the defaults for everything else, and click OK, as shown in Figure

17 Figure 14: Class wizard Navigate to the SC_BorlandXML.java class in the project pane. Copy and paste the text, below, into your new class: package borlandxml; public class SC_BorlandXML { String filename = "ShoppingCart.xml"; ShoppingCart shoppingcart; static SC_BorlandXML sc_borlandxml; public SC_BorlandXML() { } /** * This methods unmarshals (reads) the content of the XML file and initializes corresponding * class instances. */ public void readshoppingcart() { 17

18 java.io.fileinputstream in = null; try { in = new java.io.fileinputstream(filename); System.out.println("== unmarshalling \"" + filename + "\" =="); shoppingcart = ShoppingCart.unmarshal(in); shoppingcart.setsystemid("shoppingcart.dtd"); }catch (Throwable ex) { ex.printstacktrace(); } System.out.println("Getting customer information! "); ShoppingCart customerinfo = shoppingcart.getshoppingcart(); System.out.println("Customer's Full Name is " + customerinfo.getfullnametext()); System.out.println("Items in shopping cart: " + customerinfo.getitemtext()); System.out.println("Quantity: " + customerinfo.getqtytext()); } public static void main(string[] args) { sc_borlandxml = new SC_BorlandXML(); sc_borlandxml.readshoppingcart(); } } Take a closer look at the SC_BorlandXML.java file. It has one method: readshoppingcart(). First, a FileInputStream is created and then the unmarshal() method is invoked from the ShoppingCart object. The unmarshal() method is reading the XML into the Shopping Cart Java object. You can see in the main() method, that the class is instantiated and then the readshoppingcart() method is invoked. 18

19 Right-click your project file: BorlandXML.prj and choose Make. This will build the entire project. Highlight and right-click the SC_BorlandXML.java file. Choose Run using Defaults. In the message window in JBuilder, you should see the following results, as shown in Figure 15. You can see that data from the XML file is being read and displayed. Figure 15: Results after running the SC_BorlandXML.java file Double-click the ShoppingCart.xml file in the project pane, and examine the data in the file. BorlandXML is fast and makes generating your.java files from an XML file easier. 19

20 Apache Cocoon JBuilder 8 has support for publishing your XML documents with the Apache Cocoon Publishing Framework. Choose File ->New XML Tab -> Cocoon Name your Web application ShoppingCart. Change the default directory by navigating to your XMLPrj directory. JBuilder allows you to use the following frameworks: InternetBeans Express 1.1, JSTL 1.0, and Apache Struts 1.0. For this exercise, we will not be using these frameworks. Leave the defaulted value in the Launch URI drop-down list. Click OK. See Figure 16. Figure 16: Web application wizard 20

21 JBuilder has generated the necessary Web application information used to publish your XML. If you look in the project pane, you can see the Shopping Cart Web application. Expand the Web application and click the Root directory. You should see the files that JBuilder has pulled into the project as well as the files that were generated: DTDGen_ShoppingCart.xml, index.xml, index.xsl, sitemap.xmap, and XMLShoppingCart.xml. XSL with XML In the next section we will apply the generated index.xsl stylesheet to the ShoppingCart.xml file. For more information about XSL refer to the Framework Components table. In the project pane, navigate to the index.xsl file. Double-click the file and examine the body of the file in the editor window. This is a JBuilder generated.xsl file. Let s apply it to our ShoppingCart.xml file and see the results. Double-click the ShoppingCart.xml file. In the editor window, choose Transform View tab, as shown in Figure 17. Figure 17: Tabs in the editor window for XML files Click the Add Stylesheets button, located in the upper left corner of the editor pane, as shown in Figure 18. Figure 18: XML buttons. The first button from the left is the Default Stylesheet button. The second button from the left is the Refresh button. The third button from the left is the Set Trace Options button. The last button is the Add Stylesheets button. 21

22 The Default Stylesheet button allows you to apply a default stylesheet. The Set Trace Options button, when clicked, brings up a window that allows you to set different trace options for your.xml file, as shown in Figure 19. The options are as follows: Generation: outputs information after each result tree generation event, such as start document, start element, characters, and so on. Templates: outputs an event when a template is invoked. Elements: outputs events that occur as each node is executed in the stylesheet. Selections: outputs information after each selection event. Figure 19: Set Trace Options window You can also access Trace Options by going to the Tools Menu -> IDE Options -> XML tab, as shown in Figure

23 Figure 20: XML options in the Tools Menu ->IDE Options You can choose which Trace Options you would like enabled here as well as select other general XML options. For this exercise, do not select any trace options. Let s add the stylesheet to our ShoppingCart.xml file. Click the button Add StyleSheets. Choose Add. Navigate to the index.xsl file and select it. Click the Refresh button. Here is what the ShoppingCart.xml file looks like with the index.xsl stylesheet applied to it, as shown in Figure

24 Figure 21: ShoppingCart.xml file with index.xsl stylesheet applied to it As you can see, this stylesheet doesn t format the data in a readable manner. So let s create a new stylesheet that displays the data in a table so that it is easier to read. Create a file, name it ShoppingCartTableView.xsl. For instructions on how to create a file, see the XML to DTD section of this document. Copy and paste the text below into your new ShoppingCartTableView.xsl file: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl=" version="1.0" xmlns:java=" exclude-result-prefixes="java"> <xsl:output method="xml" indent="yes"/> <xsl:output encoding="iso "/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <html> <head> <xsl:element name="title">orders</xsl:element> </head> <body> <xsl:element name="h1">list of Orders</xsl:element> <xsl:element name = "table"> <xsl:attribute name="border">2</xsl:attribute> <xsl:attribute name="bgcolor">#ff8040</xsl:attribute> <xsl:attribute name="cellpadding">3</xsl:attribute> <xsl:attribute name="cellspacing">3</xsl:attribute> <xsl:attribute name="frame">box</xsl:attribute> <xsl:attribute name="bordercolor">black</xsl:attribute> <xsl:attribute name="rules">all</xsl:attribute> 24

25 <tr BGCOLOR = "Yellow"> <th>customerid</th><th>firstname</th><th>lastname</th><th>address </th><th>zipcode</th><th>item</th> <th>qty</th><th>company</th><th>country</th><th>fullname</th> </tr> <xsl:for-each select="shoppingcart/shoppingcart"> <tr> <xsl:element name="td"> <xsl:value-of select="customerid"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="firstname"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="lastname"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="address"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="zipcode"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="item"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="qty"/> </xsl:element> 25

26 <xsl:element name="td"> <xsl:value-of select="company"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="jobcountry"/> </xsl:element> <xsl:element name="td"> <xsl:value-of select="fullname"/> </xsl:element> </tr> </xsl:for-each> </xsl:element> </body> </html> </xsl:template> </xsl:stylesheet> Save your file. Now, double-click the ShoppingCart.xml file. Click the TransformView tab in the code editor pane. Click the Add Stylesheets button. Highlight the index.xsl file, and choose Remove. Choose Add. Navigate to the ShoppingCartTableView.xsl file, select it, and click OK. Click the Refresh button. You are now able to view your newly formatted ShoppingCart.xml file with the newly applied ShoppingCartTableView.xsl stylesheet, as shown in Figure

27 Figure 22: ShoppingCart.xml file with the ShoppingCartTableView.xsl file applied to it In the project pane, you can see under the Shopping Cart Web application, that a.war file has been created as well as other files. Let s take a closer look at these files: ShoppingCart.war a Web archive file Web.xml a Web application deployment descriptor Index.xml a sample XML document Index.xsl a sample stylesheet that is applied to the index.xml file, this will allow this.xml file to be rendered as an.html file. Sitemap.xmap maps the URI space to the different pipelines in Cocoon. A pipeline is a path from a Generator to a Serializer. Let s run Cocoon with the sample index.xml file. First, you must have a Web server configured. Tomcat is automatically configured within JBuilder, so for this exercise we will use Tomcat 4.1. Choose Tools > Configure Servers. To verify that Tomcat is set up properly, click Tomcat 4.1 in the Configure Servers window. Make sure that there is a check in the Enable Server box for Tomcat 4.1, as shown in Figure 23. Choose OK. 27

28 Figure 23: Configure a Web server using Tomcat 4.1 Note: You are free to choose any Web server you would like, provided you have access to it on your own computer. We need to check one more setting before we run the application. Choose Project -> Project Properties. Choose the Server tab. Make sure Tomcat 4.1 is selected in the drop-down list, as shown in Figure

29 Figure 24: Project Properties Server setup tab Running Cocoon with JBuilder Right-click the ShoppingCart Web application and choose Web Run using Defaults. This will start up Tomcat, deploy, and run your ShoppingCart.war file, as shown in Figure

30 Figure 25: Running your Web application Figure 26 shows the result of running Cocoon. Now let s run the Web application and ShoppingCart.xml file. First we need to make a few changes to the sitemap.xmap file. 30

31 Figure 26: Results after running Cocoon with the sample index.xml Double-click the sitemap.xmap file. Navigate to the text below: <map:pipeline> <map:match pattern="index.xml"> <map:generate src="index.xml"/> <map:transform src="index.xsl"/> <map:serialize/> </map:match> </map:pipeline> </map:pipelines> Change this file to publish the ShoppingCart.xml file. See changes below: map:pipeline> 31

32 <map:match pattern="shoppingcart.xml"> <map:generate src="shoppingcart.xml"/> <map:transform src="shoppingcarttableview.xsl"/> <map:serialize/> </map:match> </map:pipeline> </map:pipelines> </map:sitemap> Right-click the ShoppingCart Web application. Choose properties. In Launch URI, use the ellipses button to navigate to the ShoppingCart.xml file. Highlight it, and click OK, as shown in Figure

33 Figure 27: Changing the Launch URI setting Click OK. Save your work. It is time to run your application. Right-click the Shopping Cart and choose Web Run using defaults. See section Running Cocoon with JBuilder for further instructions. You can now see the ShoppingCart.xml file running within JBuilder hosted by Cocoon, as shown in Figure

34 Figure 28: ShoppingCart.xml running within JBuilder Examine the code editor pane. The URL is : You can open up a browser (Microsoft Internet Explorer, Netscape Navigator), copy and paste the URL above, and view the ShoppingCart.xml file in an external (from JBuilder) browser. Note: You can add the JBuilder index.xml sample into the sitemap.xmap file together with the ShoppingCart.xml file by modifying the file as follows: <map:pipeline> <map:match pattern="index.xml"> 34

35 <map:generate src="index.xml"/> <map:transform src="index.xsl"/> <map:serialize/> </map:match> </map:pipeline> <map:pipeline> <map:match pattern="shoppingcart.xml"> <map:generate src="shoppingcart.xml"/> <map:transform src="shoppingcarttableview.xsl"/> <map:serialize/> </map:match> </map:pipeline> </map:pipelines> </map:sitemap> By adding both.xml references, when you run your Web application, you can view either.xml file by changing the URL: or You can also add a link in either of the.xml files to avoid changing the URL each time. You can publish your.xml files with a quick click of a button and a few entries in the Cocoon wizard within JBuilder. SAX Handler wizard SAX, the Simple API for XML, is a standard interface for event-based XML parsing. SAX reports parsing events directly to the application through callbacks. The application implements handlers to deal with the different events, similar to event handling in a graphical user interface. 35

36 With the SAX Handler wizard in JBuilder, you can easily create SAX parser implementation templates with your implemented methods to parse your XML. The JBuilder SAX Handler wizard helps you create a SAX parser, using the Apache Xerces parsing engine, for custom parsing of your XML documents. Let s create a SAX Handler with the JBuilder wizard. In this example, we will parse an.xml file and add indentations to the output, making it easier to read. Create a project called is Sax Handler. See the section Create a project for additional instructions. Create an.xml and.dtd file or use the ShoppingCart.xml and ShoppingCart.dtd files from the previous sections. Please refer to the section XML to DTD on how to create a file. Refer to the section Databinding wizards for the body of the ShoppingCart.xml and ShoppingCart.dtd files. To add a pre-existing file to your project, click the Add Files/Packages button and navigate to your.xml file, as shown in Figure 29. Figure 29: Add Files/Packages button Choose File > New. The Object Gallery window will appear, choose the XML tab. Click Sax Handler. In the wizard, keep the default package name. Change the Class name to MySaxParser. In the methods to override box, click ContentHandler. Expand ContentHandler and choose: characters, enddocument, endelement, startdocument, startelement., as shown in Figure

37 Figure 30: Sax Parser Wizard, Step 1 Note: For more information on these methods and interfaces, refer to the Apache Web site: Click Next. In Step 2 of the wizard, you can choose any of the parser options that you need. For this exercise, we will not select any. The options vary according to the SAX parser selected. The General parser is a JAXP-compatible parser, which only supports JAXP required features. JDK 1.4 uses Crimson as the default parser. For more information, see the SAXParserFactory class. The Xerces parser supports all Xerces 2 features. For more information on Xerces and the options it supports, see the documentation in <jbuilder>\extras\xerces\docs\features.html. Important: If you're using JDK 1.3 for your project, use Xerces as the parser, since JDK 1.3 doesn't include a JAXP parser. When you 37

38 choose Xerces as the parser, JBuilder automatically adds the Xerces library to the project, as shown in Figure 31. Figure 31: Sax Parser Wizard, Step 2 Click Next. In step 3, change the name of the runtime configuration to MySaxParser. Click Finish. This step is shown in Figure

39 Figure 32: Sax Parser Wizard, Step 3 Open the MySaxParser.java file double-click it in the project pane. Examine the generated code. Notice that your new class extends DefaultHandler. The DefaultHandler Java class is the default base class for Sax event handlers. It provides default implementations for all of the callbacks in the four core SAX2 handler classes: EntityResolver DTDHandler ContentHandler ErrorHandler Application writers can extend this class when they need to implement only part of an interface; parser writers can instantiate this class to provide default handlers when the application has not supplied its own. For this example, we will use the ContentHandler class. 39

40 Let s modify the MySaxParser.java file: 1. Add the following print statement to the startdocument() method: System.out.println(" Start Document "); Remove the throw statement in this method. 2. Add the following print statement to the enddocument() method: System.out.println(" End Document "); Remove the throw statement in this method. 3. Before the characters() method, add a variable: private int idx = 0; //indent 4. Before the main() method, add a variable: private static int INDENT = 2; 5. Create a getindent() method at the end of the MySaxParser class after the startelement() method. This method provides indentation for the parsing output to make it easier to read. private String getindent() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < idx; i++) sb.append(" "); return sb.tostring(); } 6. Add the following code to each of the methods (indicated in bold) to add indenting to the output: public void characters(char[] ch, int start, int length) throws SAXException { //instantiates s, indents output, prints character values in element String s = new String(ch, start, length); if (!s.startswith("\n")) System.out.println(getIndent()+ " Value: " + s); } public void enddocument() throws SAXException { idx -= INDENT; System.out.println(getIndent() + "end document"); 40

41 } System.out.println("...PARSING ends"); public void endelement(string uri, String localname, String qname) throws SAXException { System.out.println(getIndent() + "end element"); idx -= INDENT; } public void startdocument() throws SAXException { idx += INDENT; System.out.println("PARSING begins..."); System.out.println(getIndent() + "start document: "); } public void startelement(string uri, String localname, String qname, Attributes attributes) throws SAXException { idx += INDENT; System.out.println('\n' + getindent() + "start element: " + qname); } 7. Save your project. Before we run the project, we need to make sure the Xerces library is accessible to the project within JBuilder. Go to Project > Project Properties. Click the Paths tab. Click the Required Libraries tab. Click Add. Navigate to the pre-defined Xerces library and add it, as shown in Figure

42 Figure 33: Required Libraries Adding the Xerces library to the project Let s run the project. Go to Run > Configurations. We need to modify the runtime configuration. Make sure that your MySaxParser class is in the Main Class box. If it isn t, using the ellipses button to navigate to your MySaxParser.java file. Add the application parameter: file:///c:\borland\jbuilder8\projects\saxhandler\shoppingcart.xml Click OK. This is shown in Figure

43 Figure 34: Runtime configuration properties Click your Runtime Configuration: MySaxParser, as shown below. Click the green play button and select your file. 43

44 In the output window, you should see the results of the parsed.xml file with added indents. PARSING begins... start document: start element: ShoppingCart start element: ShoppingCart start element: CustomerId Value: 1 end element start element: FirstName Value: Jessica end element start element: LastName Value: Baker end element start element: Address Value: 250 Bayberry Road end element start element: ZipCode Value: end element start element: Item Value: Jbuilder Enterprise end element start element: Qty Value: 25 end element start element: Company Value: XYZ Company end element 44

45 start element: JobCountry Value: USA end element. Much more Parsing of the ShoppingCart.xml file here, but it was left out due to its length.. start element: JobCountry Value: USA end element start element: FullName Value: Ritz, Carter end element end element end element end document...parsing ends You have now successfully used the Sax Handler wizard to create events, format, and parse your.xml. The Sax Handler wizard makes it easier to use Xerces parsing engine and generate event handler methods with the click of a button. XML DBMS Generate XML-DBMS files for fast table creation and data transfer with the JBuilder XML- DBMS wizard. The XML-DMBS wizard takes your.dtd file as input and generates an SQL file for table creation and a.map file, which describes how the data is transferred from the XML elements to the correct columns in the new database. With the Database Pilot, you can rapidly create your tables and test database connections. To create a new project, see the section Create a project. 45

46 Go to File > New. In the Object Gallery, choose the XML tab. Select XML-DBMS. The XML-DBMS wizard will start up. In Step 1, you will select your database connection and then test it. To set up a database connection, see Appendix B. After you have set up and selected your database connection, save the connection information and then test the connection, as shown in Figure 35. Figure 35: XML-DBMS Wizard Step 1 In Step 2 of the wizard, you with specify an existing input DTD file, a name for the Output Map file, and a name for the Output SQL file. JBuilder will generate a.sql file with table creation information and a.map file. 46

47 For this exercise, we will use the Employee.dtd file, located under <JBuilder home>\samples\tutorials\xml\databinding\fromdtd See Figure 36 for an example. Figure 36: XML-DBMS wizard, Step 2 Choose Finish. Look in the project pane and navigate to your new files. Examine the.sql and the.map files. Now, we will load the SQL script into the Database Pilot and execute it. Go to Tools > Database Pilot. Double-click your connection. For this exercise, we will use the pre-defined example connection. Choose the Enter SQL tab. Input the SQL statements from your newly generated Employees.sql file, and choose Execute, as shown in Figure

48 Figure 37: Database Pilot, enter SQL tab After clicking Execute, examine the newly created tables: XMLEmployee and XMLEmployees. Let s use the XML components in the JBuilder designer and transfer data from the Employee table to our new XMLEmployee table. Choose File -> New, General tab, select Class. Call your new class XML. Double-click your new XML class. On the bottom of the code editor pane, click the Design tab. Once the designer is launched, examine the palettes of components. Choose the XML tab. Select the XMLDBMSTable component. Drag and drop it onto the gray canvas. In the lower left-hand pane, right-click the xmldbmstable1 component, as shown in Figure

49 Figure 38: XMLDBMSTable1 component Click Customizer. In the Customizer window, select your database connection and test it. After you have a successful connection, click the Transfer tab. Choose XML to DB radio button. Navigate to your Employee.xml file as your Input XML file. Navigate to your Employee.map file as your Map file, as shown in Figure

50 Figure 39: Customizer Transfer tab configurations Click Transfer after you have filled in the appropriate input fields. Go to Tools > Database Pilot. Double-click your connection, navigate to the XMLEmployee table. Click it, and then in the right-hand pane, choose the Data tab. You can see that the data from the Employee table has been transferred to the XMLEmployee table. Additional to this tutorial: To transfer data from the database to an XML file, choose the DB to XML radio button. You can also use the other XML components in the JBuilder designer for other database/xml manipulation. 50

51 Conclusion In thousands of software implementation projects around the world, JBuilder is the essential technology that speeds the development of XML, EJB, Web client, Web Services and database applications, supporting rapid deployment to leading applications servers for the J2EE platform. With enhanced techologies for team productivity and efficiency, JBuilder is engineered to enable Java development teams to create reliable, enterprise-class applications fast. Appendix A Resources: Borland XML: marshalling and unmarshalling Borland XML provides a data binding mechanism that hides the details of XML and reduces code complexity with increased ease of maintenance. Borland XML is a template-based programmable class generator used to generate JavaBean classes from a Document Type Definition (DTD). You then use the simple JavaBean programming convention to manipulate XML data without worrying about the XML details. Borland XML uses DTDs in a two-step process to generate Java classes. In the first step, Borland XML generates a class model file from a DTD. The class model file is an XML file with.bom extension. This file describes a high-level structure of the target classes and provides a way to customize these classes. In the second step, Borland XML generates Java classes from the.bom file (class model XML file). 51

52 Borland XML supports several features: 1. JavaBean manipulation: manipulates a bean to construct an XML document or access data in the document. 2. A marshalling framework for conversion between Java and XML. 3. Document validation: validates JavaBean objects before marshalling objects to XML or after unmarshalling an XML document back to JavaBean objects. 4. PCDATA customization: allows PCDATA to be customized to support different primitive data types, such as integer and long, and to support customized property names. 5. Variable names: allows generated variable names for elements and attributes to have customized prefixes and suffixes. 52

53 Marshalling framework: See also "The XML Databinding Specification" at Appendix B The Database Pilot The JBuilder Database Pilot is an easy tool used for setting up database connections via your specified JDBC driver. You can access your application data within JBuilder, which saves time and keeps all development in one environment the JBuilder IDE. 53

54 To set up your database connection and JDBC driver from within JBuilder, go to Tools > Database Pilot. See Figure 40: Database Pilot. Figure 40: Database Pilot We have created a connection to JDataStore, the database written entirely in Java that ships with JBuilder. You can see that the test connection was successful and the tables in the database are listed. Note the URL and Driver information in the right pane of the window. To create a new connection, in the Database Pilot, choose File > New. Choose your database driver and enter the URL. If your driver is not listed, you must add it to JBuilder. You can do this by going to Tools>Enterprise Setup > Database Drivers tab. The Borland JBuilder development environment is the core of the Borland software platform for Java and a critical element in the Borland Suite of application lifecycle management 54

55 technologies. Designed to give developers the tools they need to maximize productivity in the development of enterprise applications, JBuilder enables development teams to do more: reduce development costs, deliver consistent, high-quality applications, and shorten time-tomarket. In fact, from within the JBuilder IDE, developers can manage the entire application development lifecycle, from design to deployment. Made in Borland. Copyright 2003 Borland Software Corporation. All rights reserved. All Borland brand and product names are trademarks or registered trademarks of Borland Software Corporation in the United States and other countries. Microsoft, Windows, and other Microsoft product names are trademarks or registered trademarks of Microsoft Corporation in the U.S. and other countries. Linux is a registered trademark of Linus Torvalds. All other marks are the property of their respective owners. Corporate Headquarters: 100 Enterprise Way, Scotts Valley, CA Offices in: Australia, Brazil, Canada, China, Czech Republic, France, Germany, Hong Kong, Hungary, India, Ireland, Italy, Japan, Korea, the Netherlands, New Zealand, Russia, Singapore, Spain, Sweden, Taiwan, the United Kingdom, and the United States

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document 3. XML Processor APIs How applications can manipulate structured documents? An overview of document parser interfaces 3.1 SAX: an event-based interface 3.2 DOM: an object-based interface Document Parser

More information

Integrating CaliberRM with Mercury TestDirector

Integrating CaliberRM with Mercury TestDirector Integrating CaliberRM with Mercury TestDirector A Borland White Paper By Jenny Rogers, CaliberRM Technical Writer January 2002 Contents Introduction... 3 Setting Up the Integration... 3 Enabling the Integration

More information

JBuilder. JBuilder 6 features and benefits. Developer productivity Support for the latest Java standards

JBuilder. JBuilder 6 features and benefits. Developer productivity Support for the latest Java standards Developer productivity Support for the latest Java standards High-productivity development environment Advanced, state-of-the-art JBuilder AppBrowser IDE Develop Java applications with no proprietary code

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Information Technology IT6801 SERVICE ORIENTED ARCHITECTURE Anna University 2 & 16 Mark Questions & Answers Year / Semester: IV / VII Regulation:

More information

Simple API for XML (SAX)

Simple API for XML (SAX) Simple API for XML (SAX) Asst. Prof. Dr. Kanda Runapongsa (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Topics Parsing and application SAX event model SAX event handlers Apache

More information

Web Services Designer puts you in control.use the new Web Services designer to visually create, validate, import, and export Web Services.

Web Services Designer puts you in control.use the new Web Services designer to visually create, validate, import, and export Web Services. General Questions What is Borland JBuilder? Borland JBuilder accelerates your Java development with the leading next-generation, cross-platform environment for building industrial-strength enterprise Java

More information

A Look at Borland C#Builder from the Delphi Developers View

A Look at Borland C#Builder from the Delphi Developers View A Look at Borland C#Builder from the Delphi Developers View A Borland White Paper August 2003 By Corbin Dunn, Research and Development Engineer, Borland Software Corporation Contents Introduction... 3

More information

What s New in Borland JBuilder 8

What s New in Borland JBuilder 8 What s New in Borland JBuilder 8 The leading Java development solution A Borland White Paper By Borland Staff November, 2002 Contents What s new in JBuilder 8... 5 JDK 1.4.1... 5 Project management...

More information

XML and XSLT. XML and XSLT 10 February

XML and XSLT. XML and XSLT 10 February XML and XSLT XML (Extensible Markup Language) has the following features. Not used to generate layout but to describe data. Uses tags to describe different items just as HTML, No predefined tags, just

More information

StarTeamMPX Server. Publish/Subscribe Technology for StarTeam. By the Development Resources Platform Team. March, A Borland White Paper

StarTeamMPX Server. Publish/Subscribe Technology for StarTeam. By the Development Resources Platform Team. March, A Borland White Paper Publish/Subscribe Technology for StarTeam A Borland White Paper By the Development Resources Platform Team March, 2003 Contents ebusiness Challenges... 3 /Server Challenges... 3 The StarTeam Solution...

More information

Transaction Commit Options

Transaction Commit Options Transaction Commit Options Entity beans in the EJB container of Borland Enterprise Server by Jonathan Weedon, Architect: Borland VisiBroker and Borland AppServer, and Krishnan Subramanian, Enterprise Consultant

More information

MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX

MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX MANAGING INFORMATION (CSCU9T4) LECTURE 4: XML AND JAVA 1 - SAX Gabriela Ochoa http://www.cs.stir.ac.uk/~nve/ RESOURCES Books XML in a Nutshell (2004) by Elliotte Rusty Harold, W. Scott Means, O'Reilly

More information

Stored Procedures and UDFs with Borland JDataStore

Stored Procedures and UDFs with Borland JDataStore Stored Procedures and UDFs with Borland JDataStore Increase application capability and get encapsulation of business logic by Jens Ole Lauridsen Borland Software Corporation August 2002 Contents Introduction

More information

IBM WebSphere software platform for e-business

IBM WebSphere software platform for e-business IBM WebSphere software platform for e-business XML Review Cao Xiao Qiang Solution Enablement Center, IBM May 19, 2001 Agenda What is XML? Why XML? XML Technology Types of XML Documents DTD XSL/XSLT Available

More information

Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005

Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005 Oracle Application Server 10g Oracle XML Developer s Kit Frequently Asked Questions September, 2005 This FAQ addresses frequently asked questions relating to the XML features of Oracle XML Developer's

More information

IBM Rational Application Developer for WebSphere Software, Version 7.0

IBM Rational Application Developer for WebSphere Software, Version 7.0 Visual application development for J2EE, Web, Web services and portal applications IBM Rational Application Developer for WebSphere Software, Version 7.0 Enables installation of only the features you need

More information

The main Topics in this lecture are:

The main Topics in this lecture are: Lecture 15: Working with Extensible Markup Language (XML) The main Topics in this lecture are: - Brief introduction to XML - Some advantages of XML - XML Structure: elements, attributes, entities - What

More information

XML Parsers. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

XML Parsers. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University XML Parsers Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview What are XML Parsers? Programming Interfaces of XML Parsers DOM:

More information

XML. Objectives. Duration. Audience. Pre-Requisites

XML. Objectives. Duration. Audience. Pre-Requisites XML XML - extensible Markup Language is a family of standardized data formats. XML is used for data transmission and storage. Common applications of XML include business to business transactions, web services

More information

XML in the Development of Component Systems. Parser Interfaces: SAX

XML in the Development of Component Systems. Parser Interfaces: SAX XML in the Development of Component Systems Parser Interfaces: SAX XML Programming Models Treat XML as text useful for interactive creation of documents (text editors) also useful for programmatic generation

More information

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

Delivery Options: Attend face-to-face in the classroom or remote-live attendance. XML Programming Duration: 5 Days Price: $2795 *California residents and government employees call for pricing. Discounts: We offer multiple discount options. Click here for more info. Delivery Options:

More information

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance.

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance. XML Programming Duration: 5 Days US Price: $2795 UK Price: 1,995 *Prices are subject to VAT CA Price: CDN$3,275 *Prices are subject to GST/HST Delivery Options: Attend face-to-face in the classroom or

More information

JBuilder. Getting Started Guide part II. Preface. Creating your Second Enterprise JavaBean. Container Managed Persistent Bean.

JBuilder. Getting Started Guide part II. Preface. Creating your Second Enterprise JavaBean. Container Managed Persistent Bean. Getting Started Guide part II Creating your Second Enterprise JavaBean Container Managed Persistent Bean by Gerard van der Pol and Michael Faisst, Borland Preface Introduction This document provides an

More information

To accomplish the parsing, we are going to use a SAX-Parser (Wiki-Info). SAX stands for "Simple API for XML", so it is perfect for us

To accomplish the parsing, we are going to use a SAX-Parser (Wiki-Info). SAX stands for Simple API for XML, so it is perfect for us Description: 0.) In this tutorial we are going to parse the following XML-File located at the following url: http:www.anddev.org/images/tut/basic/parsingxml/example.xml : XML:

More information

JAXP: Beyond XML Processing

JAXP: Beyond XML Processing JAXP: Beyond XML Processing Bonnie B. Ricca Sun Microsystems bonnie.ricca@sun.com bonnie@bobrow.net Bonnie B. Ricca JAXP: Beyond XML Processing Page 1 Contents Review of SAX, DOM, and XSLT JAXP Overview

More information

Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through

Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through Chris Panayiotou Needed for: domain-specific applications implementing new generic tools Important components: parsing XML documents into XML trees navigating through XML trees manipulating XML trees serializing

More information

The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet.

The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet. 1 2 3 The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet. That's because XML has emerged as the standard

More information

XML Overview, part 1

XML Overview, part 1 XML Overview, part 1 Norman Gray Revision 1.4, 2002/10/30 XML Overview, part 1 p.1/28 Contents The who, what and why XML Syntax Programming with XML Other topics The future http://www.astro.gla.ac.uk/users/norman/docs/

More information

CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS

CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS CHAPTER 1 USING JAXP FOR XML TRANSFORMATIONS OBJECTIVES After completing Using JAXP for XML Transformations, you will be able to: Describe the role of JAXP in XML transformations. Instantiate a Transformer

More information

Java EE 7: Back-end Server Application Development 4-2

Java EE 7: Back-end Server Application Development 4-2 Java EE 7: Back-end Server Application Development 4-2 XML describes data objects called XML documents that: Are composed of markup language for structuring the document data Support custom tags for data

More information

Extensible Markup Stylesheet Transformation (XSLT)

Extensible Markup Stylesheet Transformation (XSLT) Extensible Markup Stylesheet Transformation (XSLT) Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview Terms: XSL, XSLT, XSL-FO Value

More information

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name EXAM IN SEMI-STRUCTURED DATA 184.705 23. 10. 2015 Study Code Student Id Family Name First Name Working time: 100 minutes. Exercises have to be solved on this exam sheet; Additional slips of paper will

More information

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p.

Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. Introduction p. 1 An XML Primer p. 5 History of XML p. 6 Benefits of XML p. 11 Components of XML p. 12 BNF Grammar p. 14 Prolog p. 15 Elements p. 16 Attributes p. 17 Comments p. 18 Document Type Definition

More information

Introduction to XML. Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs

Introduction to XML. Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs Introduction to XML Large Scale Programming, 1DL410, autumn 2009 Cons T Åhs XML Input files, i.e., scene descriptions to our ray tracer are written in XML. What is XML? XML - extensible markup language

More information

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name

EXAM IN SEMI-STRUCTURED DATA Study Code Student Id Family Name First Name EXAM IN SEMI-STRUCTURED DATA 184.705 24. 6. 2015 Study Code Student Id Family Name First Name Working time: 100 minutes. Exercises have to be solved on this exam sheet; Additional slips of paper will not

More information

XML for Java Developers G Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti

XML for Java Developers G Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML Chapter 7 XML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML

More information

SAX & DOM. Announcements (Thu. Oct. 31) SAX & DOM. CompSci 316 Introduction to Database Systems

SAX & DOM. Announcements (Thu. Oct. 31) SAX & DOM. CompSci 316 Introduction to Database Systems SAX & DOM CompSci 316 Introduction to Database Systems Announcements (Thu. Oct. 31) 2 Homework #3 non-gradiance deadline extended to next Thursday Gradiance deadline remains next Tuesday Project milestone

More information

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p.

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p. Preface p. xiii Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p. 11 Creating the Deployment Descriptor p. 14 Deploying Servlets

More information

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2 HYPERION SYSTEM 9 BI+ APPLICATION BUILDER J2EE RELEASE 9.2 GETTING STARTED GUIDE Copyright 1998-2006 Hyperion Solutions Corporation. All rights reserved. Hyperion, the Hyperion H logo, and Hyperion s product

More information

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML is a markup language,

More information

In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm.

In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm. Lab 1 Getting Started 1.1 Building and Executing a Simple Message Flow In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm.

More information

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML INTRODUCTION 2 THE XML LANGUAGE XML: Extensible Markup Language Standard for the presentation and transmission of information.

More information

Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations

Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations Accelerating SVG Transformations with Pipelines XML & SVG Event Pipelines Technologies Recommendations Eric Gropp Lead Systems Developer, MWH Inc. SVG Open 2003 XML & SVG In the Enterprise SVG can meet

More information

Written Exam XML Winter 2005/06 Prof. Dr. Christian Pape. Written Exam XML

Written Exam XML Winter 2005/06 Prof. Dr. Christian Pape. Written Exam XML Name: Matriculation number: Written Exam XML Max. Points: Reached: 9 20 30 41 Result Points (Max 100) Mark You have 60 minutes. Please ask immediately, if you do not understand something! Please write

More information

Using the JAXB Wizard and Code-Seeder Pallete

Using the JAXB Wizard and Code-Seeder Pallete Using the JAXB Wizard and Code-Seeder Pallete Beta Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 820 6205 11/10/2007 Copyright 2008 Sun Microsystems, Inc. 4150 Network

More information

Borland Optimizeit Enterprise Suite 6

Borland Optimizeit Enterprise Suite 6 Borland Optimizeit Enterprise Suite 6 Feature Matrix The table below shows which Optimizeit product components are available in Borland Optimizeit Enterprise Suite and which are available in Borland Optimizeit

More information

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 2 - Sub-Topic 1 Beginning XML Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Objectives

More information

Processing XML Documents with SAX Using BSF4ooRexx

Processing XML Documents with SAX Using BSF4ooRexx MIS Department Processing XML Documents with SAX Using BSF4ooRexx 2013 International Rexx Symposium RTP, North Carolina Prof. Dr. Rony G. Flatscher Vienna University of Economics and Business Administration

More information

Cisco Extensible Provisioning and Operations Manager 4.5

Cisco Extensible Provisioning and Operations Manager 4.5 Data Sheet Cisco Extensible Provisioning and Operations Manager 4.5 Cisco Extensible Provisioning and Operations Manager (EPOM) is a Web-based application for real-time provisioning of the Cisco BTS 10200

More information

NetBeans IDE Field Guide

NetBeans IDE Field Guide NetBeans IDE Field Guide Copyright 2005 Sun Microsystems, Inc. All rights reserved. Table of Contents Extending Web Applications with Business Logic: Introducing EJB Components...1 EJB Project type Wizards...2

More information

EMC Documentum Forms Builder

EMC Documentum Forms Builder EMC Documentum Forms Builder Version 6 User Guide P/N 300-005-243 EMC Corporation Corporate Headquarters: Hopkinton, MA 01748-9103 1-508-435-1000 www.emc.com Copyright 1994-2007 EMC Corporation. All rights

More information

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards Representing Web Data: XML XML Example XML document: An XML document is one that follows certain syntax rules (most of which we followed for XHTML) Guy-Vincent

More information

Extreme Java G Session 3 - Sub-Topic 5 XML Information Rendering. Dr. Jean-Claude Franchitti

Extreme Java G Session 3 - Sub-Topic 5 XML Information Rendering. Dr. Jean-Claude Franchitti Extreme Java G22.3033-007 Session 3 - Sub-Topic 5 XML Information Rendering Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda

More information

XML APIs. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart

XML APIs. Web Data Management and Distribution. Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart XML APIs Web Data Management and Distribution Serge Abiteboul Philippe Rigaux Marie-Christine Rousset Pierre Senellart http://gemo.futurs.inria.fr/wdmd January 25, 2009 Gemo, Lamsade, LIG, Telecom (WDMD)

More information

COMP4317: XML & Database Tutorial 2: SAX Parsing

COMP4317: XML & Database Tutorial 2: SAX Parsing COMP4317: XML & Database Tutorial 2: SAX Parsing Week 3 Thang Bui @ CSE.UNSW SAX Simple API for XML is NOT a W3C standard. SAX parser sends events on-the-fly startdocument event enddocument event startelement

More information

XML Programming in Java

XML Programming in Java Mag. iur. Dr. techn. Michael Sonntag XML Programming in Java DOM, SAX XML Techniques for E-Commerce, Budapest 2005 E-Mail: sonntag@fim.uni-linz.ac.at http://www.fim.uni-linz.ac.at/staff/sonntag.htm Michael

More information

Data Presentation and Markup Languages

Data Presentation and Markup Languages Data Presentation and Markup Languages MIE456 Tutorial Acknowledgements Some contents of this presentation are borrowed from a tutorial given at VLDB 2000, Cairo, Agypte (www.vldb.org) by D. Florescu &.

More information

Manakin Workshop. Manakin Workshop DSpace User Group, February Scott Phillips Texas A&M University

Manakin Workshop. Manakin Workshop DSpace User Group, February Scott Phillips Texas A&M University Manakin Workshop Manakin Workshop DSpace User Group, February 2006 Scott Phillips Texas A&M University http://di.tamu.edu/ Outline Part I Concepts Cocoon fundamentals Manakin s Sitemaps Digital Repository

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

Introducing Borland Delphi 8

Introducing Borland Delphi 8 Introducing Borland Delphi 8 for the Microsoft.NET Framework A product overview A Borland White Paper January 2004 Contents Introduction... 3 Windows development today... 4 The Microsoft.NET Framework...

More information

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1 What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1 2010 Active Endpoints Inc. ActiveVOS is a trademark of Active Endpoints, Inc. All other company and product names are the property of their respective

More information

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University Introduction to XML Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University http://gear.kku.ac.th/~krunapon/xmlws 1 Topics p What is XML? p Why XML? p Where does XML

More information

CLASS DISCUSSION AND NOTES

CLASS DISCUSSION AND NOTES CLASS DISCUSSION AND NOTES April 2011 Mon Tue Wed Thu Fri 4 5 6 7 8 AH-8 (individual) Chap. 12 XML 11 12 13 14 15 AH-9 (team) Quiz #2 I. GETTING STARTED COURSE OVERVIEW II. DATABASE DESIGN & IMPLEMENTATION

More information

Agenda. Summary of Previous Session. XML for Java Developers G Session 6 - Main Theme XML Information Processing (Part II)

Agenda. Summary of Previous Session. XML for Java Developers G Session 6 - Main Theme XML Information Processing (Part II) XML for Java Developers G22.3033-002 Session 6 - Main Theme XML Information Processing (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

Extracting and Storing PDF Form Data Into a Repository

Extracting and Storing PDF Form Data Into a Repository Extracting and Storing PDF Form Data Into a Repository This use case describes how to extract required information from a PDF form document to populate database tables. For example, you may have users

More information

Parsing XML documents. DOM, SAX, StAX

Parsing XML documents. DOM, SAX, StAX Parsing XML documents DOM, SAX, StAX XML-parsers XML-parsers are such programs, that are able to read XML documents, and provide access to the contents and structure of the document XML-parsers are controlled

More information

Introduction to XML. XML: basic elements

Introduction to XML. XML: basic elements Introduction to XML XML: basic elements XML Trying to wrap your brain around XML is sort of like trying to put an octopus in a bottle. Every time you think you have it under control, a new tentacle shows

More information

Java J Course Outline

Java J Course Outline JAVA EE - J2SE - CORE JAVA After all having a lot number of programming languages. Why JAVA; yet another language!!! AND NOW WHY ONLY JAVA??? CHAPTER 1: INTRODUCTION What is Java? History Versioning The

More information

National Language Support for Windows NT and AIX Now Available with IBM WebSphere Application Server V3.0.1, Standard Edition

National Language Support for Windows NT and AIX Now Available with IBM WebSphere Application Server V3.0.1, Standard Edition Software Announcement November 16, 1999 National Language Support for Windows NT and AIX Now Available with IBM WebSphere Application Server V3.0.1, Standard Edition Overview WebSphere Application Server

More information

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline Advanced Java Database Programming JDBC overview SQL- Structured Query Language JDBC Programming Concepts Query Execution Scrollable

More information

JBuilder. Borland JBuilder 6 features. Developer productivity. Personal Professional Enterprise

JBuilder. Borland JBuilder 6 features. Developer productivity. Personal Professional Enterprise Developer productivity Support for the latest Java standards Build Java applications, applets, and JavaBeans with no proprietary code or markers True two-way visual IDE with Borland Two-Way-Tools Cross-platform

More information

Introduction to XML 3/14/12. Introduction to XML

Introduction to XML 3/14/12. Introduction to XML Introduction to XML Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University http://gear.kku.ac.th/~krunapon/xmlws 1 Topics p What is XML? p Why XML? p Where does XML

More information

Web-enable a 5250 application with the IBM WebFacing Tool

Web-enable a 5250 application with the IBM WebFacing Tool Web-enable a 5250 application with the IBM WebFacing Tool ii Web-enable a 5250 application with the IBM WebFacing Tool Contents Web-enable a 5250 application using the IBM WebFacing Tool......... 1 Introduction..............1

More information

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX Duration: 5 Days US Price: $2795 UK Price: 1,995 *Prices are subject to VAT CA Price: CDN$3,275 *Prices are subject

More information

XML Master: Professional V2

XML Master: Professional V2 XML I10-002 XML Master: Professional V2 Version: 4.0 QUESTION NO: 1 Which of the following correctly describes the DOM (Level 2) Node interface? A. The Node interface can be used to change the value (nodevalue)

More information

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University Markup Languages SGML, HTML, XML, XHTML CS 431 February 13, 2006 Carl Lagoze Cornell University Problem Richness of text Elements: letters, numbers, symbols, case Structure: words, sentences, paragraphs,

More information

Borland JBuilder 7 Product Certification. Study Guide

Borland JBuilder 7 Product Certification. Study Guide Borland JBuilder 7 Product Certification Study Guide Guía ofrecida por el Grupo Danysoft Primer Borland Learning Partner de España y Portugal Para realizar el examen o cursos oficiales preparatorios contacte

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2411 1 Extensible

More information

ADF Mobile Code Corner

ADF Mobile Code Corner ADF Mobile Code Corner m05. Caching WS queried data local for create, read, update with refresh from DB and offline capabilities Abstract: The current version of ADF Mobile supports three ADF data controls:

More information

extensible Markup Language (XML) Announcements Sara Sprenkle August 1, 2006 August 1, 2006 Assignment 6 due Thursday Project 2 due next Wednesday

extensible Markup Language (XML) Announcements Sara Sprenkle August 1, 2006 August 1, 2006 Assignment 6 due Thursday Project 2 due next Wednesday extensible Markup Language (XML) Sara Sprenkle Announcements Assignment 6 due Thursday Project 2 due next Wednesday Quiz TA Evaluation Sara Sprenkle - CISC370 2 1 Using the Synchronized Keyword Can use

More information

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22

XSLT (part I) Mario Alviano A.Y. 2017/2018. University of Calabria, Italy 1 / 22 1 / 22 XSLT (part I) Mario Alviano University of Calabria, Italy A.Y. 2017/2018 Outline 2 / 22 1 Introduction 2 Templates 3 Attributes 4 Copy of elements 5 Exercises 4 / 22 What is XSLT? XSLT is a (Turing

More information

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started Application Development in JAVA Duration Lecture: Specialization x Hours Core Java (J2SE) & Advance Java (J2EE) Detailed Module Part I: Core Java (J2SE) Getting Started What is Java all about? Features

More information

Author: Irena Holubová Lecturer: Martin Svoboda

Author: Irena Holubová Lecturer: Martin Svoboda NPRG036 XML Technologies Lecture 6 XSLT 9. 4. 2018 Author: Irena Holubová Lecturer: Martin Svoboda http://www.ksi.mff.cuni.cz/~svoboda/courses/172-nprg036/ Lecture Outline XSLT Principles Templates Instructions

More information

JSF Tools Reference Guide. Version: M5

JSF Tools Reference Guide. Version: M5 JSF Tools Reference Guide Version: 3.3.0.M5 1. Introduction... 1 1.1. Key Features of JSF Tools... 1 2. 3. 4. 5. 1.2. Other relevant resources on the topic... 2 JavaServer Faces Support... 3 2.1. Facelets

More information

XML Introduction 1. XML Stands for EXtensible Mark-up Language (XML). 2. SGML Electronic Publishing challenges -1986 3. HTML Web Presentation challenges -1991 4. XML Data Representation challenges -1996

More information

J2EE Interview Questions

J2EE Interview Questions 1) What is J2EE? J2EE Interview Questions J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces

More information

Web Programming Paper Solution (Chapter wise)

Web Programming Paper Solution (Chapter wise) What is valid XML document? Design an XML document for address book If in XML document All tags are properly closed All tags are properly nested They have a single root element XML document forms XML tree

More information

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr.

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr. COSC 304 Introduction to Database Systems XML Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca XML Extensible Markup Language (XML) is a markup language that allows for

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!   We offer free update service for one year PASS4TEST IT Certification Guaranteed, The Easy Way! \ http://www.pass4test.com We offer free update service for one year Exam : I10-002 Title : XML Master: Professional V2 Vendors : XML Master Version

More information

Writing OpenTools plugins to extend Borland JBuilder

Writing OpenTools plugins to extend Borland JBuilder Writing OpenTools plugins to extend Borland JBuilder A step-by-step example of writing a JSP tag wizard for JBuilder A Borland White Paper By Keith Wood July 2004 Contents Introduction... 3 JBuilder OpenTools

More information

XML Extensible Markup Language

XML Extensible Markup Language XML Extensible Markup Language Generic format for structured representation of data. DD1335 (Lecture 9) Basic Internet Programming Spring 2010 1 / 34 XML Extensible Markup Language Generic format for structured

More information

Exam Questions 1Z0-895

Exam Questions 1Z0-895 Exam Questions 1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam https://www.2passeasy.com/dumps/1z0-895/ QUESTION NO: 1 A developer needs to deliver a large-scale

More information

XML. Presented by : Guerreiro João Thanh Truong Cong

XML. Presented by : Guerreiro João Thanh Truong Cong XML Presented by : Guerreiro João Thanh Truong Cong XML : Definitions XML = Extensible Markup Language. Other Markup Language : HTML. XML HTML XML describes a Markup Language. XML is a Meta-Language. Users

More information

Supplement H.1: JBuilder X Tutorial. For Introduction to Java Programming, 5E By Y. Daniel Liang

Supplement H.1: JBuilder X Tutorial. For Introduction to Java Programming, 5E By Y. Daniel Liang Supplement H.1: JBuilder X Tutorial For Introduction to Java Programming, 5E By Y. Daniel Liang This supplement covers the following topics: Getting Started with JBuilder Creating a Project Creating, Compiling,

More information

Migrating from IBM VisualAge to Borland 6 JBuilder

Migrating from IBM VisualAge to Borland 6 JBuilder Migrating from IBM VisualAge to Borland 6 JBuilder by Hartwig Gunzer, Sales Engineer, Borland Table of Contents Preface 1 General differences 2 Migrating GUI applications 2 Migrating applets 8 Migrating

More information

Oracle Enterprise Pack for Eclipse 11g Hands on Labs

Oracle Enterprise Pack for Eclipse 11g Hands on Labs Oracle Enterprise Pack for Eclipse 11g Hands on Labs This certified set of Eclipse plug-ins is designed to help develop, deploy and debug applications for Oracle WebLogic Server. It installs as a plug-in

More information

Supplement II.B(1): JBuilder X Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Supplement II.B(1): JBuilder X Tutorial. For Introduction to Java Programming By Y. Daniel Liang Supplement II.B(1): JBuilder X Tutorial For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Getting Started with JBuilder Creating a Project Creating, Compiling,

More information

I Exam Questions Demo XML Master. Exam Questions I XML Master: Professional V2

I Exam Questions Demo   XML Master. Exam Questions I XML Master: Professional V2 XML Master Exam Questions I10-002 XML Master: Professional V2 Version:Demo 1. Select which of the following correctly describes WSDL. (WSDL 1.1) A. WSDL assumes SOAP as the message transmission form B.

More information

Micro Focus Net Express

Micro Focus Net Express data sheet Micro Focus Net Express Micro Focus Net Express provides a complete environment for quickly building and modernizing COBOL enterprise components and business applications for client/server platforms

More information