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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2016)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
benjamin yapSubject: value of select doubt
Author: benjamin yap
Date: 06 Apr 2006 02:16 AM
i have one of the attributes in xml where it is too long to put into table. I wish to do some filtering before putting it into html table.

<attribute name="address">28 thomson road,poscode=75500</attribute>


which part of my code (below) should be modified in order to select only poscode value?


<xsl:value-of select="attribute[@name='address']"/>


looking forward for u help..thanks

Postnext
Minollo I.Subject: value of select doubt
Author: Minollo I.
Date: 06 Apr 2006 08:57 AM
You will need to work with the string value somehow; seems bad design to have "poscode" coded as part of the text node, instead of exploded in the XML structure itself...

You could do something like...
<xsl:value-of select="attribute[@name='address' and contains(.,'poscode=75500']"/>

...or you can do more sophisticated checks using other XPath functions to manipulate strings.

Minollo

Postnext
benjamin yapSubject: value of select doubt
Author: benjamin yap
Date: 06 Apr 2006 09:13 PM
hi, thanks for ur help. I followed exactly the way u mentioned below, there was no error when converting to html, but under the address column of the table, it will still select the whole adresss, instead of poscode number only...

>You will need to work with the
>string value somehow; seems
>bad design to have "poscode"
>coded as part of the text
>node, instead of exploded in
>the XML structure itself...
>
>You could do something like...
><xsl:value-of
>select="attribute[@name='addre
>ss' and
>contains(.,'poscode=75500']"/&
>gt;
>
>...or you can do more
>sophisticated checks using
>other XPath functions to
>manipulate strings.
>
>Minollo

Postnext
Minollo I.Subject: value of select doubt
Author: Minollo I.
Date: 06 Apr 2006 10:22 PM
Oh, sorry; the code I sent you selected an <attribute> element corresponding to a specific poscode; if you want to display the poscode value only, you can do something like:

<xsl:value-of select="substring-after(attribute[@name='address'],'poscode=')"/>

Posttop
benjamin yapSubject: value of select doubt
Author: benjamin yap
Date: 07 Apr 2006 10:13 AM
hi,

Thanks for ur greatest help!!Now my output is exactly what i want .....once again...thank you so so much.... :)

   
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.