Hi,
I have an xml file is as follows
<?xml version="1.0" encoding="UTF-8"?>
<Package Id="Test"
xmlns="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0
http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd">
<PackageHeader>
<XPDLVersion>1.0</XPDLVersion>
<Vendor>Together</Vendor>
<Created>2003-08-12 14:52:08</Created>
</PackageHeader>
<RedefinableHeader PublicationStatus="UNDER_TEST"/>
</Package>
Now if I try to access using the Xpath
Query "//Package/PackageHeader/*", it returns nothing.
But when I remove the namespace
definition "xmlns="http://www.wfmc.org/2002/XPDL1.0", it
works.
The following is the code used.
objXPathActivities = new XPathDocument("C:\test.xml");
objXPathNavigator = objXPathActivities.CreateNavigator();
objXPathNodeIterator = objXPathNavigator.Select
("//Package/PackageHeader/*")
Can anyone suggest me a solution for this problem?
I found entries for adding the Namespace prefix in the
newsgroups, but I could not find an entry for using
namespace without prefix. Please suggest me a solution.
Thanks in advance.
Regards,
Ramesh