473,651 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 sitempadatasour ce. But instead I am forced to use
this tranformation:

xForm.Transform (m_TblMgr.XmlDo c, xslArgs, tmpS)

where tmpS is the sitemap output.

Thank you

Rod

Aug 30 '06 #1
6 1542
In article <11************ **********@h48g 2000cwc.googleg roups.com>,
rl********@gmai l.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 sitempadatasour ce.
So why not do that then?
But instead I am forced to use
this tranformation:

xForm.Transfor m(m_TblMgr.XmlD oc, 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.Sa feMapPath("Enti tyHelper/RemoveRootNode. xslt"));
//create the output stream
StringWriter tmpS2 = new StringWriter();
//do the actual transform of Xml
myXslTrans.Tran sform(doc, null, tmpS2);

string s = tmpS2.ToString( );
s = s.Replace("{"," ");
s = s.Replace("}"," ");
s = s.Replace(Gener al.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.Sa feMapPath("Enti tyHelper/RemoveRootNode. xslt"));
//create the output stream
StringWriter tmpS2 = new StringWriter();
//do the actual transform of Xml
myXslTrans.Tran sform(doc, null, tmpS2);

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

Alan Silver wrote:
In article <11************ **********@h48g 2000cwc.googleg roups.com>,
rl********@gmai l.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 sitempadatasour ce.

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

xForm.Transform (m_TblMgr.XmlDo c, 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************ **********@e3g2 000cwe.googlegr oups.com>,
rl********@gmai l.com writes
>Thanks Alan. I don't like my solution. I think having to run second
transformati on 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:styleshe et
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="siteMapN ode">
<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************ **********@m73g 2000cwd.googleg roups.com>,
rl********@gmai l.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
1822
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. The code is void CRipPanel::OnPaint()
5
1302
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
1847
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
3489
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 database for an attorney's office. I'm sure it must be do-able. I know better than to mention the term "S__dK__ys" in conjunction with this topic. I've read enough in here to know that is extremely unreliable. Am sorry even that I have to use IE...
4
1987
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 Woodshop.exe Additional information: Object reference not set to an instance of an object.
2
1592
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 = Nothing Clipboard.SetDataObject(iData) I want to insert an image and tried the above. I wanted to not disturb the clipboard and didn't know how to do that so I
6
2203
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! If anyone can see anything that I can't, I would love to know. All the code is pasted, although in my real code it is broken into a header and a seperate .c file. #include <stdlib.h> typedef enum {typeNum, typeString} VariableType;
2
8543
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 huge amount of thread programming also, so I wanted a good tutorial which can give me good understanding of all the functions used for Network Programming using Standard C++ (and not using any Network Library other than Winsocks and those available in...
0
1374
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 AfterUpdate CashAmount+ChequeAmount=Total ChequeAmount TextBox AfterUpdate CashAmount+ChequeAmount =Total Total TextBox ? SubForm I need to auto-change the subform amount corresponding to Changes in Total TextBox on the...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5612
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
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 we have to send another system

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.