473,320 Members | 2,098 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,320 software developers and data experts.

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 1904
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:stylesheet
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.sourceforge.net/has a .NET and a Java version,
AltovaXML <URL:http://www.altova.com/altovaxml.htmlis a COM solution,
Gestalt <URL:http://gestalt.sourceforge.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
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...
16
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...
1
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...
5
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...
1
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...
24
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...
11
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....
1
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...
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.