hi again Agni,
I kept forgetting to post this back :p
If this is a snippet of my myschema.xsd file:
<xsd:element name="grossEstimationItem">
<xsd:complexType>
<xsd:sequence/>
<xsd:attribute ref="my:hourly_rate"/>
<xsd:attribute ref="my:hours"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="Gross_Est_Cost" nillable="true" type="xsd:double"/>
and in my code, i've defined the namespace to be:
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-04T02:16:49" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xmlns:xsd="http://www.w3.org/2001/XMLSchema"');
And later on, when I tried retrieve each node data type using:
var schemaDOM = XDocument.CreateDOM();
schemaDOM.load("myschema.xsd");
var type = schemaDOM.selectSingleNode("xsd:"+fieldname).text;
It would issue an error msg of:
"Reference to undeclared namespace prefix: 'xsd'."
Do you have any idea why trigger the error msg? I think I've declared the 'xsd' namespace correct, havent I?