473,569 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

carrying xml name spaces across nested elements


Hi. By persistence, I've discovered that when several nested elements
in a schema are each qualified by a namespace, I can successfully
reference them in a select statement by qualifying each element by its
namespace in succession. For example, for a schema that qualfies each
element in a nested series "command, heading, pivot table" by "xs", I
can use an xpath statement like "//xs:command/xs:heading/
xs:pivotTable" to select the pivot table node.

I figure that when all the name space qualifications are identical,
there's some way to carry the namespace across all the elements
without typing exact same one for each separately. Is there? If so,
could someone tell me what it is?

Thanks for any help!
Mar 27 '08 #1
1 1923
Datawich wrote:
Hi. By persistence, I've discovered that when several nested elements
in a schema are each qualified by a namespace, I can successfully
reference them in a select statement by qualifying each element by its
namespace in succession. For example, for a schema that qualfies each
element in a nested series "command, heading, pivot table" by "xs", I
can use an xpath statement like "//xs:command/xs:heading/
xs:pivotTable" to select the pivot table node.

I figure that when all the name space qualifications are identical,
there's some way to carry the namespace across all the elements
without typing exact same one for each separately. Is there? If so,
could someone tell me what it is?
With XSLT 2.0 and XPath 2.0 there is an XPath default namespace that you
can set e.g.
<xsl:styleshe et
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="2.0"
xpath-default-namespace="http ://example.com/2008/ns1">

<xsl:template match="/">
<xsl:value-of select="//command/heading/pivotTable"/>
so that way you don't need a prefix.

Is that what you have in mind, avoiding to type the prefix 'xs'?

XSLT and XPath 2.0 are not supported by Microsoft products but there are
third party implementations , Saxon from
<URL:http://saxon.sourcefor ge.net/has a .NET and a Java version,
AltovaXML <URL:http://www.altova.com/altovaxml.htmli s a COM solution,
Gestalt <URL:http://gestalt.sourcef orge.net/has binaries for different
platforms.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 27 '08 #2

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

Similar topics

2
2420
by: J. Muenchbourg | last post by:
Even when I try using LTrim function, I have one variable that has two mysterious spaces in front of it when i pass it to the next page in a query string <a href="timestar-nevada-salesview.asp?resortname=<%=rstime("resortname")%> &resortstate=<%=rstime("resortstate") the resortname variable gets two spaces thrown in front of it for some...
16
2026
by: Tommy Carlier | last post by:
I've created a data structuring format (you can't really call it a markup language), that behaves like XML, but that's much more flexible. You can have elements without names, attributes without names, you don't need something like CDATA or entities, and there's no such thing as DTD. Now I'm looking for an interesting name for it. I've...
1
2167
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not work. It works if the tags are <input type=radio...>. This line is OK:
5
2816
by: horndude77 | last post by:
Ok, this might be for a web designing group, but here's my problem. I'm trying to make a web page with tabs which you can navigate between without the page reloading. I have one set of tabs working great, but when I add nested tabs there is a problem with the 'visibility' not being inherited and some parts stay visible in the sub-tabs. Sorry...
1
2069
by: Ani | last post by:
Hi, I need to carry the user input across pages and then at the end insert all the values into the DB. How do I best accomplish this task in ASP.Net. I am a novice , please give me some simple suggestions. Thanks.
24
2489
by: Chameleon | last post by:
This code does not working in Mozilla. Works fine in IE. -------------- <input type=text value=100 name=textbox> <script> alert(textbox); </script> -------------- This perhaps, because of Microsoft policy to globalize all tag names. Is there any method for cross-browser fix without using getelementbyid?
11
5821
by: Jasbird | last post by:
Has the name attribute deprecated? I ask this because ASP.NET 2 warns me against using it, says that it has been deprecated and doesn't use it (on the client) when creating a radio button list. I always thought that a HTML radio button list was made by giving all the buttons the same name but different IDs? What's going on here?
1
5054
devonknows
by: devonknows | last post by:
Hi, im having trouble carrying variables across a form, ive looked on here and other sites but cant find anything that helps me, or i might not be searching for the right terms, so i though i would post to see if anyone can help me. what i need is to carry certain aspects of data from splash form to my main form which im currently developing. ...
1
11775
by: =?Utf-8?B?SmVyZW15X0I=?= | last post by:
I am working on an order entry program and have a question related to deserializing nodes with nested elements. The purchase order contains multiple line items which I select using an XmlNodeList. I am trying to deserialize the nodes using a foreach as follows: foreach(XmlNode lineItem in LineItemsNodeList) An abbreviated example of the...
0
7703
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...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
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...
1
7678
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...
0
3656
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...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
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...

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.