XML Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 4.00

Control and Generate XML Element in the Result

This chapter provides tutorial notes and example codes on output XML elements. Topics include controlling output format with the 'output' element; generating XML elements with literal XML elements, 'element' elements and/or 'copy' elements; copying verything from source to result.

"output" - The Output Format Control Element

Generating Transformation Output in XML Format

"element" and "attribute" - Constructing Output Elements

"copy" - Copy Elements from Source to Result

Copying Attributes and Texts

Conclusion:

  • User "outout method='xml'" element to generate result as an XML document.
  • Output XML elements can be done by inserting literal XML elements in the stylesheet.
  • Output XML elements can be done by constructing new XML elements using "element" elements.
  • An "attribute" element can be used inside "element" to add an attribute to the new XML element.
  • A "text" element can be used inside "element" to add a text child to new XML element.
  • A "comment" element can be used inside "element" to add a comment to new XML element.
  • Output XML elements can be done by copy old XML elements using "copy" elements.
  • An identity template is provided to copy everything from source to result.

Question: Does anyone know what "preserve-space" is for?

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

 XML File Browsers

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

 Syntaxes of XSD Statements

 Validating an XML Document against the Specified XML Schema

 XSL (Extensible Stylesheet Language) Introduction

 XSLT (XSL Transformations) Introduction

 Java Implementation of XSLT

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

Control and Generate XML Element in the Result

 References

 Printable Copy - PDF Version

Dr. Herong Yang, updated in 2009
Control and Generate XML Element in the Result