473,387 Members | 1,624 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,387 software developers and data experts.

Re: obtain element name, or attribute and value of the document nameitself, and some elemnts and attributes from an ancestor or the node itselfusing xquery

kishjeff wrote:
I tried using this for fun (notice the extra base-uri($d) in the
beginning of the last
return statement):

string-join(
for $d in
collection('.?select=test20081030*.xml')[descendant::table[@relation]]
return
Add parentheses e.g
(base-uri($d),(tokenize(base-uri($d), '/')[last()], '',
base-uri($d),(tokenize(base-uri($d), '/')[last()], '',
concat('segment speed="',
$d//table[@relation]/ancestor::segment/@speed, '"'),
for $t in $d//table[@relation]
return concat($t/@id, ' relation="', $t/@relation, '"'), '')
)
, ' ')


--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 30 '08 #1
0 908

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

Similar topics

4
by: Jean-Christophe Michel | last post by:
Hi, In a complex merging of two (non ordered) xml files i need to keep track of the elements of the second tree that were already merged with first tree, to copy only unused elements at the end....
6
by: ai2003lian | last post by:
Assuming I have the following two xml file: source.xml: <AllFields> <Group name="G1"> <Field fieldName="f1">Value1</Field> <Field fieldName="f2">Value2</Field> <Field...
21
by: TheKeith | last post by:
I heard that the name attribute is deprecated in html 4.01 strict. Is it recommended that you use the ID attribute for images along with the getElementById method instead of the old way? Thanks.
2
by: Mike | last post by:
I´ve got a number of SPAN elements named "mySpan1", "mySpan2", "mySpan3" etc, and want to set their "style.display" to "inline". This works (only needs to work on IE5.5+): for (var x = 1; x <...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
3
by: pagates | last post by:
Hi All, This is a pretty simple question, but with possibly a complex answer. I was wondering if anybody had any opinions or links for "rules" as to when to use elements and when to use...
3
by: Valvalis | last post by:
Hello, I am trying to set a class attribute of a text.item element to the value of its nearest ancestor. I want to do this in the case that the class of the text.item is currently a blank string....
2
by: =?Utf-8?B?S2V2aW4=?= | last post by:
I have an XML node that has both attributes and text. I am having difficulty getting the xmlreader to deal with this. Sample XML Node: <HomePhoneNumber Attribute1="Y" Attribute2="Y"...
3
markmcgookin
by: markmcgookin | last post by:
Hi, I have the following XML <AnswerList xmlns="http://tempuri.org/ALPS_Assessmentv1p1_RESCO_Schema.xsd"> <DateTimeLastSaved>12:12:12 1900</DateTimeLastSaved> <UserName>Bob</UserName>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.