Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2007, 02:23 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default check a attribute

hi..suppose in my xml, node1 one has a attribute called "Info"...now i want to get all the attribute name and value expect for the Info..mens if attributename equals "Info" i will not process it to get the value ..i want to ignore it..and i have to check if this attribute is exist or not..if exist then only i can ignore it...what will be syntax..

and suppose i got a attibute value ..and i want to break it by some key work like"#10;" if i get this in the attribute value ..i want to break the string attribute value by parts...what will be the sytax..
can anybody pls help me with the syntax..thnx
 
Old February 19th, 2007, 04:27 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

1.

In XPath 2.0: "@* except @Info"

In XPath 1.0: "@*[local-name() != 'Info']"

2. Use functions like substring-before() and substring-after()

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 19th, 2007, 04:43 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cool..that's working fine....thank u very much...

for the spliting thing....suppose
<xsl:for-each select="@*">
                       <tr height="22"><td class="nodeprop">
                       <xsl:value-of select="name()"/>
                       </td><td class="nodevalue">
                      <xsl:value-of select="."/> #160;
                      </td></tr>
                </xsl:for-each>


here i'm getting one attribute value like this......
&amp;#10;-- 12.08.97 K.W&ouml;rn - Neue Felder aufgenommen Tarifart, Bewertungsstichtag&amp;#10;-- 16.12.02 T. Loeken - CHR 7614: TrgPreUpdate TAR, Verkn&uuml;pfung korrigiert&amp;#10;-- 10.01.03 T. Loeken - CHR 7402: Vertikale Ausrichtung der

now i need to split it when ever i will get &amp;#10;..
so for that i need to store the value first then i have to split and display...but with the 'substring-before' and 'substring-after' i can only split the value in two part..may be..do i have to do a recursion..could u pls tell me how to store the value and how to do recursion...with the syntax those r very new to me...thnx






Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace an attribute with another attribute georgemeng XSLT 8 June 10th, 2008 11:04 AM
Connect to VSS check-in Check-out Programatically rhd110 General .NET 6 August 12th, 2007 07:46 AM
How to check for the presence of an attribute dsekar_nat XSLT 2 July 27th, 2006 05:04 AM
Access to attribute values from class of attribute jacob C# 1 October 28th, 2005 01:11 PM
Help 'Check ListView' vs 'Check ListBox' MikeY C# 1 February 24th, 2005 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.