PC Review


Reply
Thread Tools Rate Thread

Can someone tell if Sitemap always require a starting root?

 
 
rlueneberg@gmail.com
Guest
Posts: n/a
 
      30th Aug 2006
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

 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      5th Sep 2006
In article <(E-Mail Removed)>,
(E-Mail Removed) 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)
 
Reply With Quote
 
rlueneberg@gmail.com
Guest
Posts: n/a
 
      5th Sep 2006
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("EntityHelper/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("EntityHelper/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 <(E-Mail Removed)>,
> (E-Mail Removed) 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)


 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      5th Sep 2006
In article <(E-Mail Removed)>,
(E-Mail Removed) 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)
 
Reply With Quote
 
rlueneberg@gmail.com
Guest
Posts: n/a
 
      5th Sep 2006
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">
<xslutput 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)


 
Reply With Quote
 
rlueneberg@gmail.com
Guest
Posts: n/a
 
      5th Sep 2006
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

 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      5th Sep 2006
In article <(E-Mail Removed)>,
(E-Mail Removed) 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)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Root, root, root for the Sony team HeyBub Windows XP General 1 29th Aug 2007 06:38 PM
What would cause a windows service to require two starts before starting up? rsine@stationeryhouse.com Microsoft Dot NET 0 7th Feb 2007 01:04 PM
Can Sitemap.CurrentNode use non default sitemap provider? AmitKu Microsoft ASP .NET 1 27th Sep 2006 01:25 PM
How to access web.sitemap file from other virtual directories other than the current application root folder? hvajja@gmail.com Microsoft ASP .NET 0 7th Aug 2006 09:26 PM
Emails that require follow-up often require a task. =?Utf-8?B?RGFuNjBoZXI=?= Microsoft Outlook Discussion 1 27th Jun 2006 02:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 AM.