Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
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 
Initially XML file is like this


<lasers>
<laser lasername="Laser1" modelname="Nufern v1.0" serialno="1" manufacturername="Nufern v1.0" maximumpower="200w">
<properties">
CW-Waveform.jpg
<wavetypes>
<wavetype name="CW Ramp" url="ramp.html" isavailable="true">
<wavetype name="CW Analog" url="analog.html" isavailable="true">

<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">





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



<lasers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <u="">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" <u="">xmlns:ns="urn:MyNamespace">
<properties <u="">xmlns:ns="urn:MyNamespace">
CW-Waveform.jpg
<wavetypes>
<wavetype name="CW Ramp" url="ramp.html" isavailable="true">
<wavetype name="CW Analog" url="analog.html" isavailable="true">

<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">





Now the same xpath is working fine but getting validation errors

my xml scheema file(xsd file) is


<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: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: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">







please help me on this
thanks in advance








praveenkumar palla
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 
Questionhow to create a crystal report using a dataset Pin
rkherath15-Apr-07 20:46
rkherath15-Apr-07 20:46 
AnswerRe: how to create a crystal report using a dataset Pin
Judah Gabriel Himango16-Apr-07 10:09
sponsorJudah Gabriel Himango16-Apr-07 10:09 
QuestionWPF: Custom panel, exception [modified] Pin
espeholt_jr15-Apr-07 20:45
espeholt_jr15-Apr-07 20:45 
QuestionHelp me uninstall in C# window form application Pin
phantanagu15-Apr-07 20:37
phantanagu15-Apr-07 20:37 
AnswerRe: Help me uninstall in C# window form application Pin
Christian Graus15-Apr-07 20:57
protectorChristian Graus15-Apr-07 20:57 
GeneralRe: Help me uninstall in C# window form application Pin
phantanagu15-Apr-07 21:55
phantanagu15-Apr-07 21:55 
AnswerRe: Help me uninstall in C# window form application Pin
sujithkumarsl15-Apr-07 21:20
sujithkumarsl15-Apr-07 21:20 
GeneralRe: Help me uninstall in C# window form application Pin
phantanagu15-Apr-07 22:05
phantanagu15-Apr-07 22:05 
GeneralRe: Help me uninstall in C# window form application Pin
sujithkumarsl15-Apr-07 22:14
sujithkumarsl15-Apr-07 22:14 
QuestionExecutable containing executable Pin
apostleofzion115-Apr-07 19:29
apostleofzion115-Apr-07 19:29 
AnswerRe: Executable containing executable Pin
Christian Graus15-Apr-07 19:48
protectorChristian Graus15-Apr-07 19:48 
GeneralRe: Executable containing executable Pin
apostleofzion115-Apr-07 20:01
apostleofzion115-Apr-07 20:01 
GeneralRe: Executable containing executable Pin
Christian Graus15-Apr-07 20:33
protectorChristian Graus15-Apr-07 20:33 
GeneralRe: Executable containing executable Pin
espeholt_jr15-Apr-07 21:04
espeholt_jr15-Apr-07 21:04 

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.