473,776 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get namaspaces for element

Hi,

I'm trying to figure out the xpath-expression for getting all relevant
namespaces of an element, but I don't wangle it.

When I have this document:

<A xmlns1>
<B xmlns2></B>
<C xmlns3>
<D>xxx</D>
<E></E>
</C>
</A>

....I need an expression which gives me the namespaces for <D>, that is
xmlns1 xmlns3

or even better, an expression which has the result
<D xmlns1 xmlns2>xxx</D><E></E>

BTW I'm not using xpath within xsl...I just need the plain expression.

Thanks.
Jul 20 '05
11 1578
In article <c0************ *@ID-16539.news.uni-berlin.de>,
Tommy Frost <th***@t-online.de> wrote:
"//D/namespace::*" doesn't work, the result is empty...btw "//D" only works,
when there are no namespaces that apply to D...strange


//D will only work when D is in no namespace, that is, when there is
no default namespace. If D is in a namespace because there is a
default namespace (i.e. xmlns="somethin g"), you will have to bind a
prefix to refer to it in the XPath expression. You will need
something like //foo:D and //foo:D/namespace::*, but I don't know how
you bind a prefix in the system you're using.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #11
In article <c0************ *@ID-16539.news.uni-berlin.de>,
Tommy Frost <th***@t-online.de> wrote:
% > That is not well-formed. Are you sure you understand XML namespaces at
% > all?

% I was told by mail that people might think, that I consider xmlns1 etc. as
% "real" namespaces -> No - they're just short forms of real ones. Thought
% this was clear.

That was clear. It's not at all clear what you mean, though, so how about
a short but complete example showing what you want as input and what
you want as output?

--

Patrick TJ McPhee
East York Canada
pt**@interlog.c om
Jul 20 '05 #12

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

Similar topics

1
3385
by: Igor | last post by:
Is there any way to resort and xml document using xslt based on element position. For example if I have xml like this: <root> <element> 1st thing </element> <element> 2nd thing </element> <element> 3rd thing </element> </root> would it be possible using xslt only to reverse it into:
4
2395
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could generate any of the specific instances. sample schema one: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="base">
6
2467
by: Wole Ogunremi | last post by:
I guess this is a well asked question but it is tripping me up! I'm putting a forum together allowing xhtml markup content. I am validating against a schema but getting "Could not find schema information for element <elementName>... I would appreciate if anyone could advice where I am going wrong. TIA Here's my xsd:
0
1348
by: Leo | last post by:
In my XML file, I have to elements: "person" and "organization", which are exchangable. Since these two elements are nearly identical, I plan to write an abstract element "agent" in my schema and let "person" and "organization" inherit from "agent". However, my schema is invalid. Can anyone please point out what my problem is. Thanks a million in advance! Leo The following is my XML instance file:
5
3125
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are the defined contents of the TABLE element. The TR element is not defined as an "immediate" or "direct" contained element of TABLE. Given that
6
13378
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... html file (generated using .NET 2.0 beta2): <form method="post" action="Test2.aspx" id="form1">
1
1293
by: unwiseone | last post by:
Hello, Does any know how to specify a value of a DTD element? For example, here's an external DTD that I have: ======================================= <!ELEMENT summercamps (Camp+)> <!ELEMENT Camp (name, campcode?, ContactPhone, ContactPhone?, Activity+)>
4
2923
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a child element with an attribute set at a given value; maybe an example is more self-explaining... Given the following input XML document:
2
18152
by: mlb5000 | last post by:
I seem to be having issues validating an XML document using my schema. Both are below: The Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Receivers" > <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="MulticastReceiver"/>
0
9628
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7471
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.