Thanks but that still doesn't work. I think it has to do with the fact that
I am operating on a node and not a document. Here is my code:
XmlNode sldUrlNode =
layerNode.Selec tSingleNode("St yleList/Style/SLD/OnlineResource" );
if (sldUrlNode == null)
{
// we need to create the SLD Node if it does not exist
XmlElement eStyleList =
m_context.Creat eElement("Style List");
XmlElement eStyle = m_context.Creat eElement("Style ");
eStyle.SetAttri bute("current", "1");
eStyleList.Appe ndChild(eStyle) ;
XmlElement eSLD = m_context.Creat eElement("SLD") ;
XmlElement eName = m_context.Creat eElement("Name" );
eName.InnerText = layerName;
eSLD.AppendChil d(eName);
XmlElement eOnlineResource =
m_context.Creat eElement("Onlin eResource", "xlink");
eOnlineResource .SetAttribute(" href",
"http://www.w3.org/1999/xlink", sldUrl);
eSLD.AppendChil d(eOnlineResour ce);
eStyle.AppendCh ild(eSLD);
layerNode.Appen dChild(eStyleLi st);
}
else
{
sldUrlNode.Attr ibutes[0].Value = sldUrl;
}
}
}
"dickster" wrote:
See: http://www.dotnet247.com/247referenc...43/216508.aspx
-------------------------------------------------------------------------------------------------------------
Dim xdoc As New XmlDocument
Dim eOnlineResource As XmlElement
xdoc.LoadXml("< root xmlns='DefaultN SDickster'
xmlns:xlink='ht tp://www.w3c.org/1999/xlink'></root>")
eOnlineResource =
xdoc.CreateElem ent("eOnLineRes ource","Default NSDickster")
eOnlineResource .SetAttribute(" href",
"http://www.w3c.org/1999/xlink", "theValue")
xdoc.FirstChild .AppendChild(eO nlineResource)
-------------------------------------------------------------------------------------------------------------
The prefix will be in the XML.
Dickster