[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Writing a stylesheet to create another XML Document

Subject: Writing a stylesheet to create another XML Document
From: "Kunal H. Parikh" <kunal@xxxxxxxxxx>
Date: Tue, 2 Apr 2002 16:42:19 +1000
author.xml
Hi!

I am trying to combine two XML Documents:

	Tutorial.xml, and
	Author.xml

using the stylesheet TutorialWithAuthorName.xsl

For starters, I don't even know if my stylesheet will work to include
the Author.xml/AuthorList/Author/Name.

Once I get that sorted, I was wondering if an XML file could be
generated to include the Author.xml/AuthorList/Author/Name ?

Also, will this XML file be "live". I.E. will it change each time the
Author.xml has been changed ?

TIA,

Kunal


The contents of each of the files are:

Tutorial.xml
************
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=" TutorialWithAuthorName.xsl" ?>

<Tutorial>
	<AuthorList>
		<Author id="1" />
		<Author id="2" />
		<Author id="3" />
		<Author id="4" />
	</AuthorList>
</Tutorial>
************

Author.xml
**********
<?xml version="1.0"?>
<AuthorList>
	<Author id="1">
		<Name>Ms. A B C</Name>
	</Author>
	<Author id="2">
		<Name>Ms. D E F</Name>
	</Author>
	<Author id="3">
		<Name>Ms. G H I</Name>
	</Author>
	<Author id="4">
		<Name>Ms. J K L</Name>
	</Author>
</AuthorList>
**********

TutorialWithAuthorName.xsl
**************************
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:template match="/">
		<xsl:apply-templates
select="document(Author.xml)/AuthorList/Author[@id='1']" />
	</xsl:template>

	<xsl:template match="/AuthorList/Author">
		Author Name <xsl:value-of select="Name" />
	</xsl:template>
</xsl:stylesheet>
**************************


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
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-2013 All Rights Reserved.