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.

Publishing & Printing

It is really hard to get things to look pretty, especially XML. That's why these publishing & printing companies use Stylus Studio to make a Mona Lisa out of data integration. Check out these top companies that are "stunning" with Stylus Studio!

Industry DTD Standards Support (OASIS)

Stylus Studio provides integrated support OASIS catalogs, including thousands of industry-standard DTDs like DocBook, FIXML, and more!

XML Spell Checker

The Stylus Studio Spell Checker is integrated with our intuitive XML Text Editor. It highlights typographical errors as you type and lets you easily search, replace, and build custom dictionaries.

Apache XML Project

The Apache XML Project provides standards-based, open-source XML solutions for working with W3C XML technologies including XML, XSL, XSLT, XSL:FO XPath, Web services and more. Learn how Stylus Studio provides support for all Apache XML projects.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member