[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT test of xsl variable problem

Subject: Re: XSLT test of xsl variable problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 3 Nov 2004 15:24:34 GMT
xslt test
PS

you don't show your input format so perhaps this is OK but all your
templates of the form

    <xsl:template match="orion-web-app[@internationalize-resources]">
              <xsl:if test="internationalize-resources">
       <xsl:copy>
            <xsl:attribute
name="internationalize-resources">:[value]</xsl:attribute>
            <xsl:apply-templates
select="@*[not(name()='internationalize-resources')]"/>
            <xsl:call-template name="copy-content-no-attrs"/>
        </xsl:copy>

look rather strange.

eg this one matches orion-web-app elements if they have a
internationalize-resources
attribute, but never uses that attribute but rather tests to see if
there is a child element of that name. If there is such an element
it generates an attribute called internationalize-resources with
value :[value]


I would have guessed that you meant    
<xsl:if test="@internationalize-resources">
to test for an attribute, but then the test would be pointless as
youknow the element has such an attribute as it is in the match pattern.
So assuming you did mean to test for both element and attribute, the
above could more simply be written

   <xsl:template match="orion-web-app[internationalize-resources and @internationalize-resources]">
       <orion-web-app internationalize-resources=":[value]">
            <xsl:copy
select="@*[not(name()='internationalize-resources')]"/>
 <xsl:apply-templates/>
        </orion-web-app>
</xsl:template>


probably this template could also be combined with all teh others that
have similar format, but it depends a bit what you are trying to do.

Do you really need this :[value] substitution stuff? why not handle that
all in XSLT?

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.