Robin Johnson <> wrote in message news:<>. ..
> On 27 Aug 2004 14:40:05 -0700, (inquirydog)
> wrote:
> [...]
> >This is a big problem if
> >there is a typo in the xslt transformation- ie my schema makes sure
> >that I have an element called <dogname>, but the transformation tries
> >to use <dawgname>. Oops! Now my results are incorrect and no one is
> >there to tell me about it.
>
> Yes, if you type the wrong code, you'll get the wrong results.
>
> I can't think of a language that doesn't have that 'limitation'.
Actually, I can't think of a language which doesn't catch typos-
-----
c:
printq("you dude\n");
compilation result:
In function `main':
: undefined reference to `printq'
collect2: ld returned 1 exit status
---
perl:
x = x + &;
run result:
line 4: syntax error near unexpected token `;'
line 4: ` x = x + &;'
---
java:
static public void main(String args[])
{
File file = new File("qq");
file.createNewFile();
}
compilation:
test.java:13: unreported exception java.io.IOException; must be
caught or
declared to be thrown
file.createNewFile();
^
1 error
(one of the reasons that I love Java is because it is great at compile
time error checking, finding perhaps 90% of my bugs right off the bat)
---
I am merely requesting that xslt have the same error checking
capabilities as just about every other language out there (it does in
some ways, but I am pointing out what I consider to be a large
ommision in the language). Using a schema to check that address.xml
has a <street> element in it like this
<xsd:element name="street" type="xsd:string" />
and using an xslt transformation with the following typo
<xsl:value-of select="name" />
<xsl:value-of select="stret" /> <-- typo, should be street
<xsl:value-of select="city" /> <xsl:value-of select="state" />
<xsl:value-of select="zipcode" />
would contain an error that should be but is not caught by the xslt
translation software. Granted, as some have pointed out here, you can
store all xpath expressions in a variable, do a test with instructions
to complain and stop processing, and then use the value-of with the
variable, but given that 1). Most people won't do this, and 2). It
could increase the size of many otherwise simple transformations by
probably double (ie- consider how big my simple example above would
become), I don't think this is a reasonable way to do things.
I believe that xslt is the way of the future of development, and am
eager to patch all the holes and growing pains that all new
technologies experience. I've given some of what I believe are
reasonable suggestions about how I think that should be done, if you
have a tangible reason why you think they are a bad idea, I would love
to listen. I am not sure how essentially saying -all languages have
problems- and throwing up your arms moves xslt forward.
thanks
-I