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.SelectSingleNode("StyleList/Style/SLD/OnlineResource");
if (sldUrlNode == null)
{
// we need to create the SLD Node if it does not exist
XmlElement eStyleList =
m_context.CreateElement("StyleList");
XmlElement eStyle = m_context.CreateElement("Style");
eStyle.SetAttribute("current", "1");
eStyleList.AppendChild(eStyle);
XmlElement eSLD = m_context.CreateElement("SLD");
XmlElement eName = m_context.CreateElement("Name");
eName.InnerText = layerName;
eSLD.AppendChild(eName);
XmlElement eOnlineResource =
m_context.CreateElement("OnlineResource", "xlink");
eOnlineResource.SetAttribute("href",
"http://www.w3.org/1999/xlink", sldUrl);
eSLD.AppendChild(eOnlineResource);
eStyle.AppendChild(eSLD);
layerNode.AppendChild(eStyleList);
}
else
{
sldUrlNode.Attributes[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='DefaultNSDickster'
xmlns:xlink='http://www.w3c.org/1999/xlink'></root>")
eOnlineResource =
xdoc.CreateElement("eOnLineResource","DefaultNSDic kster")
eOnlineResource.SetAttribute("href",
"http://www.w3c.org/1999/xlink", "theValue")
xdoc.FirstChild.AppendChild(eOnlineResource)
-------------------------------------------------------------------------------------------------------------
The prefix will be in the XML.
Dickster