473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get root attribute values

Hi,

<root some_attr="edit">
<a/><a/>
<root>

How do I access the value of some_attr when processing <a/> ?

Sort of like if I had
<root>
<some_attr>edit</some_attr>
</root>

Then I could count on fetching some_attr as /root/some_attr .
But here I want to use an attribute not an element as in the
sort of like example.

Thanks.
Jul 20 '05 #1
3 2667
Hello, GIMME!
You wrote on 8 Apr 2004 17:56:55 -0700:

G> <root some_attr="edit">
G> <a/><a/>
G> <root>

G> How do I access the value of some_attr when processing <a/> ?

If the context node is a, then you can get the value of some_attr by the
following xpath

.../@some_attr
[Sorry, skipped]
With best regards, Alex Shirshov.
Jul 20 '05 #2
Thanks Alex,

Is there a top down solution rather than a bottom up solution,
or is that it?
"Alex Shirshov" <no****@mail.ru> wrote in message news:<c5***********@news.gamma.ru>...
Hello, GIMME!
You wrote on 8 Apr 2004 17:56:55 -0700:

G> <root some_attr="edit">
G> <a/><a/>
G> <root>

G> How do I access the value of some_attr when processing <a/> ?

If the context node is a, then you can get the value of some_attr by the
following xpath

../@some_attr
[Sorry, skipped]
With best regards, Alex Shirshov.

Jul 20 '05 #3
In article <3f**************************@posting.google.com >,
GIMME <gi*******************@yahoo.com> wrote:

[reorganised and cut down ...]
% "Alex Shirshov" <no****@mail.ru> wrote in message
% news:<c5***********@news.gamma.ru>...

[...]

% > If the context node is a, then you can get the value of some_attr by the
% > following xpath
% >
% > ../@some_attr

% Is there a top down solution rather than a bottom up solution,
% or is that it?

You can use /root/@some_attr.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4

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

Similar topics

5
by: Russell O'Connor | last post by:
The following XML and Schema doesn't validate in Visual Studio .NET 2003. Is there some mistake I'm making, or is VS.NET in error. The error is r:\test2.xml(3): The key sequence 'foo' in Keyref...
8
by: GIMME | last post by:
If I have <root> <a some_attr="AAA"/> <b><c/></b> <b><c/></b> <b><c/></b> <b><c><d/></c><b> <root>
1
by: jm | last post by:
I get "data at the root level is invalid." I have changed security for the IUSR_xx to be in the adminstrators (tried anonymous access); changed all the file security I could; tried virtual...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
1
by: jm | last post by:
I get "data at the root level is invalid." I have changed security for the IUSR_xx to be in the adminstrators (tried anonymous access); changed all the file security I could; tried virtual...
16
by: TT (Tom Tempelaere) | last post by:
Hi all, I created an XSD to define the structure of an XML file for my project. I made an XML file linked to the XSD using XmlSpy. The problem is that if I read the file using .NET XmlDocument...
1
by: Tedros.G | last post by:
Hi I have an attribute the appears in both the root node and child node for example, below the attribute VERSION appears in the rood node (PRODMSG ) and a child node (OPERATION ) ================...
4
by: johnsonkt | last post by:
hi all , when m trying to validate my xml using xsd file it gives me the following error "Data at the root level is invalid. Line 1, position 1" i tried to open the XML file using IE and there...
0
by: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element?...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.