This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variable definition reuse


On Friday 22 March 2002 05:15, Laura Jenkins wrote:
> David,
> I need those variables because in the same style sheet they are used many
> times and i dont want to keep doing select="exp-date"  also some of the
> variables need to be formatted and checked for a perticular value and stuff
> like that. so i need them to be variables.. So no having said that can how
> can i place them in a different file??
> laura

<!DOCTYPE xsl:stylesheet [
  <!ENTITY common-variables SYSTEM "file-with-common-variables.xml">
]>
<xsl:stylesheet ...>
  <xsl:template match="xxx">
    &common-variables;
    <!-- use the variables... -->
  </xsl:template>
</xsl:stylesheet>

In file-with-common-variables.xml, you can list all of the <xsl:variable>s.  
No need to have a single document element at the root.  The entity reference 
will include the file exactly as is.

-- 
Peter Davis
Detroit is Cleveland without the glitter.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]