[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: XSLT with a source with namespaces

Subject: [list4xt] Re: XSLT with a source with namespaces
From: Dave Pawson (dave.pawson@virgin.net)
Date: 05/07/2000 - 20:30


     Stephanie Martin

     Still looking for an answer for this question...
> Whenever I see examples of XSLT in use, 99% of them use literal
> result elements vs. using xsl:element. The same applies to
> xsl:attribute and others like it. Is there a "best practice"
> detail here that I should know about or is it whatever you feel
> like typing?
     Eg>
     
     <myelement>text</myelement>
     
     vs,
     
     <xsl:element name="myelement">
     text
     </xsl:element>

Having nicely mixed them up all day today, I'll take a chance.

1. For simplicity, if you know what you want,
use literals.
  <element attribute="value"> .....
(Also less typing)

2. when you need to work out the element name,
   use <xsl:element name="{xpath calc}">

3. When you know half of it

   use
   <element-name attribute-1="value">
     <xsl:attribute name="{calculate-value}">
         <xsl:value-of select="calculated value"/>
     </xsl:attribute>
   </element-name>

Hope that helps.
Summary? Be as lazy as you can,
xml is verbose!

Regards, DaveP
     

--
Mailing list for the XT users community.     (http://mcamerchant.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org


A site designed by Dyomedea