Wildcards in Queries

In a query, you can include an asterisk (*) to represent all elements. For example:

/bookstore/book/*
               

            

This query searches for all book elements in bookstore. For each book element, this query returns all child elements that the book element contains.

The * collection returns all elements that are children of the context node, regardless of their tag names.

The next query finds all last-name elements that are grandchildren of book elements in the current context:

book/*/last-name 
               

            

The following query returns the grandchild elements of the current context.

*/* 
               

            

Restrictions

Usually, the asterisk (*) returns only elements. It does not return processing instructions, attributes, or comments, nor does it include attributes or comments when it maintains a count of nodes. For example, the following query returns title elements. It does not return style attributes.

/bookstore/book/*[1]
               

            

Wildcards in strings are not allowed. For example, you cannot define a query such as the following:

/bookstore/book[author=" A* "]
               

            

Attributes

To use a wildcard for attributes, you can specify @*. For example:

/bookstore/book/@*
               

            

For each book element, this query returns all attributes. It does not return any elements.

XML Project

Stylus Studio's Project Window is an intuitive, visual feature for organizing files belonging to a project. It supports different file-type icons and nested folders; many helpful options are available from the context menu.

The Java Architecture for XML Binding (JAXB)

In this JAXB tutorial, we'll show you how easy it is to generate JAXB bindings!

XML File Explorer

The XML File Explorer provides a productive, consistent, and easy-to-use interface for working with any data sources (relational data, EDI, binary, XML, CSV, and more) used in enterprise data integration projects.

Translating EDIFACT Documents to XML

The EDIFACT to XML Converter is a primary component of the adapter library. The XML that is generated is well commented and indented, and can be used anywhere XML is normally used — with XML Schemas, XQuery, XSLT, and so on.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member