Component and Sub-Component Fields

Some file formats - many EDI variants, for example - allow fields to be subdivided into arrays, sub-fields, or composite fields. Collectively, these fields are referred to as component fields in custom XML conversion definitions. Typically, the headers of these files contain information about the character used to specify component fields. Stylus Studio uses this information to set the default value for the Field Component Separator property and render XML output accordingly.

Consider the following input file, which uses a semi-colon (;) to specify component fields:

Make;Model;Year;Color;Seat 
BMW;R1150RS;2004;grey,metallic;black,vinyl 
MZ;Scorpion;1995;green,clearcoat;black,vinyl 
Ducati;ST2;1997;red,clearcoat;black,leather 

Using the first row to supply the field names and default Component Element Name (component), the custom XML conversion definition creates the following XML output (first two elements shown for brevity):

<?xml version="1.0" encoding="utf-8"?> 
<root> 
	<row> 
		<Make>BMW</Make> 
		<Model>R1150RS</Model> 
		<Year>2004</Year> 
		<Color> 
			<component>grey</component> 
			<component>metallic</component> 
		</Color> 
		<Seat> 
			<component>black</component> 
			<component>vinyl</component> 
		</Seat> 
	</row> 
	<row> 
		<Make>MZ</Make> 
		<Model>Scorpion</Model> 
		<Year>1995</Year> 
		<Color> 
			<component>green</component> 
			<component>clearcoat</component> 
		</Color> 
		<Seat> 
			<component>black</component> 
			<component>vinyl</component> 
		</Seat> 
	</row> 
... 

The <component> elements are created as subelements of the <Color> and <Seat> elements.

For line-oriented regions in files containing component fields, you can change the default Field Component Separator property, and the Component Element Name and Component Element Name properties, that is, the name you want to use for the component fields' container elements.

XQuery Mapper

Stylus Studio has the industry's only XQuery mapper, enabling you to develop sophisticated XML mappings consisting of queries and data transformation in an intuitive, visual manner.

Computing XML Differences in Stylus Studio

See for yourself just how easy it is to visually compare different XML files or folders using Stylus Studio's powerful new XML Differencing Utility. Quickly and easily analyze and merge changes made to different XML documents!

XQuery Editor

Stylus Studio's XQuery development tools are a tremendous help in building and testing XML applications requiring a standards-based approach to querying, integrating and transforming data from various distributed data sources.

Berkeley DB XML and Stylus Studio

Develop XML applications for Berkeley DBXML with Stylus Studio integrated tools support for SleepyCat Software's DBXML. Open, Query and Save XML to and from Berkeley DB XML directly from within the Stylus Studio XML IDE.

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.