Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: transform XML to SQL by XSL

From: andie.du168@-----.---
To: NULL
Date: 9/7/2008 4:56:00 PM
On Sep 5, 8:24=A0pm, "Anthony Jones" <AnthonyWJo...@yadayadayada.com>
wrote:
> <andie.du...@gmail.com> wrote in message
>
> news:e2bfc74a-4dc8-4ea2-b40a-47f860265457@b......
>
>
>
>
>
> >i have thisxmlhere, and now i would like to usexsltotransform
> > into an Updatesqlstatement like this:
> > Here is theXMLdocument:
>
> > <Order ID=3D"10248">
> > =A0 =A0 <OrderItem ProductID=3D"11">
> > =A0 =A0 =A0 =A0 =A0<QuantityIncrease>2</QuantityIncrease>
> > =A0 =A0 </OrderItem>
> > </Order>
>
> > Here is a bit i did:
>
> > <?xmlversion=3D"1.0" encoding=3D"UTF-8">
> > <xsl:stylesheet version=3D"1.0" xmlns:xsl=3D"http://www.w3.org/1999/XSL=
/
> >Transform">
> > =A0 =A0 <xsl:input href =3D"WriteXMLToDBTest_Order.xml"/>
> > =A0 =A0 <xsl:output method=3D"text" encoding=3D"UTF-8"/>
>
> > =A0 =A0 <xsl:template match=3D"/">
> > =A0 =A0 =A0 =A0 =A0<xsl:apply-templates select=3D"Order"/>
> > =A0 =A0 </xsl:template>
>
> > =A0 =A0 <xsl:tempalte match=3D"Order">
> > =A0 =A0 =A0 =A0 =A0<xsl:text>update</xsl:text>
> > =A0 =A0 =A0 =A0 =A0<xsl:value-of select=3D"Order Details"/>
> > =A0 =A0 </xsl:tempalte>
> > </xsl:stylesheet>
>
> > as i am still new in this field, can someone guide me through?
>
> What database are you using?
> What programming language?
> Where does theXMLcome from?
>
> --
> Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> - Show quoted text -


Hi Anthony,

i am uing sql server 2005, c# as programming language, the xml and xsl
are in the same directory, i just wann xsl to import xml and then
trannsform to sql statement like this:
update order_details set quantity =3D 12 where orderid =3D 10248 and
productid =3D 11



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent