473,387 Members | 1,573 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.

Select a node by name in file with a parameter from another file

I have two xml file
1) xml source:
<Indici>
<F1>xxx</F1>
<F2>yyy</F2>
</Indici>
2) File colsDef.xml:

<Columns>
<Column>
<evento>F1</evento>
</Column>
</columns>

I want to take text of node where node name is defined in file colsDef.xml
I use this xsl:

<xsl:variable name="doc" select="document('colsDef.xml')"/>
<table>
<xsl:for-each select="Indici">
<tr>
<xsl:variable name="nodo" select="."/>
<xsl:for-each select="$doc/Columns/Column">
<td>
<xsl:variable name="evento" select="evento"/>
<!--HERE IS THE PROBLEM -->
<xsl:value-of select="$nodo[name()=$evento]"/>

</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>

Can anyone help me?
Thank you


Jul 20 '05 #1
1 1469


<xsl:for-each select="Indici">

so here the current node has name Indici, and that's the node that gets
saved in nodo:

<xsl:variable name="nodo" select="."/>
so this

<xsl:value-of select="$nodo[name()=$evento]"/>

will be empty unless $evento is "Indici".

It looks like you want to select children of Indici, so:

<xsl:value-of select="$nodo/*[name()=$evento]"/>
^^

David
Jul 20 '05 #2

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

Similar topics

1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
6
by: Eddy C | last post by:
Hi, I'm trying to get the value of another node using the position of another node or the name of the tag. Such that the current node is one of the contacts child nodes sec or prim and doing...
6
by: Chuck | last post by:
What's the difference between using "catalog node" and catalog admin node"? -- Chuck Remove "_nospam" to reply by email
0
by: Greg Walker | last post by:
I have a bizarre, but easily tested problem. ANY select option containing HTML encoded characters appear as blank lines for Mac IE 5.2. when the page is served as an ASPX page. The EXACT SAME...
2
by: Scott M. Lyon | last post by:
I'm trying to figure out the best way (considering there could be instances where I get a lot of data in this XML, and I want to minimize any slowdowns) to extract the value of one particular node...
2
by: junkblog747 | last post by:
What will the expression "/.." in the attribute select="/.." return? I just inherited a huge stylesheet to maintain which has a lot of parameters such as <xsl:param name="myParam"...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
1
by: Zachary Turner | last post by:
I want to select some nodes based on whether or not another node exists in another part of the document with the exact same name. For example, <special-location> <special-element...
0
by: Dave Mathew | last post by:
I'm in the process of building some navigation for a website. I would like to use the capabilities of the sitemap in asp.net but have ran into some styling/usability issues in the past using just...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.