Subject: RE: [xsl] is this valid <xsl:template match="@id"> ? From: Greg Alvord <Greg.Alvord@xxxxxxxxxxxxxxx> Date: Thu, 2 Jan 2003 16:58:58 -0600 |
I guess that a way to look at is by analogy. Both XSLT and DOM are tools to make XML documents. Both a sowing machine and a pair of knitting needles are ways to make clothing. With DOM and sowing machines you have access to any place in the article under construction. With knitting needles and XSLT the concept of "where am I and what am I going here?" is much more important. If you forget a buttonhole with a sowing machine you can add the buttonhole after you put on the button. Not so with knitting needles. The correct connections need to be made for the buttonhole as you parse the yarn into a sweater. Miss it and the only solution is to unravel back to the point where the buttonhole needs to be. Being a craftsman with a sowing machine may not help you much when you first take up knitting. Analogously DOM craftsmen need to learn some new things when they start with XSLT. Greg Alvord Gallagher Financial Systems. -----Original Message----- From: Niko Matsakis [mailto:niko@xxxxxxxxxxxxx] Sent: Thursday, January 02, 2003 4:31 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] is this valid <xsl:template match="@id"> ? It is more than a matter of simplicity: it allows engines to stream output. If attributes could be added at any time, then it would be impossible to output the result tree as it is generated because a new attribute could be added to an ancestor element, requiring the processor to change what it had already output Niko Matsakis DataPower technology Joerg Heinicke wrote: > Have a look into the spec: > http://www.w3.org/TR/xslt#creating-attributes. There you can find an > enumeration about the errors while creating attributes. > > I think it's only a question of simplicity. But I did not work on the > spec, so somebody else can maybe tell you more about it. > > Regards, > > Joerg > > SLakshman@xxxxxxxxx wrote: > >> thanks Joerg. it worked... >> >> Can you tell why is this restriction ? When we create CHILD ELEMENT or >> ATTRIBUTE using DOM, the order did not seem to matter... >> >> regards >> >> Saravanan L >> >> >> Tuesday, December 31, 2002 6:07 AM >> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx >> cc: >> From: Joerg Heinicke <joerg.heinicke@xxxxxx> >> Subject: Re: [xsl] is this valid <xsl:template match="@id"> ? >> >> >> >> Hello Saravanan, >> >> you can not create an attribute after an element, so change >> >> > <xsl:template match="Item"> >> > <xsl:element name="Item"> >> > <xsl:apply-templates select="Name"></xsl:apply-templates> >> > <xsl:apply-templates select="@ID"></xsl:apply-templates> >> > </xsl:element> >> > </xsl:template> >> >> to >> >> > <xsl:template match="Item"> >> > <xsl:element name="Item"> >> > <xsl:apply-templates select="@ID"></xsl:apply-templates> >> > <xsl:apply-templates select="Name"></xsl:apply-templates> >> > </xsl:element> >> > </xsl:template> >> >> Regards, >> >> Joerg > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > 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] is this valid <xsl:templa, Michael Kay | Thread | [xsl] axis for self and 2 following, Xiaocun Xu |
Re: [xsl] is this valid <xsl:templa, Niko Matsakis | Date | RE: [xsl] passing a node to c# scri, Jorge Varona |
Month |