473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Reference a sibling attribute

We have :

<r>
<b>
<a type="edit"/>
</b>
<b>
<a type="submit"/>
</b>
</r>

When processing b elements what expression returns the
value of an a element type ?

Thanks.
Jul 20 '05 #1
2 1241
Hello, GIMME!
You wrote on 9 Apr 2004 19:01:10 -0700:

G> <r>
G> <b>
G> <a type="edit"/>
G> </b>
G> <b>
G> <a type="submit"/>
G> </b>
G> </r>

G> When processing b elements what expression returns the
G> value of an a element type ?

I think, it is better to you just buy a good book about XPath and XSLT.

The path for your question is
a/@type

With best regards, Alex Shirshov.
Jul 20 '05 #2
Same example, with the elements names swapped out...
r with html, b with td and a with input.

Alex's suggestion, translating into input/@type falls short ...

Care to give it another look? (Big thanks in advance...)

<html>
<td>
<input type="edit"/>
</td>
<td>
<input type="submit"/>
</td>
</html>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
encoding="UTF-8"/>
<xsl:template match="html">
<xsl:for-each select="td">
<xsl:if test="input/@type='select'">
found select
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Rohleder | last post by:
Hi, I'm using a style-sheet where I make use of the XPATH-"following-sibling"-expression. The part which makes problems looks similar to the following code: --------------------------- ...
4
by: Brad | last post by:
Help, I have a really complicated XPATH request I can't wrap my head around I have an XML nodeset like this: <a> <a1 attr="key">Use</a1> <a1 attr="val">Value1</a2> </a> <a> <a1...
2
by: clres | last post by:
Hi, I have an XSLT that needs to adjust height and width attributes of images. It sets the width to a particular value and should adjust the height correspondingly. I cannot seem to get it to...
0
by: Elaine | last post by:
I have a truly curious problem with HtmlHelp and Sibling Mode in Visual C++ ..Net 2003 in an MFC app. Sibling mode allows the help viewer to display on top of the app, but if the app is clicked,...
0
by: Kathy Burke | last post by:
I'm providing the following syntax in hopes someone could tell me why I get an object reference error on the second one. The first one works, using an xmlDocument, the second one immediately...
11
by: localpricemaps | last post by:
i have some html which looks like this where i want to scrape out the href stuff (the www.cnn.com part) <div class="noFood">Cheese</div> <div class="food">Blue</div> <a class="btn" href =...
3
by: patrizio.trinchini | last post by:
Hi, how can remove sibling elements based on the value of an attribute ? For instance, gven the XML document: <root> <parentElment> <testElement name="A"> <removableElement/>
4
by: johkar | last post by:
I am having trouble figuring out how to use preceding sibling when I am already on the node. I have a feeling that you cannot use preceding-sibling on an attribute, but I can't figure out the...
12
by: apicard | last post by:
I have a simple document like this: <Accept> <XXXX/> <Token image="From"/> <Date value="2007-01-01"/> <Token image="To"/> <Date value="2007-01-01"/> </Accept>
5
by: Nathan Sokalski | last post by:
I'm not sure if this is the right place to ask this question, but I wasn't sure where else to go. I have a table made of the following tags: <table class="myclass"> <tbody> <tr><td>.</td></tr>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.