Click here to Skip to main content
15,914,335 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: XML Pin
Richard MacCutchan27-Sep-09 12:51
mveRichard MacCutchan27-Sep-09 12:51 
QuestionTranspose Pin
hardeep kanwar15-Sep-08 4:03
hardeep kanwar15-Sep-08 4:03 
AnswerRe: Transpose Pin
hardeep kanwar15-Sep-08 4:06
hardeep kanwar15-Sep-08 4:06 
QuestionError in get ChildNode of the current node Pin
salmonraju14-Sep-08 18:38
salmonraju14-Sep-08 18:38 
AnswerRe: Error in get ChildNode of the current node Pin
George L. Jackson23-Sep-08 18:36
George L. Jackson23-Sep-08 18:36 
QuestionXML: Special Character in- and output [modified] Pin
Zaegra11-Sep-08 6:24
Zaegra11-Sep-08 6:24 
AnswerRe: XML: Special Character in- and output Pin
Erik Westermann11-Sep-08 10:36
professionalErik Westermann11-Sep-08 10:36 
Questionxsl formating Pin
AndieDu10-Sep-08 17:25
AndieDu10-Sep-08 17:25 
Hi All,

I have this XML document:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="WriteXMLToDBTest_SQLScript.xsl"?>

<OrderDetails>
<Order ID="10248">
<OrderItem ProductID="11">
<QuantityIncrease>2</QuantityIncrease>
</OrderItem>
</Order>
<NewOrder ID ="10249">
<OrderItem ProductID ="12">
<QuantityIncrease>3</QuantityIncrease>
</OrderItem>
</NewOrder>
</OrderDetails>

and have applied this XSL:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method ="text" encoding ="utf-8"/>
<xsl:output indent ="yes"/>
<xsl:template match ="/">
<xsl:apply-templates select ="OrderDetails/Order"/>
<xsl:apply-templates select ="OrderDetails/NewOrder"/>
</xsl:template>
<xsl:template match ="Order">
<xsl:text>Update [Order Details] Set Quantity = Quantity + </xsl:text>
<xsl:value-of select ="OrderItem/QuantityIncrease"/>
<xsl:text> Where OrderID = </xsl:text>
<xsl:value-of select ="@ID"/>
<xsl:text> And ProductID = </xsl:text>
<xsl:value-of select ="OrderItem/@ProductID"/>
</xsl:template>
<xsl:template match ="NewOrder">
<xsl:text>Update [Order Details] Set Quantity = Quantity + </xsl:text>
<xsl:value-of select ="OrderItem/QuantityIncrease"/>
<xsl:text> Where OrderID = </xsl:text>
<xsl:value-of select ="@ID"/>
<xsl:text> And ProductID = </xsl:text>
<xsl:value-of select ="OrderItem/@ProductID"/>
</xsl:template>
</xsl:stylesheet>

and it generates two sql statements:
Update [Order Details] Set Quantity = Quantity + 2 Where OrderID = 10248 And ProductID = 11Update [Order Details] Set Quantity = Quantity + 3 Where OrderID = 10249 And ProductID = 12

problems in here is that two "update statements" on the single line and i would like to know how to seperate them like this:

Update [Order Details] Set Quantity = Quantity + 2 Where OrderID = 10248 And ProductID = 11
Update [Order Details] Set Quantity = Quantity + 3 Where OrderID = 10249 And ProductID = 12

Thanks a lot
AnswerRe: xsl formating Pin
led mike11-Sep-08 4:58
led mike11-Sep-08 4:58 
GeneralRe: xsl formating Pin
AndieDu11-Sep-08 21:16
AndieDu11-Sep-08 21:16 
QuestionRead XML from VB.NET [modified] Pin
japel10-Sep-08 11:57
japel10-Sep-08 11:57 
AnswerRe: Read XML from VB.NET Pin
japel11-Sep-08 2:55
japel11-Sep-08 2:55 
QuestionSending Transformed XML as mail body Pin
brijbmishra9-Sep-08 6:46
brijbmishra9-Sep-08 6:46 
QuestionRe: Sending Transformed XML as mail body Pin
led mike9-Sep-08 9:06
led mike9-Sep-08 9:06 
QuestionRe: Sending Transformed XML as mail body Pin
brijbmishra9-Sep-08 9:17
brijbmishra9-Sep-08 9:17 
AnswerRe: Sending Transformed XML as mail body Pin
led mike9-Sep-08 9:24
led mike9-Sep-08 9:24 
GeneralRe: Sending Transformed XML as mail body Pin
Chris Maunderr10-Sep-08 0:29
Chris Maunderr10-Sep-08 0:29 
Questionxsd to xml Pin
amitsunnuu9-Sep-08 2:17
amitsunnuu9-Sep-08 2:17 
QuestionValidation of attributes in combination of other attributes? Pin
mav.northwind8-Sep-08 1:48
mav.northwind8-Sep-08 1:48 
AnswerRe: Validation of attributes in combination of other attributes? Pin
Erik Westermann12-Sep-08 10:29
professionalErik Westermann12-Sep-08 10:29 
GeneralRe: Validation of attributes in combination of other attributes? Pin
mav.northwind12-Sep-08 19:05
mav.northwind12-Sep-08 19:05 
Question&lt; symbols in <xsl:text xmlns:xsl="#unknown"></xsl:text> Pin
danielk_6-Sep-08 4:26
danielk_6-Sep-08 4:26 
AnswerRe: &lt; symbols in Pin
Saul Johnson6-Sep-08 10:43
Saul Johnson6-Sep-08 10:43 
AnswerRe: &lt; symbols in Pin
Michael Dunn9-Sep-08 12:43
sitebuilderMichael Dunn9-Sep-08 12:43 
AnswerRe: &lt; symbols in Pin
Erik Westermann10-Sep-08 4:17
professionalErik Westermann10-Sep-08 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.