The document discusses JDOM, an open source Java library for parsing, manipulating, and outputting XML documents. It provides a straightforward API for working with XML in Java without requiring knowledge of DOM or SAX. JDOM aims to simplify common XML tasks, integrate with existing standards, and stay up to date with evolving XML specifications. It represents an XML document using lightweight Java objects that can be easily traversed, modified, and converted between DOM, SAX, and XML formats.
This document discusses strategies for indexing XML data stored in an Oracle database. It describes the different index types available, including unstructured XML indexes, structured XML indexes, and secondary Oracle Text indexes. It provides examples of creating each type of index and discusses best practices for index design depending on the structure and usage of the XML data. Maintaining and tuning XML indexes over time is also covered.
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerMarco Gralike
The document discusses Oracle XML DB Repository and its features. It describes how the repository is based on XML standards and can store, consume, generate, and validate XML. It also supports resource manipulation using packages and views. Events and extensions are supported through XML configuration files and schemas. Use cases demonstrate how unstructured files can be stored and metadata extracted for additional processing and display.
Hotsos 2013 - Creating Structure in Unstructured DataMarco Gralike
This document discusses creating structure from unstructured XML data and optimizing XML performance in Oracle databases. It provides examples of structuring Wikipedia XML data and indexing it in various ways using XMLType, binary XML, structured and unstructured XML indexes. The key is choosing the right storage and indexing approach depending on the query patterns and data structure. Proper design can significantly outperform default XML handling.
JDBC (Java Database Connectivity) is an API that provides Java programs with the ability to connect to and interact with databases. It allows database-independent access to different database management systems (DBMS) using Java programming language. JDBC drivers are used to connect to databases and come in four types depending on how they interface with the database. The basic steps to use JDBC include registering a driver, connecting to the database, executing SQL statements, handling results, and closing the connection. Scrollable result sets and prepared statements are also introduced as advanced JDBC features.
The document discusses the Document Object Model (DOM) which represents an XML document as a tree structure that can be navigated and modified in memory. It describes how to use the Java API for XML Parsing (JAXP) to parse an XML document into a DOM tree using a DocumentBuilder. The tree can then be traversed and modified by obtaining nodes and examining/changing their properties. An example shows how to represent an XML document as a JTree by recursively building tree nodes from the DOM nodes.
JAXB (Java Architecture for XML Binding) is a Java framework that allows for bi-directional data binding between XML documents and XML data to Java objects. It provides an easier way to work with XML compared to DOM and SAX by mapping XML schema to Java classes and binding XML elements/attributes to class properties. The major steps in the JAXB process are generating Java classes from an XML schema, unmarshalling XML documents into Java objects, processing/modifying the objects, and marshalling the objects back into XML documents.
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
The document discusses the speaker's experience with Oracle XML Database 11g and provides an overview of key topics. It covers that XML is not relational, how to set up and configure the XML database, XML handling and storage options, the protocol server, using the repository, and data handling functions. The speaker aims to discuss encountered issues and provide tips based on their experience with the XML database.
This document summarizes key aspects of XML including:
- XML is a text-based format for describing data structures that is both human and machine readable.
- XML became a W3C standard in 1998 and is commonly used for exchanging data between disparate systems.
- Java can be used to generate, access, format, parse, validate, and transform XML data.
- XML documents have a root element containing other nested elements and attributes to describe hierarchical data.
- Well-formed XML documents follow syntax rules for proper nesting of start/end tags and quotes around attribute values.
- XML parsers like SAX and DOM are used to read XML documents sequentially or build a navigable tree structure in memory
This document discusses strategies for indexing XML data stored in an Oracle database. It describes the different index types available, including unstructured XML indexes, structured XML indexes, and secondary Oracle Text indexes. It provides examples of creating each type of index and discusses best practices for index design depending on the structure and usage of the XML data. Maintaining and tuning XML indexes over time is also covered.
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerMarco Gralike
The document discusses Oracle XML DB Repository and its features. It describes how the repository is based on XML standards and can store, consume, generate, and validate XML. It also supports resource manipulation using packages and views. Events and extensions are supported through XML configuration files and schemas. Use cases demonstrate how unstructured files can be stored and metadata extracted for additional processing and display.
Hotsos 2013 - Creating Structure in Unstructured DataMarco Gralike
This document discusses creating structure from unstructured XML data and optimizing XML performance in Oracle databases. It provides examples of structuring Wikipedia XML data and indexing it in various ways using XMLType, binary XML, structured and unstructured XML indexes. The key is choosing the right storage and indexing approach depending on the query patterns and data structure. Proper design can significantly outperform default XML handling.
JDBC (Java Database Connectivity) is an API that provides Java programs with the ability to connect to and interact with databases. It allows database-independent access to different database management systems (DBMS) using Java programming language. JDBC drivers are used to connect to databases and come in four types depending on how they interface with the database. The basic steps to use JDBC include registering a driver, connecting to the database, executing SQL statements, handling results, and closing the connection. Scrollable result sets and prepared statements are also introduced as advanced JDBC features.
The document discusses the Document Object Model (DOM) which represents an XML document as a tree structure that can be navigated and modified in memory. It describes how to use the Java API for XML Parsing (JAXP) to parse an XML document into a DOM tree using a DocumentBuilder. The tree can then be traversed and modified by obtaining nodes and examining/changing their properties. An example shows how to represent an XML document as a JTree by recursively building tree nodes from the DOM nodes.
JAXB (Java Architecture for XML Binding) is a Java framework that allows for bi-directional data binding between XML documents and XML data to Java objects. It provides an easier way to work with XML compared to DOM and SAX by mapping XML schema to Java classes and binding XML elements/attributes to class properties. The major steps in the JAXB process are generating Java classes from an XML schema, unmarshalling XML documents into Java objects, processing/modifying the objects, and marshalling the objects back into XML documents.
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
The document discusses the speaker's experience with Oracle XML Database 11g and provides an overview of key topics. It covers that XML is not relational, how to set up and configure the XML database, XML handling and storage options, the protocol server, using the repository, and data handling functions. The speaker aims to discuss encountered issues and provide tips based on their experience with the XML database.
This document summarizes key aspects of XML including:
- XML is a text-based format for describing data structures that is both human and machine readable.
- XML became a W3C standard in 1998 and is commonly used for exchanging data between disparate systems.
- Java can be used to generate, access, format, parse, validate, and transform XML data.
- XML documents have a root element containing other nested elements and attributes to describe hierarchical data.
- Well-formed XML documents follow syntax rules for proper nesting of start/end tags and quotes around attribute values.
- XML parsers like SAX and DOM are used to read XML documents sequentially or build a navigable tree structure in memory
DOM and SAX are two APIs for working with XML documents. DOM loads the entire XML document into memory as a tree structure, allowing manipulation of the document. SAX is event-based and reads the XML document sequentially, invoking callback functions at element boundaries. Compared to DOM, SAX uses less memory but only allows reading of the document. Both APIs are supported across many programming languages including PHP.
In this core java training session, you will learn Examples of File IO &
Introduction to JDBC. Topics covered in this session are:
• File IO Continued
• Intro to JDBC (Java Database Connectivity)
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...Marco Gralike
The document provides an overview of Oracle XMLDB building blocks and best practices. It discusses issues with storing XML data in relational databases, including the impedance mismatch between the XML and relational data models. It also highlights worst practices like not optimizing data access and only using a single table to store all XML data. The document recommends using XML schemas to define logical and physical storage structures and leveraging Oracle XMLDB features like binary XML storage, XML indexes, and partitioning.
In this core java training session, you will learn JDBC Cont. Topics covered in this session are:
• JDBC Continued
• Introduction to Java Enterprise Edition (Java EE)
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document provides an overview of DOM and SAX, two common XML APIs in Java. It describes the key differences between DOM and SAX, including that DOM builds an in-memory tree representation, while SAX parses the XML as a stream of events. The document also provides code examples for using SAX to parse XML and extract data, and examples of how to access and manipulate DOM trees after parsing XML.
Session 24 - JDBC, Intro to Enterprise JavaPawanMM
This document provides an overview of JDBC and introduces Java Enterprise Edition. It begins with a continued discussion of JDBC, explaining the purpose of databases and how JDBC drivers connect Java applications to databases. It then demonstrates how to connect to an Oracle database using JDBC and perform basic operations like queries, inserts, updates and deletes. The document concludes by introducing Java EE and noting that hands-on examples will use the HR schema in Oracle.
In this Java Hibernate Training session, you will learn Hibernate. Topics covered in this session are:
• Hibernate
• Advantage of hibernate
• Hibernate Architecture
• Hibernate project
• Hibernate with Annotations
• DAO Design Pattern in Java
For more information, visit this link:
https://www.mindsmapped.com/courses/software-development/learn-hibernate-fundamentals-from-scratch/
In this core java training session, you will learn Java IO – Files, Streams and
Object Serialization. Topics covered in this session are:
• Java IO
• Files
• Streams
• Byte-based
• Character-based
• Object Serialization
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
Hibernate ORM: Tips, Tricks, and Performance TechniquesBrett Meyer
DevNexus 2014
Out-of-the-box, Hibernate ORM offers limited overhead and decent throughput. Early-stage applications enjoy the convenience of ORM/JPA with great performance. However, scaling your application into an enterprise-level system introduces more demanding needs.
This talk will describe numerous tips and techniques to both increase Hibernate ORM performance, as well as decrease overhead. These include some basic tricks, such as mapping and fetching strategies. Entity enhancement instrumentation, third-party second level caching, Hibernate Search, and more complex considerations will also be discussed. The talk will include live demonstrations techniques and their before-and-after results.
This document provides an overview of XPath, an XML query language. It discusses what XPath is, the different types of nodes it can select, and relationship between nodes. It also covers XPath axes that define relationships between nodes, predicates that allow testing nodes, and standard functions like count(), position(), and last(). Examples are provided to demonstrate selecting elements and attributes in an XML document using XPath node tests, axes, predicates and functions. Exercises at the end provide practice with querying XML to retrieve title and price of books, find average textbook price, and return titles of textbooks on XML.
The document outlines several .NET projects that demonstrate various skills. The Framework Project shows skills in C# and .NET concepts through creating class libraries. The Library Phase projects create interfaces for a library management system, starting with a Windows Forms UI, then replacing components with ADO.NET, ASP.NET, and WCF. The final project involves creating a test management application as part of a team.
This document provides an overview of using Hibernate, an object-relational mapping tool, to connect XPages applications to relational databases. It discusses the benefits of using relational databases and Hibernate over the Domino API. The document outlines Hibernate concepts like entities, configuration, querying, and mapping objects to tables. It also provides instructions for downloading and installing Hibernate and adding it to a Domino application. The presenter encourages using proven libraries and tools to make development easier.
This document provides an overview of Java and XML processing using DOM, SAX, and JDOM. It outlines the key components and approaches for each, including parsing XML files into a DOM or SAX event model, traversing nodes and elements, and accessing attributes and content. JDOM is presented as an alternative Java DOM that supports Java collections and provides additional convenience methods for working with XML content.
- XML and HTML are both markup languages but have different purposes
- XML is used to store and transport data, HTML is used to display web pages
- XML focuses on describing data, HTML focuses on both structure and appearance
- XML allows users to define their own elements while HTML uses a fixed set of predefined tags
This talk will briefly review LDAP concepts, cover common uses of LDAP, and present examples of advanced LDAP usage to inspire using LDAP. It will not provide installation or configuration details for specific operating systems. The speaker will link to online slides and get information about the audience's LDAP knowledge and usage.
Brett Meyer gave an overview of Hibernate ORM and JPA. He discussed that ORM maps Java objects to relational databases for persistence beyond the life of a program. JPA is the Java standard for ORM that provides portability, while Hibernate is a full-featured JPA implementation with additional native features. Hibernate allows focusing on business logic rather than data access details and provides performance, concurrency, and extensibility benefits over traditional JDBC usage.
The document discusses HTML (Hypertext Markup Language) and how to design web pages for the World Wide Web. It provides an overview of HTML, describes how to create and publish a web page, and covers main HTML elements including block-level elements like headings, paragraphs, and lists, as well as text-level elements like bold, italics, and font styles. The document also provides examples of using various HTML tags.
This document provides an overview of JAXB (Java Architecture for XML Binding). It discusses the goals, history and evolution of JAXB from versions 1.0 through 2.2. It describes the key aspects of JAXB's architecture including using an XML schema or annotated Java classes to generate the other at compile time, and transforming between XML and Java objects at runtime. It also covers generating Java classes from an XML schema using the code generation tool xjc, and how binding declarations can be used to customize the code generation process.
This document provides an example of using JAXB to unmarshal XML data into Java objects. It includes sample Student and Subject POJO classes annotated for JAXB, JAXB context and unmarshaller code to convert an XML file into a Student object, and output code to demonstrate accessing fields of the unmarshalled Student and associated Subject objects.
DOM and SAX are two APIs for working with XML documents. DOM loads the entire XML document into memory as a tree structure, allowing manipulation of the document. SAX is event-based and reads the XML document sequentially, invoking callback functions at element boundaries. Compared to DOM, SAX uses less memory but only allows reading of the document. Both APIs are supported across many programming languages including PHP.
In this core java training session, you will learn Examples of File IO &
Introduction to JDBC. Topics covered in this session are:
• File IO Continued
• Intro to JDBC (Java Database Connectivity)
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...Marco Gralike
The document provides an overview of Oracle XMLDB building blocks and best practices. It discusses issues with storing XML data in relational databases, including the impedance mismatch between the XML and relational data models. It also highlights worst practices like not optimizing data access and only using a single table to store all XML data. The document recommends using XML schemas to define logical and physical storage structures and leveraging Oracle XMLDB features like binary XML storage, XML indexes, and partitioning.
In this core java training session, you will learn JDBC Cont. Topics covered in this session are:
• JDBC Continued
• Introduction to Java Enterprise Edition (Java EE)
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document provides an overview of DOM and SAX, two common XML APIs in Java. It describes the key differences between DOM and SAX, including that DOM builds an in-memory tree representation, while SAX parses the XML as a stream of events. The document also provides code examples for using SAX to parse XML and extract data, and examples of how to access and manipulate DOM trees after parsing XML.
Session 24 - JDBC, Intro to Enterprise JavaPawanMM
This document provides an overview of JDBC and introduces Java Enterprise Edition. It begins with a continued discussion of JDBC, explaining the purpose of databases and how JDBC drivers connect Java applications to databases. It then demonstrates how to connect to an Oracle database using JDBC and perform basic operations like queries, inserts, updates and deletes. The document concludes by introducing Java EE and noting that hands-on examples will use the HR schema in Oracle.
In this Java Hibernate Training session, you will learn Hibernate. Topics covered in this session are:
• Hibernate
• Advantage of hibernate
• Hibernate Architecture
• Hibernate project
• Hibernate with Annotations
• DAO Design Pattern in Java
For more information, visit this link:
https://www.mindsmapped.com/courses/software-development/learn-hibernate-fundamentals-from-scratch/
In this core java training session, you will learn Java IO – Files, Streams and
Object Serialization. Topics covered in this session are:
• Java IO
• Files
• Streams
• Byte-based
• Character-based
• Object Serialization
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
Hibernate ORM: Tips, Tricks, and Performance TechniquesBrett Meyer
DevNexus 2014
Out-of-the-box, Hibernate ORM offers limited overhead and decent throughput. Early-stage applications enjoy the convenience of ORM/JPA with great performance. However, scaling your application into an enterprise-level system introduces more demanding needs.
This talk will describe numerous tips and techniques to both increase Hibernate ORM performance, as well as decrease overhead. These include some basic tricks, such as mapping and fetching strategies. Entity enhancement instrumentation, third-party second level caching, Hibernate Search, and more complex considerations will also be discussed. The talk will include live demonstrations techniques and their before-and-after results.
This document provides an overview of XPath, an XML query language. It discusses what XPath is, the different types of nodes it can select, and relationship between nodes. It also covers XPath axes that define relationships between nodes, predicates that allow testing nodes, and standard functions like count(), position(), and last(). Examples are provided to demonstrate selecting elements and attributes in an XML document using XPath node tests, axes, predicates and functions. Exercises at the end provide practice with querying XML to retrieve title and price of books, find average textbook price, and return titles of textbooks on XML.
The document outlines several .NET projects that demonstrate various skills. The Framework Project shows skills in C# and .NET concepts through creating class libraries. The Library Phase projects create interfaces for a library management system, starting with a Windows Forms UI, then replacing components with ADO.NET, ASP.NET, and WCF. The final project involves creating a test management application as part of a team.
This document provides an overview of using Hibernate, an object-relational mapping tool, to connect XPages applications to relational databases. It discusses the benefits of using relational databases and Hibernate over the Domino API. The document outlines Hibernate concepts like entities, configuration, querying, and mapping objects to tables. It also provides instructions for downloading and installing Hibernate and adding it to a Domino application. The presenter encourages using proven libraries and tools to make development easier.
This document provides an overview of Java and XML processing using DOM, SAX, and JDOM. It outlines the key components and approaches for each, including parsing XML files into a DOM or SAX event model, traversing nodes and elements, and accessing attributes and content. JDOM is presented as an alternative Java DOM that supports Java collections and provides additional convenience methods for working with XML content.
- XML and HTML are both markup languages but have different purposes
- XML is used to store and transport data, HTML is used to display web pages
- XML focuses on describing data, HTML focuses on both structure and appearance
- XML allows users to define their own elements while HTML uses a fixed set of predefined tags
This talk will briefly review LDAP concepts, cover common uses of LDAP, and present examples of advanced LDAP usage to inspire using LDAP. It will not provide installation or configuration details for specific operating systems. The speaker will link to online slides and get information about the audience's LDAP knowledge and usage.
Brett Meyer gave an overview of Hibernate ORM and JPA. He discussed that ORM maps Java objects to relational databases for persistence beyond the life of a program. JPA is the Java standard for ORM that provides portability, while Hibernate is a full-featured JPA implementation with additional native features. Hibernate allows focusing on business logic rather than data access details and provides performance, concurrency, and extensibility benefits over traditional JDBC usage.
The document discusses HTML (Hypertext Markup Language) and how to design web pages for the World Wide Web. It provides an overview of HTML, describes how to create and publish a web page, and covers main HTML elements including block-level elements like headings, paragraphs, and lists, as well as text-level elements like bold, italics, and font styles. The document also provides examples of using various HTML tags.
This document provides an overview of JAXB (Java Architecture for XML Binding). It discusses the goals, history and evolution of JAXB from versions 1.0 through 2.2. It describes the key aspects of JAXB's architecture including using an XML schema or annotated Java classes to generate the other at compile time, and transforming between XML and Java objects at runtime. It also covers generating Java classes from an XML schema using the code generation tool xjc, and how binding declarations can be used to customize the code generation process.
This document provides an example of using JAXB to unmarshal XML data into Java objects. It includes sample Student and Subject POJO classes annotated for JAXB, JAXB context and unmarshaller code to convert an XML file into a Student object, and output code to demonstrate accessing fields of the unmarshalled Student and associated Subject objects.
1) The document describes an Eclipse-based IDE tool chain provided by OpenWMS.org for registered developers that includes pre-configured plugins and settings to provide a common development environment.
2) It discusses how the IDE installer is built using the IzPack graphical installer generator and Maven to create platform-specific installers, and how it customizes the Eclipse workspace during installation.
3) The tool chain is meant to provide developers a standardized IDE setup along with quality assurance checks and code templates integrated directly into the workspace.
This document discusses JSR-303, which specifies a common validation concept for JavaBeans. It defines constraints that can be used to validate objects in all layers of an application. Some key points covered include defining constraints using annotations, validating objects against those constraints, and integrating validation into Java EE and JSF. The JSR-303 API provides a standardized way to define and validate constraints across frameworks and layers.
A brief overview on Apache Maven2. About the lifecycle, core concepts and how to setup a project. Presented with demos about Eclipse integration and reporting customization.
هذه المحاضرة ألقيت في جامعة الإمام بن سعود في كلية علوم الحاسب في نوفمبر 2011. شرحت فيها عن خدمات الويب و ما يتطلب معرفته لبناء تطبيقات ويب حديثة web 2.0.
The document discusses the XML Document Object Model (DOM). It introduces DOM as a W3C standard that builds a tree structure in memory to represent XML documents. The DOM provides an API for dynamically accessing and manipulating this tree. Key points covered include the node tree structure of a DOM document, common DOM classes and interfaces like Document and Node, and methods for traversing and modifying the DOM tree such as getElementsByTagName and setAttribute. The document includes an example of using the MSXML DOM parser to load an XML file and retrieve/display elements, attributes, and text values.
This document summarizes XML parsing techniques including DOM, SAX, and Microsoft XML DOM objects. DOM builds a hierarchical model of the XML document as a tree structure in memory. SAX is event-based and parses the document sequentially, triggering events. Microsoft XML DOM provides classes that map to the W3C DOM standard for manipulating XML documents. The document compares DOM and SAX, describing their advantages and disadvantages. It also outlines common DOM objects and their properties and methods for traversing and manipulating the XML document tree.
This document provides an overview of parsing XML using SAX (Simple API for XML). It describes what SAX is, how it works by sending events to registered handlers, and compares it to DOM. SAX is an event-based API that parses XML documents sequentially by notifying applications of elements and data, while DOM loads the entire document into memory at once. SAX is simpler and uses less memory than DOM, making it better for processing large documents or on resource-constrained devices.
It tells about how dom really used in javascript & html.And it tells about its levels and its w3c standards. And some Dom example programs with source code and screenshots.
The Document Object Model (DOM) is a standard for representing and interacting with objects in HTML, XML and SVG documents. It defines the logical structure of documents and the way a document is accessed and manipulated. The DOM represents the document as nodes and objects, which can be manipulated programmatically by JavaScript to change the document structure, style and content. It allows dynamic access to and manipulation of page content that is useful for building interactive web applications. The DOM specification is developed by the W3C and provides a platform- and language-neutral interface that can be used across different web technologies.
This document provides an overview of AJAX (Asynchronous JavaScript and XML) including what it is, how it works, and the technologies involved. It discusses using the XMLHttpRequest object to asynchronously exchange data with a server in the background without refreshing the page. It also covers the data formats of XML and JSON that can be used to transfer data, including their syntax, structure, and best practices.
The Java DOM Parser allows programs to access and update the structure and contents of XML documents. It represents an XML document as a tree of Node objects. When parsing an XML file with a DOM parser, it returns a Document object representing the entire file as a tree structure. This tree can then be traversed and manipulated using common DOM interfaces and methods to extract information from the XML document.
This document discusses XML processing and provides examples of XML code. It defines XML as an extensible markup language that is a standard for describing data. It explains that XML documents must be well-formed according to XML rules and may also be valid if they conform to a document type definition (DTD) or schema. The document outlines two common approaches for parsing XML documents - DOM and SAX. It also introduces JDom, a Java library that simplifies working with XML documents using either DOM or SAX parsing.
JDOM is an open source Java library that makes working with XML data easier. It provides a simpler programming model compared to DOM and SAX. JDOM was created to be straightforward for Java programmers and hide some of the complexities of XML. It allows for easy creation, modification and output of XML documents and elements in Java code.
The document discusses two common XML parsers - DOM and SAX. DOM builds an in-memory tree representation of the entire XML document, allowing random access. SAX is event-based and parses the document sequentially, notifying the application of elements and attributes through callback methods. DOM is used when random access or rearranging elements is needed, while SAX is better for large documents or streaming data. Common DOM and SAX methods are also outlined.
This document discusses parsing XML documents with DOM (Document Object Model) Level 2 in Java. It provides an example that represents an XML document as a JTree GUI component by parsing the XML with DOM, building corresponding nodes in the JTree, and recursively adding child nodes. The example allows selecting an XML file, parses it with DOM, and displays the hierarchical structure in the JTree, allowing expansion of nodes.
This document discusses parsing XML documents with DOM (Document Object Model) Level 2 in Java. It provides an example that represents an XML document as a JTree GUI component by parsing the XML with DOM, building corresponding nodes in the JTree, and recursively adding child nodes. The example allows selecting an XML file, parses it with DOM, and displays the hierarchical structure in a JTree that can be expanded and collapsed.
JAXB (Java Architecture for XML Binding) defines an API for reading and writing Java objects to and from XML documents. It uses annotations to map XML elements and attributes to Java objects. This allows Java objects to be automatically marshalled to XML and XML to be unmarshalled to Java objects without needing to understand XML parsing techniques. JAXB comes bundled with the JDK so there are no extra dependencies. It provides a simpler model than DOM or SAX for working with XML in Java applications.
This document provides an introduction to XML, including an overview of its components and structure. It discusses the XML prolog, tags, attributes, entities, comments, and processing instructions that make up an XML document. It also describes the XML document type definition (DTD) that defines the allowable tags and syntax of an XML language. Key points covered include XML being extensible and separating content from presentation, as well as examples of basic XML code structure and syntax rules.
This tutorial describes using recursive XSLT calls and JavaScript to display an expanding and collapsing tree view of an XML purchase order document. Key aspects covered include using recursion in the XSLT stylesheet to process the XML data hierarchically, invoking JavaScript from XSLT to make the display interactive, and generating HTML output with calls to the JavaScript functions. The code sample demonstrates techniques for parsing XML data recursively and creating an interactive user interface using XSLT and JavaScript.
This tutorial describes using recursive XSLT calls and JavaScript to display an expanding and collapsing tree view of an XML purchase order document. Key aspects covered include using recursion in the XSLT stylesheet to process the XML data hierarchically, invoking JavaScript from XSLT to make the display interactive, and generating HTML output with calls to the JavaScript functions. The code sample demonstrates techniques for parsing XML data recursively and creating an interactive user interface using XSLT and JavaScript.
The document discusses different XML parsers in Java including DOM, SAX, and StAX. DOM represents the XML document as an in-memory tree which allows flexible processing but uses more memory. SAX is event-driven and reads the XML sequentially using less memory. StAX is similar to SAX but simplified and "pull"-based where the developer manually navigates elements. The document also covers using JAXP for XML processing independence and the key classes involved in DOM and StAX parsing.
The document discusses the XML DOM (Document Object Model). It defines the DOM as a standard for accessing and manipulating XML documents through a tree structure representation. The DOM defines all elements in an XML document as nodes that can be traversed and modified. It outlines DOM properties and methods for navigating and manipulating the node tree. Advantages of the DOM include its traversable and modifiable tree structure, while disadvantages include higher resource usage compared to SAX parsing.
This document discusses XML (eXtensible Markup Language). It defines XML, outlines its advantages over HTML and other data formats. These include being human-readable, industry supported, and allowing validation of data. The document also compares XML to HTML, describes XML technologies like DTDs, schemas, CSS, and XSLT. It explains how to parse and structure XML documents and the role of XML parsers.
This document provides an overview of XML, XML schema, parsing XML, and GladeXML. It defines XML and its components like elements and attributes. It describes XML schema and provides a simple example. It explains how to parse an XML document into a DOM object and access elements. It also gives an overview of how GladeXML can dynamically load user interfaces from XML descriptions.
Similar to Jdom how it works & how it opened the java process (20)
Blockchain for business. Interview-based article - October 2019. Polytechnic ...Hicham QAISSI
Blockchain is a new type of distributed database that stores data in a way that provides security, immutability, and trust. It works by recording transactions in groups called blocks that are linked together in a chain, with each new block building on the previous ones. For a system to be considered a blockchain, it must meet five key principles - it must be distributed, public, persistent, timestamped, and immutable. Blockchain has the potential to benefit businesses by enabling trust without intermediaries, providing secure transactions, increasing transaction speeds, and enabling transparency.
International Business Isbn-9780273766957 - Points-counterpointsHicham QAISSI
This document discusses several points related to offshoring and international business strategies. It begins by explaining some of the reasons why manufacturers offshore production, such as tax benefits and lower costs in other countries. It then discusses both benefits and drawbacks of offshoring for different industries. The document considers political risk management strategies and whether nations should use strategic trade policies. Overall, it presents perspectives on a range of international business issues without clearly taking a stance, instead outlining arguments on both sides of issues related to offshoring, trade, and risk management.
1) El documento describe las tecnologías XML, incluyendo DTD, esquemas XML, parsing con SAX y DOM, y usos comunes de XML como sitios web y servicios web.
2) XML permite etiquetar datos con su significado para estructurar información de manera que pueda ser procesada automáticamente.
3) Para que un documento XML sea válido, debe declarar el DTD o esquema XML al que se valida y seguir las reglas de dicha gramática.
This document discusses three different approaches to parsing XML documents: SAX, DOM, and JDOM. SAX is an event-based parser that works by invoking methods as it reads the XML document and encounters different components. DOM parses the entire XML document into a tree structure that can be manipulated in memory. JDOM is a Java library that provides an API for parsing XML into Java objects similar to DOM. The document then provides code examples demonstrating how to use each of these XML parsing approaches to search for a book by ISBN in a sample XML book catalog.
This document provides a summary of the JSTL (JSP Standard Tag Library) quick reference. It includes tags for control flow, core functionality, formatting, internationalization, and more. Some key tags include:
- <c:forEach> - Loops over a collection or array
- <c:if> - Conditional processing based on an expression
- <fmt:message> - Retrieves localized messages from a resource bundle
- <fmt:formatDate> - Formats dates based on the locale
- <fmt:setBundle> - Sets the localization context
This document discusses mobile social networks from a business perspective. It covers advantages and impediments of mobile social networks compared to traditional social media platforms. It also discusses the future of mobile social networks, including how the development of 4G networks may help propel the growth of mobile social networks. Key topics covered include the movement of internet companies and mobile operators into mobile social networking, competition and alliances between operators and social media companies, and statistics related to user demographics and behaviors on social networks.
Este documento presenta SPARQL, el lenguaje de consulta para grafos RDF. Introduce SPARQL, describiendo su objetivo de recuperar información de bases de datos RDF de la Web Semántica de forma similar a como SQL lo hace para bases de datos relacionales. Explica la sintaxis básica de SPARQL, incluyendo cláusulas como SELECT, DESCRIBE, ASK y PREFIX, y resume los diferentes componentes de las especificaciones de SPARQL.
Este documento proporciona un tutorial sobre los Servlets en J2EE. Explica qué son los Servlets y sus ventajas, la API Servlet, su estructura y funcionamiento interno. Luego cubre la implementación de un Servlet, incluidos los modelos de implementación, la clase HttpServlet y el ciclo de vida de un Servlet que incluye la inicialización, procesamiento de peticiones y destrucción. También explica cómo configurar un Servlet, el contexto de aplicación, el procesamiento de peticiones y respuestas, y mantener el estado
3. What is JDOM?
• JDOM is a way to represent an XML document for
easy and efficient reading, manipulation, and writing
– Straightforward API
– Lightweight and fast
– Java-optimized
• Despite the name similarity, it's not build on DOM or
modeled after DOM
– Although it integrates well with DOM and SAX
• An open source project with an Apache-style license
– 1200 developers on jdom-interest (high traffic)
– 1050 lurkers on jdom-announce (low traffic)
4. The JDOM Philosophy
• JDOM should be straightforward for Java programmers
– Use the power of the language (Java 2)
– Take advantage of method overloading, the
Collections APIs, reflection, weak references
– Provide conveniences like type conversions
• JDOM should hide the complexities of XML wherever
possible
– An Element has content, not a child Text node with
content
– Exceptions should contain useful error messages
– Give line numbers and specifics, use no SAX or
DOM specifics
5. More JDOM Philosophy
• JDOM should integrate with DOM and SAX
– Support reading and writing DOM documents and
SAX events
– Support runtime plug-in of any DOM or SAX parser
– Easy conversion from DOM/SAX to JDOM
– Easy conversion from JDOM to DOM/SAX
• JDOM should stay current with the latest XML
standards
– DOM Level 2, SAX 2.0, XML Schema
• JDOM does not need to solve every problem
– It should solve 80% of the problems with 20% of
the effort
– We think we got the ratios to 90% / 10%
6. Scratching an Itch
• JAXP wasn’t around
– Needed parser independence in DOM and SAX
– Had user base using variety of parsers
– Now integrates with JAXP 1.1
– Expected to be part of JAXP version.next
• Why not use DOM:
– Same API on multiple languages, defined using
IDL
– Foreign to the Java environment, Java programmer
– Fairly heavyweight in memory
• Why not use SAX:
– No document modification, random access, or
output
– Fairly steep learning curve to use correctly
8. Package Structure
• JDOM consists of five packages
org.jdom
org.jdom.adapters
org.jdom.input
org.jdom.output
org.jdom.transform
9. The org.jdom Package
• These classes represent an XML document and XML
constructs:
– Attribute
– CDATA
– Comment
– DocType
– Document
– Element
– EntityRef
– Namespace
– ProcessingInstruction
– (PartialList)
– (Verifier)
– (Assorted Exceptions)
10. The org.jdom.input Package
• Classes for reading XML from existing sources:
– DOMBuilder
– SAXBuilder
• Also, outside contributions in jdom-contrib:
– ResultSetBuilder
– SpitfireBuilder
• New support for JAXP-based input
– Allows consistency across applications
– Builders pick up JAXP information and user
automatically
– Sets stage for JAXP version.next
11. The org.jdom.output Package
• Classes for writing XML to various forms of output:
– DOMOutputter
– SAXOutputter
– XMLOutputter
• Also, outside contributions in jdom-contrib:
– JTreeOutputter
12. org.jdom.transform
• TRaX is now supported in org.jdom.transform
– Supports XSLT transformations
– Defines Source and Result interfaces
– JDOMSource
– JDOMResult
13. General Program Flow
• Normally XML Document -> SAXBuilder ->
XMLOutputter
XML Document
Direct Build
XMLOutputter
SAXBuilder
JDOM Document SAXOutputter
DOMBuilder
DOMOutputter
DOM Node(s)
14. The Document class
• Documents are represented by the
org.jdom.Document class
– A lightweight object holding a DocType,
ProcessingInstructions, a root Element,
and Comments
• It can be constructed from scratch:
Document doc = new Document(
new Element("rootElement"))
• Or it can be constructed from a file, stream, or URL:
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(url);
15. JDOM vs DOM
• Here's two ways to create a simple new document:
Document doc = new Document(
new Element("rootElement")
.setText("This is a root element"));
Document myDocument =
new org.apache.xerces.dom.DocumentImpl();
// Create the root node and its text node,
// using the document as a factory
Element root =
myDocument.createElement("myRootElement");
Text text =
myDocument.createText(
"This is a root element");
// Put the nodes into the document tree
root.appendChild(text);
myDocument.appendChild(root);
16. The Build Process
• A Document can be constructed using any build tool
– The SAX build tool uses a SAX parser to create a
JDOM document
• Current builders are SAXBuilder and DOMBuilder
– org.jdom.input.SAXBuilder is fast and
recommended
– org.jdom.input.DOMBuilder is useful for
reading an existing DOM tree
– A builder can be written that lazily constructs the
Document as needed
– Other contributed builder: ResultSetBuilder
17. Builder Classes
• Builders have optional parameters to specify
implementation classes and whether document
validation should occur.
SAXBuilder(String parserClass, boolean validate);
DOMBuilder(String adapterClass, boolean validate);
• Not all DOM parsers have the same API
– Xerces, XML4J, Project X, Oracle
– The DOMBuilder adapterClass implements
org.jdom.adapters.DOMAdapter
– Implements standard methods by passing through
to an underlying parser
– Adapters for all popular parsers are provided
– Future parsers require just a small adapter class
• Once built, documents are not tied to their build tool
18. The Output Process
• A Document can be written using any output tool
– org.jdom.output.XMLOutputter tool writes
the document as XML
– org.jdom.output.SAXOutputter tool
generates SAX events
– org.jdom.output.DOMOutputter tool creates
a DOM document
– Any custom output tool can be used
• To output a Document as XML:
XMLOutputter outputter = new XMLOutputter();
outputter.output(doc, System.out);
• For pretty-output, pass optional parameters
– Two-space indent, add new lines
outputter = new XMLOutputter(" ", true);
outputter.output(doc, System.out);
19. In-and-Out
import java.io.*; import org.jdom.*;
import org.jdom.input.*; import org.jdom.output.*;
public class InAndOut {
public static void main(String[] args) {
// Assume filename argument
String filename = args[0];
try {
// Build w/ SAX and JAXP, no validation
SAXBuilder b = new SAXBuilder();
// Create the document
Document doc = b.build(new File(filename));
// Output as XML to screen
XMLOutputter outputter = new XMLOutputter();
outputter.output(doc, System.out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
21. The DocType class
• A Document may have a DocType
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
• This specifies the DTD of the document
– It's easy to read and write
DocType docType = doc.getDocType();
System.out.println("Element: " +
docType.getElementName());
System.out.println("Public ID: " +
docType.getPublicID());
System.out.println("System ID: " +
docType.getSystemID());
doc.setDocType(
new DocType("html", "-//W3C...", "http://..."));
22. The Element class
• A Document has a root Element:
<web-app id="demo">
<description>
Gotta fit servlets in somewhere!
</description>
<distributable/>
</web-app>
• Get the root as an Element object:
Element webapp = doc.getRootElement();
• An Element represents something like <web-app>
– Has access to everything from the open
<web-app> to the closing </web-app>
23. Playing with Children
• An element may contain child elements
// Get a List of direct children as Elements
List allChildren = element.getChildren();
out.println("First kid: " +
((Element)allChildren.get(0)).getName());
// Get all direct children with a given name
List namedChildren = element.getChildren("name");
// Get the first kid with a given name
Element kid = element.getChild("name");
// Namespaces are supported as we'll see later
• getChild() may return null if no child exists
• getChildren() returns an empty list if no children
exist
24. Playing with Grandchildren
<linux-config>
<gui>
<window-manager>
<name>Enlightenment</name>
<version>0.16.2</version>
</window-manager>
<!-- etc -->
</gui>
</linux-config>
• Grandkids can be retrieved easily:
String manager =
root.getChild("gui")
.getChild("window-manager")
.getChild("name")
.getTextTrim();
• Just watch out for a NullPointerException!
25. Managing the Population
• Children can be added and removed through List
manipulation or convenience methods:
List allChildren = element.getChildren();
// Remove the fourth child
allChildren.remove(3);
// Remove all children named "jack"
allChildren.removeAll(
element.getChildren("jack"));
element.removeChildren("jack");
// Add a new child
allChildren.add(new Element("jane"));
element.addContent(new Element("jane"));
// Add a new child in the second position
allChildren.add(1, new Element("second"));
26. JDOM vs DOM
• Moving elements is easy in JDOM but tricky in DOM
Element movable =
new Element("movableRootElement");
parent1.addContent(movable); // place
parent1.removeContent(movable); // remove
parent2.addContent(movable); // add
Element movable =
doc1.createElement("movable");
parent1.appendChild(movable); // place
parent1.removeChild(movable); // remove
parent2.appendChild(movable); // add
// This causes an error! Incorrect document!
• You need to call importNode() when moving
between different documents
• There's also an elt.detach() option
27. Making Kids
• Elements are constructed directly, no factory method
needed
Element element = new Element("kid");
• Some prefer a nesting shortcut, possible since
addContent() returns the Element on which the
child was added:
Document doc = new Document(
new Element("family")
.addContent(new Element("mom"))
.addContent(new Element("dad")
.addContent("kidOfDad")));
• A subclass of Element can be made, already
containing child elements
root.addContent(new FooterElement());
28. Ensuring Well-Formedness
• The Element constructor (and all other object
constructors) check to make sure the element is legal
– i.e. the name doesn't contain inappropriate
characters
• The add and remove methods also check document
structure
– An element may only exist at one point in the tree
– Only one value can be returned by getParent()
– No loops in the graph are allowed
– Exactly one root element must exist
29. Making the <linux-config>
• This code constructs the <linux-config> seen
previously:
Document doc = new Document(
new Element("linux-config")
.addContent(new Element("gui")
.addContent(new Element("window-manager")
.addContent(new Element("name")
.setText("Enlightenment"))
.addContent(new Element("version")
.setText("0.16.2"))
)
);
30. Getting Element Attributes
• Elements often contain attributes:
<table width="100%" border="0"> </table>
• Attributes can be retrieved several ways:
String value =
table.getAttributeValue("width");
// Get "border" as an int
try {
value =
table.getAttribute("border").getIntValue();
}
catch (DataConversionException e) { }
// Passing default values was removed
// Good idea or not?
• getAttribute() may return null if no such attribute exists
31. Setting Element Attributes
• Element attributes can easily be added or removed
// Add an attribute
table.addAttribute("vspace", "0");
// Add an attribute more formally
table.addAttribute(
new Attribute("name", "value"))
// Remove an attribute
table.removeAttribute("border");
// Remove all attributes
table.getAttributes().clear();
32. Reading Element Content
• Elements can contain text content:
<description>A cool demo</description>
• The text content is directly available:
String content = element.getText();
• Whitespace must be preserved but often isn't needed,
so we have a shortcut for removing extra whitespace:
// Remove surrounding whitespace
// Trim internal whitespace to one space
element.getTextNormalize();
33. Writing Element Content
• Element text can easily be changed:
// This blows away all current content
element.setText("A new description");
• Special characters are interpreted correctly:
element.setText("<xml> content");
• But you can also create CDATA:
element.addContent(
new CDATA("<xml> content"));
• CDATA reads the same as normal, but outputs as
CDATA.
35. Mixed Content
• Sometimes an element may contain comments, text
content, and children
<table>
<!-- Some comment -->
Some text
<tr>Some child</tr>
</table>
• Text and children can be retrieved as always:
String text = table.getTextTrim();
Element tr = table.getChild("tr");
• This keeps the standard uses simple
36. Reading Mixed Content
• To get all content within an Element, use
getMixedContent()
– Returns a List containing Comment, String,
ProcessingInstruction, CDATA, and
Element objects
List mixedContent = table.getMixedContent();
Iterator i = mixedContent.iterator();
while (i.hasNext()) {
Object o = i.next();
if (o instanceof Comment) {
// Comment has a toString()
out.println("Comment: " + o);
}
else if (o instanceof String) {
out.println("String: " + o);
}
else if (o instanceof Element) {
out.println("Element: " +
((Element)o).getName());
}
// etc
}
37. Manipulating Mixed Content
• The list of mixed content provides direct control over all
the element's content.
List mixedContent = table.getMixedContent();
// Add a comment at the beginning
mixedContent.add(
0, new Comment("Another comment"))
// Remove the comment
mixedContent.remove(0);
// Remove everything
mixedContent.clear();
38. XML Namespaces
• Namespaces are a DOM Level 2 addition
• Namespaces allow elements with the same local name
to be treated differently
– It works similarly to Java packages and helps avoid
name collisions.
• Namespaces are used in XML like this:
<html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<!-- ... -->
<xhtml:title>Home Page</xhtml:title>
</html>
39. JDOM Namespaces
• Namespace prefix to URI mappings are held statically
in the Namespace class
• They're declared in JDOM like this:
Namespace xhtml = Namespace.getNamespace(
"xhtml", "http://www.w3.org/1999/xhtml");
• They're passed as optional parameters to most
element and attribute manipulation methods:
List kids = element.getChildren("p", xhtml);
Element kid = element.getChild("title", xhtml);
Attribute height = element.getAttribute(
"height", xhtml);
40. List Details
• The current implementation uses ArrayList for
speed
– Will be migrating to a FilterList
– Note that viewing a subset slows the relatively rare
index-based access
• List objects are mutable
– Modifications affect the backing document
– Other existing list views do not currently see the
change, but will with FilterList
• Because of its use of collections, JDOM requires JDK
1.2+ support, or JDK 1.1 with collections.jar
41. Current Status
• Currently JDOM is at Beta 7
• Pending work:
– Preserve internal DTD subsets
– Polish the high-end features of the outputter
– Discussion about Namespace re-factoring
– Some well-formedness checking work to be done
– Formal specification
• Speed and memory optimizations yet to be done!
42. Extending JDOM
• Some possible extensions to JDOM:
– XPath (already quite far along, and usable)
– XLink/XPointer (follows XPath)
– XSLT (natively, now uses Xalan)
– In-memory validation
44. News!
• In late February, JDOM was accepted by the Java
Community Process (JCP) as a Java Specification
Request (JSR-102)
• Sun's comment with their YES vote:
– In general we tend to prefer to avoid adding new
APIs to the Java platform which replicate the
functionality of existing APIs. However JDOM does
appear to be significantly easier to use than the
earlier APIs, so we believe it will be a useful
addition to the platform.
45. What It Means
• What exactly does this mean?
– Facilitates JDOM's corporate adoption
– Opens the door for JDOM to be incorporated into
the core Java Platform
– JDOM will still be released as open source
software
– Technical discussion will continue to take place on
public mailing lists
• For more information:
– http://java.sun.com/aboutJava/communityprocess/
jsr/jsr_102_jdom.html
46. The People
• Jason Hunter is the "Specification Lead"
• The initial "Expert Group" (in order of acceptance):
– Brett McLaughlin (individual, from Lutris)
– Jools Enticknap (individual, software consultant)
– James Davidson (individual, from Sun
Microsystems and an Apache member)
– Joe Bowbeer (individual, from 360.com)
– Philip Nelson (individual, from Omni Resources)
– Sun Microsystems (Rajiv Mordani)
– CAPS (Bob McWhirter)
• Many other individuals and corporations have
responded to the call for experts, none are yet official
47. Living in the JCP
• The JCP follows a benevolent dictator model
– Strong spec lead making decisions based on input
– Leaders may be deposed by a 2/3 vote of experts
– But the replacement is from the same company!
– What happens if you depose an individual?
• Open source RIs and TCKs are legit
– Although the PMO is still learning about this
– See JSR-053 (Servlets/JSPs), JSR-052 (Taglibs)
– See JSR-080 (USB) which hit resistance
• Open source independent implementations?
– Not technically allowed!!
– Must enforce compatibility requirements, which
violates open source; must pass costly TCK
– Working as Apache rep on these issues
48. A Public Expert Group?
• Unlike all other JSRs, JDOM discussion is public
– We see no reason to work behind NDAs
– On design issues the list keeps us in touch with
people's needs, and people often step up to solve
issues (i.e. long term serialization)
– We use [eg] in the subject line for EG topics
• Unlike most other JSRs, the JDOM implementation
leads the JDOM specification
– Words on paper don't show all the issues
– Witness JSR-047 (Logging)
• What's the role of an expert?
– Similar to that of an Apache Member
– Long-term commitment to help as needed
49. You Too Can Get Involved!
• Download the software
– http://jdom.org
• Read the docs
– http://jdom.org
• Sign up for the mailing lists (see jdom.org)
– jdom-announce
– jdom-interest
• Java and XML, by Brett McLaughlin
– http://www.oreilly.com/catalog/javaxml
• Help improve the software!