J
Jay B. Harlow [MVP - Outlook]
Charles,
| but I could write it as XML, but use HTML tags.
That would be XHTML ;-)
If you are writing the files, then this may be the way to go.
Hope this helps
Jay
| Hi Dave
|
| Actually, you have hit on something there. I write the file in the first
| place as HTML, but I could write it as XML, but use HTML tags. I would
then
| have the right class structure to read it back in. Marvellous. It pays to
| look outside the box.
|
| Thanks.
|
| Charles
|
|
| | >> I have a well structured file
| >
| > If you can guarantee that the file will always be well-formed, you can
use
| > System.Xml namespace classes to do the parsing for you. i.e. XmlReader /
| > XmlWriter / XmlDocument or any of the XPath readers/writers/document.
| >
| > --
| > Dave Sexton
| > [email protected]
| > -----------------------------------------------------------------------
| > | >> Does anyone have a regex pattern to parse HTML from a stream?
| >>
| >> I have a well structured file, where each line is of the form
| >>
| >> <sometag someattribute='attr'>text</sometag>
| >>
| >> for example
| >>
| >> <SPAN CLASS='myclass'>A bit of text</SPAN>, or
| >> Just some text, without tags
| >>
| >> What I would like to be able to do is parse each line so that I get an
| >> array like this
| >>
| >> SPAN
| >> CLASS
| >> myclass
| >> A bit of text
| >>
| >> or
| >>
| >> Just some text, without tags
| >>
| >> The array bit should follow, but I don't profess to be a regex expert
(or
| >> any kind of expert for that matter). Can anyone help with a suitable
| >> pattern?
| >>
| >> TIA
| >>
| >> Charles
| >>
| >>
| >
| >
|
|
| but I could write it as XML, but use HTML tags.
That would be XHTML ;-)
If you are writing the files, then this may be the way to go.
Hope this helps
Jay
| Hi Dave
|
| Actually, you have hit on something there. I write the file in the first
| place as HTML, but I could write it as XML, but use HTML tags. I would
then
| have the right class structure to read it back in. Marvellous. It pays to
| look outside the box.
|
| Thanks.
|
| Charles
|
|
| | >> I have a well structured file
| >
| > If you can guarantee that the file will always be well-formed, you can
use
| > System.Xml namespace classes to do the parsing for you. i.e. XmlReader /
| > XmlWriter / XmlDocument or any of the XPath readers/writers/document.
| >
| > --
| > Dave Sexton
| > [email protected]
| > -----------------------------------------------------------------------
| > | >> Does anyone have a regex pattern to parse HTML from a stream?
| >>
| >> I have a well structured file, where each line is of the form
| >>
| >> <sometag someattribute='attr'>text</sometag>
| >>
| >> for example
| >>
| >> <SPAN CLASS='myclass'>A bit of text</SPAN>, or
| >> Just some text, without tags
| >>
| >> What I would like to be able to do is parse each line so that I get an
| >> array like this
| >>
| >> SPAN
| >> CLASS
| >> myclass
| >> A bit of text
| >>
| >> or
| >>
| >> Just some text, without tags
| >>
| >> The array bit should follow, but I don't profess to be a regex expert
(or
| >> any kind of expert for that matter). Can anyone help with a suitable
| >> pattern?
| >>
| >> TIA
| >>
| >> Charles
| >>
| >>
| >
| >
|
|