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)