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

Can someone tell if Sitemap always require a starting root?

Can someone tell if Sitemap always require a starting root? Can it have
more than one root? I am having a problem trying to hide a root node
without hiding its children using a Treeview component. I know you can
do that if you use sitempadatasource. But instead I am forced to use
this tranformation:

xForm.Transform(m_TblMgr.XmlDoc, xslArgs, tmpS)

where tmpS is the sitemap output.

Thank you

Rod

Aug 30 '06 #1
6 1530
In article <11**********************@h48g2000cwc.googlegroups .com>,
rl********@gmail.com writes
>Can someone tell if Sitemap always require a starting root?
Yes
Can it have
more than one root?
No
>I am having a problem trying to hide a root node
without hiding its children using a Treeview component. I know you can
do that if you use sitempadatasource.
So why not do that then?
But instead I am forced to use
this tranformation:

xForm.Transform(m_TblMgr.XmlDoc, xslArgs, tmpS)

where tmpS is the sitemap output.

Thank you

Rod
--
Alan Silver
(anything added below this line is nothing to do with me)
Sep 5 '06 #2
Thanks Alan. I don't like my solution. I think having to run second
transformation on a large tree with over 2000 items again would affect
performance. It would be better do it right from the beginning don't
you think? Look what I did:
Removing "Categories from Root Node"

// TRANSFORM ROOT NODE TO REMOVE "CATEGORIES"
//load the Xml doc
XslTransform myXslTrans = new XslTransform();
//load the Xsl

myXslTrans.Load(CommonLogic.SafeMapPath("EntityHel per/RemoveRootNode.xslt"));
//create the output stream
StringWriter tmpS2 = new StringWriter();
//do the actual transform of Xml
myXslTrans.Transform(doc, null, tmpS2);

string s = tmpS2.ToString();
s = s.Replace("{","");
s = s.Replace("}","");
s = s.Replace(General.RegexSearch(s, @"<\?xml(.*?)>",
0), "");
s = "<siteMap>"+ s + "</siteMap>";
tmpS2.Close();
Removing "Categories from Root Node"

// TRANSFORM ROOT NODE TO REMOVE "CATEGORIES"
//load the Xml doc
XslTransform myXslTrans = new XslTransform();
//load the Xsl

myXslTrans.Load(CommonLogic.SafeMapPath("EntityHel per/RemoveRootNode.xslt"));
//create the output stream
StringWriter tmpS2 = new StringWriter();
//do the actual transform of Xml
myXslTrans.Transform(doc, null, tmpS2);

string s = tmpS2.ToString();
s = s.Replace("{","");
s = s.Replace("}","");
s = s.Replace(General.RegexSearch(s, @"<\?xml(.*?)>",
0), "");
s = "<siteMap>"+ s + "</siteMap>";
tmpS2.Close();
Rod

Alan Silver wrote:
In article <11**********************@h48g2000cwc.googlegroups .com>,
rl********@gmail.com writes
Can someone tell if Sitemap always require a starting root?

Yes
Can it have
more than one root?

No
I am having a problem trying to hide a root node
without hiding its children using a Treeview component. I know you can
do that if you use sitempadatasource.

So why not do that then?
But instead I am forced to use
this tranformation:

xForm.Transform(m_TblMgr.XmlDoc, xslArgs, tmpS)

where tmpS is the sitemap output.

Thank you

Rod

--
Alan Silver
(anything added below this line is nothing to do with me)
Sep 5 '06 #3
In article <11**********************@e3g2000cwe.googlegroups. com>,
rl********@gmail.com writes
>Thanks Alan. I don't like my solution. I think having to run second
transformation on a large tree with over 2000 items again would affect
performance. It would be better do it right from the beginning don't
you think? Look what I did:
<snip>

This looks very complex for a site map. How often do you do this? Does
your site map change that often?

Why not just write the site map out to a file whenever it changes. That
will give you the advantage of only needing to run the code whenever
changes occur, not whenever you want to get the data, plus it allows you
to use the sitemapprovider, which will give you the extra functionality
you want.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Sep 5 '06 #4
I forgot to post piece RemoveRootNode.XSLT.
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="siteMapNode">
<xsl:copy-of select="child::node()" />
</xsl:template>
</xsl:stylesheet>

This looks very complex for a site map. How often do you do this? Does
your site map change that often?

We do change a lot. Our cateogories change every week and we tend to
add and remove frequently.

Why not just write the site map out to a file whenever it changes.
I can't touch the DLL file that generate the nodes it. Yeah I know that
the provider has a property for the starting node where you can specify
the starting point of the tree. But using the provider would still
require mapping it to the Treview Datasource and may be a little bit
slower and work similarly in the same way of a second transform.

Rod

That
will give you the advantage of only needing to run the code whenever
changes occur, not whenever you want to get the data, plus it allows you
to use the sitemapprovider, which will give you the extra functionality
you want.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Sep 5 '06 #5
Alan, I forgot to ask if the fact that the siteMap necessarly needs a
single root not is part of its schema constrain ? I've seen XML with
more than one root. Why is this way if Microsoft want to use for
multiple purposes binding controls, not only for creating site maps? It
doen't make sense? Unless they want it to be used only for Hierarchical
"Site Maps"

Rod

Sep 5 '06 #6
In article <11**********************@m73g2000cwd.googlegroups .com>,
rl********@gmail.com writes
>Alan, I forgot to ask if the fact that the siteMap necessarly needs a
single root not is part of its schema constrain ? I've seen XML with
more than one root.
I don't think XML requires a single root node, but then I'm not expert,
but sitemap files certainly do.
Why is this way if Microsoft want to use for
multiple purposes binding controls, not only for creating site maps? It
doen't make sense? Unless they want it to be used only for Hierarchical
"Site Maps"
Well, it *is* called a "site map" and they obviously feel that a site
map always has one root node, ie the home page. Logical really.

--
Alan Silver
(anything added below this line is nothing to do with me)
Sep 5 '06 #7

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

Similar topics

6
by: George Styles | last post by:
Hi, I am trying to work out what a block of C++ does, but I am having trouble understanding the syntax. I know Delphi well, so am happy with objects etc, its just this syntax I dont understand. ...
5
by: reezaali | last post by:
Hi All I keep getting back VINET and not Lilas...can someone point me in the right direction? Thanks a lot DECLARE @idoc int DECLARE @doc varchar(1000)
8
by: MLH | last post by:
If I choose to dim MyDate as Date or MyDate as Variant, what is the most significant difference between the two choices?
21
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97...
4
by: Jan | last post by:
This is my problem: When i have more than 3 lines of text in de tempArray. Iget the following message: An unhandled exception of type 'System.NullReferenceException' occurred in Allen's...
2
by: Just Me | last post by:
Dim iData As IDataObject = Clipboard.GetDataObject() Dim img As System.Drawing.Bitmap img = img.FromFile(ofd.FileName, True) Clipboard.SetDataObject(img) TextControl1.Paste() img.Dispose() : img...
6
by: thomas.luce | last post by:
Okay, I have been programming for a long time, and am getting back into C after about a 4 year break from it. Below is some code that won't compile for the life of me, and it is driving me crazy!...
2
by: ppuniversal | last post by:
Hello, Can someone tell a good Tutorial on Network Programming in C++, except Beej's Guide and Vijay Mukhi's tutorials. I want to make a Client Server application in C++ which will involve...
0
by: Saboor Mohideen | last post by:
Can someone tell me which event occurs on Total TextBox: Main Form Name Type Event Used Event Set All three textboxes are bound to a table CashAmount TextBox ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.