Posts

Showing posts with the label xslt

Using xslt to transform multiple xml schema documents

Using xslt to transform multiple xml schema documents I have a number of xml schema documents which are used to describe configuration settings for my application. The xml schemas look something along the following lines: Client.xsd <xsd:schema targetNamespace="http://www.example.com/network" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Client"> <xsd:attribute name="Host" type="xsd:string> </xsd:complexType> </xsd:schema> Server.xsd <xsd:schema targetNamespace="http://www.example.com/network" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Server"> <xsd:attribute name="Port" type="xsd:unsignedShort> <xsd:attribute name="MaxConnections" type="xsd:int default="32"> </xsd:complexType> </xsd:schema> Appli...

XSL Multiplying a value times a value in an value of select

XSL Multiplying a value times a value in an value of select I have this piece of code: <xsl:value-of select="sum(objects/object/items/item[not(product_type='configurable' and count(custom_options/custom_option[option_id='2686']) &gt; 0)]/custom_options/custom_option[option_id='2686']/value)" /> Which correctly outputs the integer that I want, but now in a different field, I want to mutiply this by the value of, in my case, qty_ordered . So what I tried is this: qty_ordered <xsl:value-of select="sum(objects/object/items/item[not(product_type='configurable' and count(custom_options/custom_option[option_id='2686']) &gt; 0)]/custom_options/custom_option[option_id='2686']/value * qty_ordered)" /> Unfortunately this doesn't work and I have no idea how to do this, anyone able to help me produce a line of code which outputs id2686/value * qty_ordered ? qty_ordered is also in the items/item loop. id2686...