Hi Thanks,
But my problem is not validation of the doc. I implemented the code anyway.
The doc validates against the DTD.
Problem is that the DTD specs an Element say 'Widget'
the Widget contains 70 optional PCData elements.
ie <!ELEMENT widget (p1?,p2?,p3?,...)
The spec for elements p1,p2,...pn is
<!ELEMENT p1 (#PCDATA) etc
The dilemma is that the contents of Widget is read as one large string. I
can pick out parts using regular expressions but this approach is limited
and depends upon static data.
Ideally I wanted to hook the data by Element name so that the contents
varying did not matter.
eg Assume Element p5 is 'widget colour'
The element may contain 'widget colour blue'
unfortunately the user has the ability change the wording to say 'widget
hue'
If I could grab element p5 I would know I had the colour text and could
parse it accordingly.
I guess my question boils down to:
Do element tags have to be present for optional #PCDATA elements or can they
legimately be present inside the parent element without tags?
To put it another way, is it probable that the tags are there and I am just
not looking at the doc the right way or the tags aren't there and I should
concentrate on making the reg ex detection as strong as possible.
Thanks
Bob
"chanmm" <ch*****@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hope this can bring you closer:
http://msdn2.microsoft.com/en-us/lib...15(d=ide).aspx
chanmm
"Bob" <bo*@nowhere.comwrote in message
news:OF****************@TK2MSFTNGP03.phx.gbl...
Hi,
Version 2.0 CLR
How can I detect a #PCDATA element in an incoming stream?
I have tried using
XmlReader xr = XmlReader.Create(streamResponse);
while (xr.Read())
basGeneral.WriteInfoLog(xr.Name);
xr.Close();
But this doesn't burrow down into the element that contains the #PCDATA
elements.
Thanks
Bob