XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 26 Jul 2006 04:02 PM
<device manufacturer="T-Mobile" name="Sidekick&#xAE; 3" src-url="http://www.t-mobile.com/shop/Phones/Detail.aspx?device=7a083f08-7f33-4941-ba63-d6904503dc71" retrieval-time="2006-07-26 08:17:32"/>
Can i remove this symbols: #xAE; from name?

Postnext
Ivan PedruzziSubject: Xml to XML with XSLT (Remove)
Author: Ivan Pedruzzi
Date: 26 Jul 2006 09:29 PM
Hi Misha

Use the XPath function translate to replace a set characters with another characters.
http://www.w3.org/TR/xpath#function-translate

translate(device/@name, '&#xAE;', '')

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 27 Jul 2006 11:41 AM
Thanks.

Postnext
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 27 Jul 2006 03:47 PM
can you help me to use this translate(MODELS,'&#xAE;','','&#174;','','®','','©','','&#xA9;','','&#169;','','™','','&#x2122;','','&#8482;','','&#10;',' ','&#9;',' ')
in this XSLT:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="records" match="records/record" use="concat(SRC_URL, DATES, MODELS)"/>
<xsl:template match="/">
<device-list>
<xsl:for-each select="/records/record[generate-id() = generate-id(key('records', concat(SRC_URL, DATES, MODELS))[1])]">
<device manufacturer="{MODELS}" src-url="{SRC_URL}" retrieval-time="{DATES}">
<xsl:variable name="keyVal" select="concat(SRC_URL, DATES, MODELS)"/>
<xsl:for-each select="/records/record[concat(SRC_URL, DATES, MODELS) = $keyVal]">
<property name="{PROPERTY}" value="{VALUE1}"/>
</xsl:for-each>
</device>
</xsl:for-each>
</device-list>
</xsl:template>
</xsl:stylesheet>

Postnext
Ivan PedruzziSubject: Xml to XML with XSLT (Remove)
Author: Ivan Pedruzzi
Date: 27 Jul 2006 04:25 PM

Misha,

Please post the input document and the expected output.


Ivan Pedruzzi
Stylus Studio Team

Postnext
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 27 Jul 2006 04:38 PM
input:
<PHONE_NAME>handspring</PHONE_NAME>
<MODELS>treo650</MODELS>
<PROPERTY>Sprint PCS VisionSM Capabilities</PROPERTY>
<VALUE1>Sprint PCS Video Mail, Sprint PCS Picture Mail, Messaging, Web, and Sprint PCS Business Connection.</VALUE1>
<SRC_URL>http://developer.sprint.com/site/global/develop/devices/java_me/10_cdma/p_handspring_treo650.jsp</SRC_URL>
<DATES>2006-07-27 20:35:58</DATES></record><record>
<PHONE_NAME>handspring</PHONE_NAME>
<MODELS>treo650</MODELS>
<PROPERTY>...</PROPERTY>
<VALUE1>...</VALUE1>
<SRC_URL>http://developer.sprint.com/site/global/develop/devices/java_me/10_cdma/p_handspring_treo650.jsp</SRC_URL>
<DATES>2006-07-27 20:35:58</DATES></record><record>

OUTPUT:

<device-list><device manufacturer="handspring" name="treo650" src-url="http://developer.sprint.com/site/global/develop/devices/java_me/10_cdma/p_handspring_treo650.jsp" retrieval-time="2006-07-27 20:34:16">
<property name="Sprint PCS VisionSM Capabilities" value="Sprint PCS Video Mail, Sprint PCS Picture Mail, Messaging, Web, and Sprint PCS Business Connection."/>
<property name="Familiar Palm OS Productivity Tools" value="The software includes the standard offerings, such as calendar, contacts, memo, and tasks. Additional value-added offerings are built-in, including Real Player, calculator, security, and world clock."/>

Postnext
Ivan PedruzziSubject: Xml to XML with XSLT (Remove)
Author: Ivan Pedruzzi
Date: 27 Jul 2006 08:20 PM

Please read the documentation
http://www.w3.org/TR/xpath#function-translate

Ivan Pedruzzi
Stylus Studio Team

Postnext
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 28 Jul 2006 08:52 AM
I undestend that i can do only 1 translate but can i made multiple translation? becouse i need to remuve 7 strings.

Postnext
Ivan PedruzziSubject: Xml to XML with XSLT (Remove)
Author: Ivan Pedruzzi
Date: 28 Jul 2006 12:35 PM

translate(MODELS, '&#xAE;&#174;®©&#xA9;&#169;™&#x2122;&#8482;&#10;&#9;',' ')

Ivan Pedruzzi
Stylus Studio Team

Posttop
misha tsvetSubject: Xml to XML with XSLT (Remove)
Author: misha tsvet
Date: 28 Jul 2006 01:32 PM
Thanks.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.