Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
GeneralRe: thread is blocking the gui form, why? [modified] Pin
Krzysztof Gorgolewski15-Apr-07 22:45
Krzysztof Gorgolewski15-Apr-07 22:45 
AnswerRe: thread is blocking the gui form, why? Pin
Guffa16-Apr-07 0:38
Guffa16-Apr-07 0:38 
GeneralRe: thread is blocking the gui form, why? Pin
Krzysztof Gorgolewski16-Apr-07 1:12
Krzysztof Gorgolewski16-Apr-07 1:12 
AnswerRe: thread is blocking the gui form, why? Pin
Martin#15-Apr-07 21:55
Martin#15-Apr-07 21:55 
GeneralRe: thread is blocking the gui form, why? Pin
Krzysztof Gorgolewski15-Apr-07 22:20
Krzysztof Gorgolewski15-Apr-07 22:20 
GeneralRe: thread is blocking the gui form, why? Pin
Martin#15-Apr-07 22:36
Martin#15-Apr-07 22:36 
Answerthanks to all Pin
Krzysztof Gorgolewski16-Apr-07 4:57
Krzysztof Gorgolewski16-Apr-07 4:57 
Questionxpath Vs xml validation with xsd Pin
praveenkumar palla15-Apr-07 21:05
praveenkumar palla15-Apr-07 21:05 
Initially XML file is like this

<?xml version="1.0" ?>
<lasers>
<laser LaserName="Laser1" ModelName="Nufern v1.0" SerialNo="1" ManufacturerName="Nufern v1.0" Maximumpower="200w" >
<properties">
<image>CW-Waveform.jpg</image>
<WaveTypes>
<WaveType Name="CW Ramp" url="ramp.html" isavailable="true" />
<WaveType Name="CW Analog" url="analog.html" isavailable="true" />
</WaveTypes>
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true" units="C" gauge="false" thresholdval="10" />
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="false" units="C" gauge="true" thresholdval="10" />
</tabular>
</properties>
</laser>
</lasers>

then

>>>>>>>>>>>>>>>>>>>>namespace is EncryptDecrypt

XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Application.StartupPath + @"\laserProp.xml");
XmlNamespaceManager mgr = new XmlNamespaceManager(xmldoc.NameTable);
mgr.AddNamespace(string.Empty, "urn:MyNamespace");
XmlNodeList xmlnodelist;
XmlElement ele = xmldoc.DocumentElement;
xmlnodelist= ele.SelectNodes("//lasers//laser//properties//tabular//property",mgr);

Is working fine but, to validate xml with xsd i made changes to the xml as


<?xml version="1.0" ?>
<lasers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="urn:MyNamespace" xsi:schemaLocation="urn:MyNamespace laserProp.xsd">
<laser LaserName="Laser1" ModelName="Nufern v1.0" SerialNo="1" ManufacturerName="Nufern v1.0" Maximumpower="200w" xmlns:ns="urn:MyNamespace">
<properties xmlns:ns="urn:MyNamespace">
<image>CW-Waveform.jpg</image>
<WaveTypes>
<WaveType Name="CW Ramp" url="ramp.html" isavailable="true" />
<WaveType Name="CW Analog" url="analog.html" isavailable="true" />
</WaveTypes>
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true" units="C" gauge="false" thresholdval="10"/>
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="false" units="C" gauge="true" thresholdval="10"/>
</tabular>
</properties>
</laser>
</lasers>

Now the same xpath is working fine but getting validation errors
my xml scheema file is(xsd file)

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:MyNamespace">
<xs:element name="lasers">
<xs:complexType>
<xs:sequence>
<xs:element name="laser">
<xs:complexType>
<xs:sequence>
<xs:element name="properties">
<xs:complexType>
<xs:sequence>
<xs:element name="image" type="xs:string" />
<xs:element name="WaveTypes">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="WaveType">
<xs:complexType>
<xs:attribute name="Name" type="xs:string" use="required" />
<xs:attribute name="url" type="xs:string" use="required" />
<xs:attribute name="isavailable" type="xs:boolean" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tabular">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="property">
<xs:complexType>
<xs:attribute name="id" type="xs:integer" use="required" />
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="currval" type="xs:integer" use="required" />
<xs:attribute name="prgbar" type="xs:boolean" use="required" />
<xs:attribute name="selected" type="xs:boolean" use="required" />
<xs:attribute name="min" type="xs:integer" use="required" />
<xs:attribute name="max" type="xs:integer" use="required" />
<xs:attribute name="pwd" type="xs:boolean" use="required" />
<xs:attribute name="units" type="xs:string" use="required" />
<xs:attribute name="gauge" type="xs:boolean" use="required" />
<xs:attribute name="thresholdval" type="xs:integer" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="LaserName" type="xs:string" use="required" />
<xs:attribute name="ModelName" type="xs:string" use="required" />
<xs:attribute name="SerialNo" type="xs:integer" use="required" />
<xs:attribute name="ManufacturerName" type="xs:string" use="required" />
<xs:attribute name="Maximumpower" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

please help me on this
thanks in advance

praveenkumar palla
AnswerRe: xpath Vs xml validation with xsd Pin
Stefan Troschuetz15-Apr-07 21:10
Stefan Troschuetz15-Apr-07 21:10 
GeneralRe: xpath Vs xml validation with xsd Pin
praveenkumar palla15-Apr-07 21:23
praveenkumar palla15-Apr-07 21:23 
GeneralRe: xpath Vs xml validation with xsd Pin
Stefan Troschuetz15-Apr-07 21:34
Stefan Troschuetz15-Apr-07 21:34 
GeneralRe: xpath Vs xml validation with xsd Pin
praveenkumar palla15-Apr-07 21:49
praveenkumar palla15-Apr-07 21:49 
GeneralRe: xpath Vs xml validation with xsd Pin
Stefan Troschuetz15-Apr-07 22:06
Stefan Troschuetz15-Apr-07 22:06 
AnswerARE YOU MENTAL ???? Pin
Christian Graus15-Apr-07 21:55
protectorChristian Graus15-Apr-07 21:55 
GeneralRe: ARE YOU MENTAL ???? Pin
Jaiprakash M Bankolli15-Apr-07 22:23
Jaiprakash M Bankolli15-Apr-07 22:23 
GeneralRe: ARE YOU MENTAL ???? Pin
Christian Graus15-Apr-07 22:48
protectorChristian Graus15-Apr-07 22:48 
GeneralRe: ARE YOU MENTAL ???? Pin
Pete O'Hanlon15-Apr-07 22:50
mvePete O'Hanlon15-Apr-07 22:50 
GeneralRe: ARE YOU MENTAL ???? Pin
Jaiprakash M Bankolli15-Apr-07 23:45
Jaiprakash M Bankolli15-Apr-07 23:45 
GeneralRe: ARE YOU MENTAL ???? Pin
Pete O'Hanlon15-Apr-07 22:31
mvePete O'Hanlon15-Apr-07 22:31 
GeneralRe: ARE YOU MENTAL ???? Pin
Christian Graus15-Apr-07 23:13
protectorChristian Graus15-Apr-07 23:13 
GeneralRe: ARE YOU MENTAL ???? Pin
Pete O'Hanlon15-Apr-07 23:57
mvePete O'Hanlon15-Apr-07 23:57 
Questionxpath Vs xml validation with xsd Pin
praveenkumar palla15-Apr-07 21:03
praveenkumar palla15-Apr-07 21:03 
AnswerRe: xpath Vs xml validation with xsd Pin
Pete O'Hanlon15-Apr-07 22:20
mvePete O'Hanlon15-Apr-07 22:20 
Questiontree view in asp.net Pin
ayyp15-Apr-07 20:57
ayyp15-Apr-07 20:57 
AnswerRe: tree view in asp.net Pin
Christian Graus15-Apr-07 20:58
protectorChristian Graus15-Apr-07 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.