Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Utility to convert XML to value pair ? >Thread Next - Re: Utility to convert XML to value pair ? Re: Utility to convert XML to value pair ?To: NULL Date: 4/10/2008 5:12:00 PM Hi Peter
Can I trouble you further ? May I know how I can execute this
scipt ? Using what ? Thanks again.
On Apr 11, 5:29=A0am, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
> dingdongdingd...@yahoo.com wrote:
> > When I look closer at the XML, I realise that I myself had
> > misinterpreted my needs. =A0Inside the XML, there is a portion where the=
> > value are coded as (eg):
>
> > =A0 =A0 =A0 =A0 <NameValuePair>
> > =A0 =A0 =A0 =A0 =A0 =A0 <name>Name</name>
> > =A0 =A0 =A0 =A0 =A0 =A0 <value>xxxxxxxxxxxxxxxxx</value>
> > =A0 =A0 =A0 =A0 </NameValuePair>
> > =A0 =A0 =A0 =A0 <NameValuePair>
> > =A0 =A0 =A0 =A0 =A0 =A0 <name>Address</name>
> > =A0 =A0 =A0 =A0 =A0 =A0 <value>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxx</
> > value>
> > =A0 =A0 =A0 =A0 </NameValuePair>
> > =A0 =A0 =A0 =A0 <NameValuePair>
> > =A0 =A0 =A0 =A0 =A0 =A0 <name>Telephone</name>
> > =A0 =A0 =A0 =A0 =A0 =A0 <value>xxxxxxxx</value>
> > =A0 =A0 =A0 =A0 </NameValuePair>
> > =A0 =A0 =A0 =A0 <NameValuePair>
> > =A0 =A0 =A0 =A0 =A0 =A0 <name>Comments</name>
> > =A0 =A0 =A0 =A0 =A0 =A0 <value/>
> > =A0 =A0 =A0 =A0 </NameValuePair>
>
> > Name=3Dxxxxxxxxxxxxxxxxx
> > Address=3Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Telephone=3Dxxxxxxxx
> > Comments=3D
>
> > So are there any tools that can do this ? =A0Thanks.
>
> Nothing prewritten -- how could a program guess what you want to do?
> But this XSLT script will do it.
>
> <?xml version=3D"1.0"?>
> <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0version=3D"1.0">
>
> =A0 =A0<xsl:output method=3D"text"/>
> =A0 =A0<xsl:strip-space elements=3D"*"/>
>
> =A0 =A0<xsl:template match=3D"NameValuePair">
> =A0 =A0 =A0<xsl:value-of select=3D"name"/>
> =A0 =A0 =A0<xsl:text>=3D</xsl:text>
> =A0 =A0 =A0<xsl:value-of select=3D"value"/>
> =A0 =A0 =A0<xsl:text>
</xsl:text>
> =A0 =A0</xsl:template>
>
> </xsl:stylesheet>
>
> ///Peter- Hide quoted text -
>
> - Show quoted text -
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
