Obtaining All Marked-Up Text

When you query a document, you do not usually want to obtain all marked-up text. However, an understanding of queries that return all marked-up text makes it easier to define a query that retrieves just what you want.

The following figure shows a complete query ( /bookstore) and the way the XPath processor interprets it:

This query returns the bookstore element. Because the bookstore element is the document element, which contains all elements and attributes in the document, this query returns all marked-up text.

In the query, the initial forward slash (/) instructs the XPath processor to start its search at the root node.

Suppose you run the following query on bookstore.xml:

/book
               

            

This query returns an empty set. It searches the immediate children of the root node for an element named book. Because there is no such element, this query does not return any marked-up text. Note that this query does not return an error. The query runs successfully, but the XPath processor does not find any elements that match the query. All book elements are grandchildren of the root node, and the XPath processor only checks the children of the root node.

Database-to-XML Mapping

Stylus Studio features several database-to-XML mapping tools that allow you to easily query a relational database using SQL/XML or SQL and render the results as XML. Stylus Studio also supports the world's first and only visual SQL/XML Editor!

Converting Custom EDI Message Types to XML

Vital and valuable legacy data locked in proprietary EDI files? See how to use DataDirect XML Converters™ custom EDI message type tools to convert nonconformant EDI to XML.

Using OASIS XML Catalogs in Stylus Studio

Learn about Stylus Studio's XML catalog support and how to work with XML catalogs in your Stylus Studio XML projects.

Introduction to the XQuery Mapper

This free online video demonstration covers Stylus Studio's synchronized XQuery editing and mapping tool which allows you to create any XQuery expression, either manually using Stylus Studio's XQuery editor.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member