[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Output input_xml apart from one tag change?
I like this last version with non-abbreviated xpath expression, it is unambiguous for a beginner like me. On 10/2/07, Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote: > Scott, > > At 11:50 AM 10/2/2007, you wrote: > >Say you _don't_ know you want to copy them. I use it as a standard > >identity template, because it allows me to do something like the > >following afterward: > > > ><xsl:template match="select[some condition]/@multiple"/> > > Indeed: I thought I made that clear. My analysis wasn't intended to > recommend one method over the other in the general case, just to > clarify the tradeoffs, including the subtler ones that don't always > make a difference. > > For whatever reason, we human beings are quick to make value > judgements where they're not necessary or useful. Something is not > necessarily bad because it's different, but since we're naturally > skittish about the unknown and about the risks that come with it, we > often can't help but feel that way when trying to deal with something > new. It's helpful when doing analysis to sort out all the options not > because we learn which approaches are good or bad, but why a given > approach may be good or bad in a given situation. Generalizing the > "good/bad" thing is just substituting allergies for judgements. > > FWIW, the match="node()|@*" variant (your favorite) is the one that > appears in the XSLT spec. But experience shows it is rather > mysterious for people whose XPath is weak, and for those who don't > get the XSLT processing model. These are often the same people, which > is doubly frustrating for them. Separating apart these two aspects of > the problem often gives them a much easier way into seeing why the > solution works (and seeing much else along with it). Until then it's > just a magic spell at best. > > One might also recommend > > <xsl:template match="child::node() | attribute::node()"> > <xsl:copy> > <xsl:apply-templates select="child::node() | attribute::node()"/> > </xsl:copy> > </xsl:template> > > ... which would have the opposite set of virtues (and vices). > > Cheers, > Wendell > > > ====================================================================== > Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx > Mulberry Technologies, Inc. http://www.mulberrytech.com > 17 West Jefferson Street Direct Phone: 301/315-9635 > Suite 207 Phone: 301/315-9631 > Rockville, MD 20850 Fax: 301/315-8285 > ---------------------------------------------------------------------- > Mulberry Technologies: A Consultancy Specializing in SGML and XML > ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|