473,466 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filter XML to pass to XSL and import into my control?

I'm still struggling to figure out the big-picture concept of how to go
about building a web site menu from an xml file.

The XML file contains the full site structure (the site map, so-to-speak).
Based on the current page of the site, I want to be able to do the
following:

get node that pertains to current page
get node's siblings
get node's parents
get node's parents siblings
repeat until top node...
Pass this filtered XML to an XSLT file
import xhtml result into my usercontrol to display on page

I asked this yesterday but was a bit too wordy I think. Does the above sound
like the correct way to go about doing things? If so, how dows one best sort
the XML to pull out a subset?

-Darrel
Nov 12 '05 #1
3 2172
If in your Xml each node that corresponds to a page has a unique id you
should be able to do the "filtering" along with the transformation all in
the XSLT.

For example.
Step 1: Pass unique Id of the current page to the Xslt as a parameter.
Step 2: Using the parameter in XPath to find the node corresponding to
current page & do <xsl:apply-templates> on it.
Step 3: In the <xsl:template> node for the current page, generate HTML for
menu of current page. Then use the "parent() " XPath function, to locate the
parent node & do <xsl:apply-templates> on the parent.
Step 4: In the <xsl:template> for parent, generate HTML for menu of the
parent & recursively use the "parent()" function to do <xsl:apply-templates>

-Naraen
---------------------------------------------
"darrel" <no*****@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
I'm still struggling to figure out the big-picture concept of how to go
about building a web site menu from an xml file.

The XML file contains the full site structure (the site map, so-to-speak).
Based on the current page of the site, I want to be able to do the
following:

get node that pertains to current page
get node's siblings
get node's parents
get node's parents siblings
repeat until top node...
Pass this filtered XML to an XSLT file
import xhtml result into my usercontrol to display on page

I asked this yesterday but was a bit too wordy I think. Does the above sound like the correct way to go about doing things? If so, how dows one best sort the XML to pull out a subset?

-Darrel

Nov 12 '05 #2
> If in your Xml each node that corresponds to a page has a unique id you
should be able to do the "filtering" along with the transformation all in
the XSLT.


Ah! That certainly sounds like the most streamlined way to go about it.

Now, the getParent thing makes sense...specifically for whipping out a
breadcrumb trail. Is there a way to pull out siblings as well? I see ways to
get next and previous sibling. Is there a way to simply do a 'if sibling of
[ID]' type of loop?

-Darrel
Nov 12 '05 #3
One alternative would be to get children of the parent of the current node,
something like ../child:: ...

A less messy approach is possible if the ID is unique in the scope of the
document. Then you can use <xsl:key> & the key().

-Naraen

-------------
"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
If in your Xml each node that corresponds to a page has a unique id you
should be able to do the "filtering" along with the transformation all in the XSLT.
Ah! That certainly sounds like the most streamlined way to go about it.

Now, the getParent thing makes sense...specifically for whipping out a
breadcrumb trail. Is there a way to pull out siblings as well? I see ways

to get next and previous sibling. Is there a way to simply do a 'if sibling of [ID]' type of loop?

-Darrel

Nov 12 '05 #4

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

Similar topics

9
by: Robin Cull | last post by:
Imagine I have a dict looking something like this: myDict = {"key 1": , "key 2": , "key 3": , "key 4": } That is, a set of keys which have a variable length list of associated values after...
3
by: George Ter-Saakov | last post by:
I have a Response.Filter set. Will it affect caching (by ASP.NET) of my page? Basically the question is caching happens before or after filtering? My understanding ,because partial caching...
7
by: Mike | last post by:
I'm trying to filter a dataset on items that are being passed in via a querystring. the string looks like this. chevy|ford|BMW| on the information page i split the string such as...
1
by: LabWINC | last post by:
Hi all, i would like to design a high pass filter with scipy.signal module. This is the code i'm using to: import scipy.signal as signal import scipy #first of all i design the lowpass fir...
1
by: TheSaint | last post by:
Hello NG, Curious to know whether exists a filter class. I'm doing some rough mail filtering on my own criteria, but I'm very new on programming and I like to find some clue on passing a config...
0
bartonc
by: bartonc | last post by:
By encapsulating just a few fuctions from two library modules, we get a clear picture of what a digital filter looks like. Also, by splitting __init__ into two section, the filter's creation...
0
by: Chris Curvey | last post by:
Hi all, I'm trying to write an ISAPI filter in Python, using the examples that come in the "isapi" directory of the win32com package. The installation program itself runs fine, but when I...
3
by: Mr 200 | last post by:
Hi all ive just recently started learning java and was happy to find a forum that may be able to give me a little assistance. I have been set an excersize to create a filter processor that relays...
5
Jerry911
by: Jerry911 | last post by:
Hi, I have a query that I use to export data to a spreadsheet. The query itself works fine and I can manually edit the query to supply filtered information. What I would like to do is use a form...
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
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
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
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...
0
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 ...

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.