[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] The notion of Inheritance?
Subject: Re: [xsl] The notion of Inheritance? From: Cristobal Galiano Fernandez <c.galiano@xxxxx> Date: Thu, 29 Mar 2001 16:31:23 +0200 |
Michael: I don't understand what you can say. Perhaps a way to update elements attributes? Can you write an short, but full (XML & XLL) example. Perhaps this XML is good for you (?) <?xml version="1.0" encoding="ISO-8859-1"?> <Data> <person id="1" Nombre="Cristóbal" apell1="Garcia" apell2="Fernández" edad="23" apell1="GalianoUpd" /> <person id="1" Nombre="Cristóbal-Up1" /> <person id="1" apell2="Fernández-Up3" edad="24" /> <person id="2" Nombre="Rocio" apell1="Senda" apell2="Zapata" edad="21" /> <person id="3" Nombre="Alicia" apell1="Melliza" apell2="Joquer" edad="22" /> </Data> Thanks in advance Cristóbal G.F Michael Kay escribió: > > Can XML/XSL have the notion of inheritance? > > No, it doesn't. If you were using attributes rather than elements you could > achieve something along the right lines with a template rule such as > > <xsl:template match="person"> > <person> > <xsl:copy-of select="person[@id=1]/@*"/> > <xsl:copy-of select="@*"/> > </person> > </xsl:template> > > This relies on the fact that when outputting attributes, the last attribute > with a given name overrides earlier attributes with the same name. > > You're not using attributes, but you could convert the elements to > attributes in a pre-pass. The alternative is a lot of <xsl:choose> logic. > > Mike Kay > Software AG > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] The notion of Inheritance, Michael Kay | Thread | RE: [xsl] The notion of Inheritance, Michael Kay |
AW: [xsl] Alright...sorting problem, Marcus Klinge | Date | [xsl] xml to html paragraphing, Java XML |
Month |
Keywords