Re: xml highlight problem

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: xml highlight problem

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michele Mattioni wrote:

> hi list,
> I'm using source-highligth and it seems to work very well.
>
> Although I found a problem when I start from the xml language and
> convert it in latex monocromatic output under special condition.
>
> The problem is on the tag format of the xml, for example
>
> <tag>content</tag> works  
>
> <my_tag>content</my_tag> doesn't work. I think the main problem is the
> non escape of the _ in the process and the tag is no recognised as one.
> For this problem the highlight is misplaced ..
>
> the output is, for the first (LaTeX example, I didn't tried the other
> format)
>
> \textbf{$<$tag$>$}content\textbf{$<$/tag$>$}
>
> and for the second...
> \textbf{$<$my}$\_$tag$>$content$<$/my$\_$tag$>$
>
> of course it should be:
> \textbf{$<$my\_tag$>$content\textbf{$<$/my\_tag$>$}
>
> Hope this mail is clear enough to point out, the problem.
>
> I'm not on the list yet (Moderator approval pending), so could you
> please attach me in CC, or approve my subscription?
> thanks :)
>

Hi Michele

no the problem is in the xml language definition file which does not
include _ as a viable character in a tag name.

Attached, you find the fixed xml.lang definition file, which now
highlights xml file correctly.

I take the chance to ask anyone whether there are other characters for
tags in xml (and html as well, so also the html.lang file should be
fixed accordingly) besides : and _?

thanks for the feedback!
cheers
        Lorenzo


--
+-----------------------------------------------------+
| Lorenzo Bettini          ICQ# lbetto, 16080134      |
| PhD in Computer Science, DSI, Univ. di Firenze      |
| Florence - Italy        (GNU/Linux User # 158233)   |
| http://www.lorenzobettini.it                        |
| http://tronprog.blogspot.com  BLOG                  |
| http://www.purplesucker.com Deep Purple Cover Band  |
| http://www.gnu.org/software/src-highlite            |
| http://www.gnu.org/software/gengetopt               |
| http://www.lorenzobettini.it/software/gengen        |
| http://www.lorenzobettini.it/software/doublecpp     |
+-----------------------------------------------------+


_______________________________________________
Help-source-highlight mailing list
Help-source-highlight@...
http://lists.gnu.org/mailman/listinfo/help-source-highlight

Re: Re: xml highlight problem

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lorenzo Bettini wrote:
> Attached, you find the fixed xml.lang definition file, which now
> highlights xml file correctly.

ehm... sorry... forgot the attachment :-)

--
+-----------------------------------------------------+
| Lorenzo Bettini          ICQ# lbetto, 16080134      |
| PhD in Computer Science, DSI, Univ. di Firenze      |
| Florence - Italy        (GNU/Linux User # 158233)   |
| http://www.lorenzobettini.it                        |
| http://tronprog.blogspot.com  BLOG                  |
| http://www.purplesucker.com Deep Purple Cover Band  |
| http://www.gnu.org/software/src-highlite            |
| http://www.gnu.org/software/gengetopt               |
| http://www.lorenzobettini.it/software/gengen        |
| http://www.lorenzobettini.it/software/doublecpp     |
+-----------------------------------------------------+

state preproc delim "<?xml" "?>" multiline begin
  string delim "\"" "\"" escape "\\" multiline
end

comment delim "<!--" "-->" multiline nested

keyword = '<(/)?[[:alnum:]:_]+(/)?>'

state keyword delim '<(/)?[[:alnum:]:_]+' '(/)?>' multiline begin
  type = '[^="[:blank:]>]+'
  symbol = "="
  string delim "\"" "\"" escape "\\" multiline
end

preproc = '&([[:alnum:]]+);'

_______________________________________________
Help-source-highlight mailing list
Help-source-highlight@...
http://lists.gnu.org/mailman/listinfo/help-source-highlight

Re: Re: xml highlight problem

by Michele-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Il giorno dom, 08/10/2006 alle 19.44 +0200, Lorenzo Bettini ha scritto:
> Lorenzo Bettini wrote:
> > Attached, you find the fixed xml.lang definition file, which now
> > highlights xml file correctly.
>
> ehm... sorry... forgot the attachment :-)

Tested right now. It works flawlessly.
Many thanks.


ASAIK the XML can include the _

bye :)

Michele.



_______________________________________________
Help-source-highlight mailing list
Help-source-highlight@...
http://lists.gnu.org/mailman/listinfo/help-source-highlight