Hi
I am verifying a SLD implementation using xml, however I have som problem
using xpath and default namespaces in vb.net
Currently I have the following xml
<?xml version="1.0"?>
<StyledLayerDes criptor version="1.0.0"
xsi:schemaLocat ion="http://www.opengis.net/sld
http://schemas.opengis .net/sld/1.0.0/StyledLayerDesc riptor.xsd"
xmlns:sld="http ://www.opengis.net/sld" xmlns:ogc="http ://www.opengis.net/ogc"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<Name>TestNam e</Name>
<Title>TestTitl e</Title>
<Abstract>TestA bstract</Abstract>
</StyledLayerDesc riptor>
and the following code to read it:
Dim writer As Xml.XmlTextWrit er = New Xml.XmlTextWrit er(file, Nothing)
doc.Load(file)
where file is the location of the xml and doc is a xmldocument objekt
I ask with:
Dim r As Xml.XmlNode = doc.SelectSingl eNode("/StyledLayerDesc riptor/Name")
Console.WriteLi ne("Name " & r.InnerXml)
The return value is nothing, any clue of why??? If I dont use default
namespace, then it can be found.
rrm
I am verifying a SLD implementation using xml, however I have som problem
using xpath and default namespaces in vb.net
Currently I have the following xml
<?xml version="1.0"?>
<StyledLayerDes criptor version="1.0.0"
xsi:schemaLocat ion="http://www.opengis.net/sld
http://schemas.opengis .net/sld/1.0.0/StyledLayerDesc riptor.xsd"
xmlns:sld="http ://www.opengis.net/sld" xmlns:ogc="http ://www.opengis.net/ogc"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<Name>TestNam e</Name>
<Title>TestTitl e</Title>
<Abstract>TestA bstract</Abstract>
</StyledLayerDesc riptor>
and the following code to read it:
Dim writer As Xml.XmlTextWrit er = New Xml.XmlTextWrit er(file, Nothing)
doc.Load(file)
where file is the location of the xml and doc is a xmldocument objekt
I ask with:
Dim r As Xml.XmlNode = doc.SelectSingl eNode("/StyledLayerDesc riptor/Name")
Console.WriteLi ne("Name " & r.InnerXml)
The return value is nothing, any clue of why??? If I dont use default
namespace, then it can be found.
rrm
Comment