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

Trying to simply reformat but my stylesheet will not

Subject: Trying to simply reformat but my stylesheet will not compile
From: thehulk@xxxxxxxxxxx
Date: Mon, 11 Jul 2011 23:05:53 +0000 (UTC)
 Trying to simply reformat but my stylesheet will not
I cannot restructure my working inline expression into the structured expressions that i want.

The original was working. 

The task is: If there is any child element named "Service", output a <Total_Rollable_Charge> element, that adds up the amounts of the charges.

It was working this way:
<if test="Service">
<Total_Rollable_Charge Amount="{sum(Service//Charge[not(Trans_Class='I')]/Charge_Amount/Amount)}" Flag="HasSvc" />
</if>		<!-- end if-service -->     


The next similar task is so much more complex, so I want to factor this out into <xsl:element> 
and <xsl:attribute> tags, and then use that as a model for the tougher one. This one is simple right? 

<if test="Service">
  <element name="Total_Rollable_Charge">
    <attribute name="Amount"> 
      <value-of select="{sum( Service//Charge[not(Trans_Class=&quot;I&quot;)]/Charge_Amount/Amount )}" />
    </attribute>	
    <attribute name="Flag" >
      <value-of select="HasSvc" />
    </attribute>	
  </element>
</if>

but no! 
ERROR:  'file:my.xsl: 
line 427: Error parsing XPath expression '{sum( Service//Charge[not(Trans_Class="I")]/Charge_Amount/Amount )}'.'
FATAL ERROR:  'Could not compile stylesheet'
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source)
	at Middleware.Executor.main(Executor.java:278)

Where have I erred?

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-2011 All Rights Reserved.