[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: XSLT-driven syntax highlighting for XPath 2.0,

Subject: Re: Re: XSLT-driven syntax highlighting for XPath 2.0, XSLT 2.0 and XSD 1.1
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 4 Dec 2012 04:51:53 -0800
Re:  Re: XSLT-driven syntax highlighting for XPath 2.0
On Fri, Nov 30, 2012 at 5:57 AM, Philip Fearon <pgfearo@xxxxxxxxxxxxxx> wrote:
>> As
>> we all too-well know one of the most frequent and most difficult to
>> detect programming error is failing to precede a (what must be a)
>> variable reference with the '$' character. I would like any such
>> occurence to be hi-lighted in bold red, and in addition, even
>> flashing. Just implementing this will save many hours of confusion to
>> us all.
>
> I agree this would be most useful as I often find I've omitted the '$' myself.
> Though this would be a simplistic approach I guess the easiest thing
> would be to just
> have a key holding all the permitted element names (even ignoring namespaces)
> and for each apparent element name found in the expression check for a match.

I thought of something even more simple:

Error-highlight a name if it isn't starting with the '$' character and
there is a variable defined with the same name.

Even if this is not an error (a node with the same name exists in the
set of documents being processed), this would be a good warning that
it would be a good idea to change the name of the same-named variable
to something more safe.

This can be done easily for a primary stylesheet that doesn't
import/include other stylesheets. Importing/including can be added as
a second stage by implementing a graph traversal whete the nodes are
the stylesheet modules and the arcs are the import/include
relationships.


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.