This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

The notion of Inheritance?


Can XML/XSL have the notion of inheritance?  Here's an example:

<people>
	<person>
		<id>1</id>
		<first-name>John</first-name>
		<last-name>Smith</last-name>
		<physical>
			<eyes>brown</eyes>
			<hair>black</hair>
			<height>6'1"</height>
		</physical>
		<occupation>Software Developer</occupation>
	</person>
	<person>
		<id>2</id>
		<first-name>Mary</first-name>
		<last-name>Jacobs</last-name>
		<occupation>Welder</occupation>
	</person>
	<person>
		<id>3</id>
		<first-name>Joe</first-name>
		<physical>
			<eyes>blue</eyes>
		</physical>
	</person>
</people>

Suppose I want to match id=2 and id=3 (respectively) and transform them to
separate XMLs, using id=1 as the default:

<person>
	<id>2</id>
	<first-name>Mary</first-name>
	<last-name>Jacobs</last-name>
	<physical>
		<eyes>brown</eyes>
		<hair>black</hair>
		<height>6'1"</height>
	</physical>
	<occupation>Welder</occupation>
</person>

<person>
	<id>3</id>
	<first-name>Joe</first-name>
	<last-name>Smith</last-name>
	<physical>
		<eyes>blue</eyes>
		<hair>black</hair>
		<height>6'1"</height>
	</physical>
	<occupation>Software Developer</occupation>
</person>

Is there a way to do with XSL, without resorting to XSP?  I have tried and
failed to come up with a solution to this.  If any of you could point me in
the right direction, I would really appreciate it.

William Bagby.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]