Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Utility to convert XML to value pair ?

From: "dingdongdingding@-----.---" <----------------@-----.--->
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>&#xa;</xsl:text>
> =A0 =A0</xsl:template>
>
> </xsl:stylesheet>
>
> ///Peter- Hide quoted text -
>
> - Show quoted text -



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