This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
The notion of Inheritance?
- To: "XSL Mailing List (E-mail)" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] The notion of Inheritance?
- From: William Bagby <williamb at adone dot com>
- Date: Wed, 28 Mar 2001 18:08:41 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
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