|
Home > Online Product Documentation > Table of Contents > Accessing Other Documents During Query Execution Accessing Other Documents During Query Execution
During execution of a query, you might want to access data in another document. To do this, call the
This section discusses the following topics: Format of the document() Function
To query multiple documents with a single query, call the
The format for the
The XPath processor examines the first argument. If it is a single value (that is, it is not a node set) the XPath processor converts it to a string, if it is not already a string. Separate directory names and the file name with a forward slash (/). See the following format:
This string must be an absolute path. The XPath processor retrieves the specified document. The new context node is the root node of this document. Suppose you invoke the
When the First Argument is a Node Set
It is possible for the first argument of the
Specification of Second ArgumentIf you specify a second argument, it must be a node set. The XPath processor examines the first node (in the context of document order) in the node set to determine the document that this node belongs to. The XPath processor retrieves the name of the directory that contains this document and appends the relative path from the first argument to the name of the directory. This creates an absolute path, and the XPath processor retrieves the specified document. If there is no second argument, the query must be an expression in an XSLT stylesheet. The XPath processor appends the relative path to the name of the directory that contains the XSLT stylesheet. This allows the query to examine the stylesheet itself. Example of Calling the document() FunctionSuppose you have the following XML document:
The following query returns the
Now suppose you pass this query to the
This query returns the root nodes of
|
Generate XML Schema
Generate XML Schema data models from one or more XML instance documents, or by converting other data models (DTD's, Relational Schemas, EDIFACT, EDI, etc.)
Scientific, Photo & Control Equipment
Scientific, photo & control equipment companies hear clicks and beeps all day. But, when it comes to data integration it needs to be done in a flash, that's why they use Stylus Studio. Come see which top companies are seeing XML in a brand new light!
Export HTML to XML
Export HTML to XML with the click of a button - simplify migration of legacy HTML code to industry standard XML technologies with Stylus Studio.
XML Parser
An XML Parser is a parser that is designed to read XML and create a way for programs to use XML. Learn about Stylus Studio's comprehensive support for all of the world's leading XML Parsers.