Overview of the XML Samples application
The XML Samples application is written to be used with the XML specifications and other documents. However, the most important function that these samples provide is a place to begin experimenting with the XML API and the supported specifications.
Limitations
The XML Samples application is not intended for deployment to production servers. It is for development and educational purposes only. All source code is provided as is for you to use, copy, and modify without royalty payment when you develop applications that run with WebSphere software. Use the sample code either for our own internal use, for redistribution as part of an application, or in the products.
Content
- The simple API invocation examples included in the samples are intended as simple examples of using the major new features of XPath 2.0, XSLT 2.0, and XQuery 1.0.
- XPath 2.0 examples
- Sample 1: Simple XPath invocation
Shows how to invoke XPath
- Sample 2: Invoking XPath 1.0 under an XPath 2.0 run time in backwards compatibility mode
Shows an example that demonstrates differences between XPath 1.0 and XPath 2.0 as well as how to run existing XPath 1.0 statements under XPath 2.0 in backwards-compatibility mode
- Sample 3: Invoking schema aware XPath 2.0 expressions
Shows how to run schema-aware expressions; shows how to load schema documents, how to validate input documents, and how to declare namespace prefixes
- Sample 4: XPath 2.0 - document function (relative URIs) with input and output documents
Shows how to invoke XPath using the document function with relative URIs
- Sample 5: XPath running in compiled mode
Shows how to invoke XPath in compiled mode
- Sample 6: XPath running in pre-compiled mode
Shows how to invoke XPath in pre-compiled mode
- Sample 7: XPath 2.0 collation support
Shows how to invoke XPath with collation support
- XSLT 2.0 examples
- Sample 1: Simple XSLT invocation
Shows how to invoke XSLT
- Sample 2: Invoking XSLT 1.0 under an XSLT 2.0 run time in backwards compatibility mode
Shows differences between XPath 1.0 and XPath 2.0 and how to run existing XSLT 1.0 stylesheets under a XSLT 2.0 processor in backwards-compatibility mode
- Sample 3: XSLT 2.0 updated for-each support
Shows how to use the XSLT 2.0 for-each functionality
- Sample 4: XSLT 2.0 grouping support
Shows how to use the capability offered by xsl:for-each-group
- Sample 5: XSLT 2.0 regular expression support
Shows how to use XSLT 2.0 regular-expression support to work with data in structured legacy formats within XML strings
- Sample 6: XSLT 2.0 date formatting
Shows how to use XSLT 2.0 date formatting with internationalization
- Sample 7: XSLT 2.0 multiple results
Shows how to use an XSLT 2.0 result-document instruction to write to multiple outputs simultaneously
- Sample 8: XSLT 2.0 tunnel parameters
Shows how to use XSLT 2.0 tunnel parameters to allow values to be set and accessible during stylesheet processing
- Sample 9: XSLT 2.0 stylesheet functions
Shows how to use the XSLT 2.0 stylesheet functions
- Sample 10: XSLT 2.0 initial template
Shows how to use the XSLT 2.0 initial-template functionality
- Sample 11: XSLT 2.0 template with multiple modes
Shows how to use the XSLT 2.0 template with multiple modes functionality
- Sample 12: XSLT 2.0 XHTML support - no output method specified
Shows how to use XSLT 2.0 XHTML support with the XHTML output method
- Sample 13: XSLT 2.0 XHTML support - output method specified
Shows how to use XSLT 2.0 XHTML support with the XHTML output method
- Sample 14: XSLT 2.0 character maps
Shows how to use XSLT 2.0 character maps functionality
- Sample 15: XSLT 2.0 "as" attribute
Shows how to use the XSLT 2.0 "as" attribute functionality
- Sample 16: XSLT 2.0 embedded stylesheets
Shows how to use the XSLT 2.0 embedded stylesheets functionality
- Sample 17: XSLT 2.0 running in compiled mode
Shows how to run XSLT in compiled mode
- Sample 18: XSLT 2.0 running in pre-compiled mode
Shows how to run XSLT in pre-compiled mode
- Sample 19: XSLT 2.0 undeclare-prefixes serialization parameter
Shows how to use the XSLT undeclare-prefix parameter when producing XML output that is Version 1.1 or higher
- Sample 20: XSLT 2.0 next-match
Shows how to use the XSLT next-match functionality
- Sample 21: XSLT 2.0 usage of XPath 2.0 collection function
Shows how to use the collection function
- Sample 22: XSLT 2.0 schema awareness - input validation (valid)
Shows how to use the stylesheets and schemas to validate input documents
- Sample 23: XSLT 2.0 schema awareness - input validation (invalid)
Shows how to use the stylesheets and schemas to validate input documents
- Sample 24: XSLT 2.0 schema awareness - temporary tree (valid)
Shows how to use the validation attribute to validate temporary trees
- Sample 25: XSLT 2.0 schema awareness - temporary tree (invalid)
Shows how to use the validation attribute to validate temporary trees
- Sample 26: XSLT 2.0 schema awareness - output document (valid)
Shows how to use the validation attribute to validate the main output document
- Sample 27: XSLT 2.0 schema awareness - output document (invalid)
Shows how to use the validation attribute to validate the main output document
- Sample 28: XSLT 2.0 schema awareness - element(*, T) function
Shows how to use the stylesheets and schemas to match on element types instead of names
- Sample 29: XSLT 2.0 use-when
Shows how to use the use-when functionality
- Sample 30: XSLT 2.0 collation support
Shows how to use the for-each-group functionality with collations
- Sample 31: Using stylesheet-declared external functions
Shows how to declare external functions within a stylesheet
- XQuery 1.0 examples
- Sample 1: Simple XQuery invocation
Shows how to invoke simple XQuery FLOWR expressions
- Sample 2: XQuery FLWOR support - using doc function and cross document joins
Shows how to invoke an XQuery that joins data from multiple documents
- Sample 3: XQuery declare functions and variables
Shows how to define and use XQuery functions and variables
- Sample 4: XQuery TypeDeclaration support
Shows how to use the TypeDeclaration functionality
- Sample 5: XQuery running in compiled mode
Shows how to run XQuery functions in compiled mode
- Sample 6: XQuery running in pre-compiled mode
Shows how to invoke XQuery in pre-compiled mode
- Sample 7: XQuery operations on types (typeswitch, cast as)
Shows how to use operations on types
- Sample 8: XQuery schema awareness - input validation (valid)
Shows how to validate the input document passed to the query
- Sample 9: XQuery schema awareness - input validation (invalid)
Shows how to validate the input document passed to the query
- Sample 10: XQuery schema awareness - node validation (valid)
Shows how to validate an element using the validate expression
- Sample 11: XQuery schema awareness - node validation (invalid)
Shows how to validate an element using the validate expression
- Sample 12: XQuery schema awareness - element(*, T) function
Shows how to use schema awareness to match on element types instead of names
- Sample 13: XQuery modules support
Shows how commonly used functions and variables can be put in a reusable library module
- Sample 14: XQuery modules support with schema
Shows how modules interact with schema support
- Sample 15: Using query-declared external functions
Shows how to declare external functions within a query
- The Blog Comment Checker examples show how we can search all or your Bloggerâ„¢ web publishing service blogs for questionable comments. They are examples of high-level applications that use XPath 2.0, XSLT 2.0, and XQuery 1.0.
- XPath Blog Checker
- XSLT Blog Checker
- XQuery Blog Checker
- Database Integration Checker