Page 1 of 1

Extended XML support

Posted: Fri Feb 13, 2004 1:22 pm
by teknopaul
The syntax high-lighting definitions available for XML are at best patchy, this is because the base definitions assume html and keywords or C like syntax. XML syntax has very few keywords but the difference between elements and text is crucial.


In this day and age XML support is hardly a nice to have!!

p.s. what about a linux version? i might change desktop if textpad for linux was available :D

Posted: Fri Feb 13, 2004 3:18 pm
by cacycle
A while ago I have been using TextPad under wine :)

But you are right, TextPad is one of the main reasons why I mostly use Windows...

xml syntax (or any SGML form)

Posted: Mon Mar 01, 2004 3:53 pm
by bloodbaz
I agree that native XML syntax highlighting is an essential feature to add. I currently differentiate Elements, Attributes etc... to CDATA by using > and < as comment delimiters but this seems "backwards". :P

Posted: Mon Mar 15, 2004 4:33 pm
by ramonsky
Agreed. Now how about this for a feature proposal...

For an XML file, why not get the list of keywords from the relevant DTD, which in turn may be obtained by parsing the start of the XML file.

So basically, it would go like this:
1. Parse the start of the XML file to discover the DTD(s) that define the keywords
2. If necessary, go online to get the DTD files
3. Parse the DTD files
4. Use this information to syntax color the xml file.

I agree that this represents a completely different algorithm to that currently used for syntax higlighting, but I think that XML requires a different algorithm. XML is not C, is not anything like C, so the "C=1" algorithm should maybe be augmented by a new "XML=1" algorithm.

Jill

Posted: Sat Mar 20, 2004 1:55 pm
by gracefool
Good idea, ramonsky. Can't see it happenin' for a few years tho, what with the seeming lack of XML parsers around...

Posted: Sun Mar 21, 2004 10:28 pm
by BenjiSmith
ramonsky wrote:For an XML file, why not get the list of keywords from the relevant DTD, which in turn may be obtained by parsing the start of the XML file.
Hmmmmm.

It may be possible to do this with an external command to parse the DTD and rewrite the syntax file.

Hmmmmmm.

I'll have to do some more thinking about that.