RE: [xsl] Understanding XSLT Questions

Subject: RE: [xsl] Understanding XSLT Questions
From: George James <GeorgeJ@xxxxxxxxxxxxxxx>
Date: Mon, 13 Dec 2004 14:56:26 -0000
David, Jarno, Elliotte
Thank you all for your answers.

Elliotte Harold wrote:
> > 1	Why does XSLT 1.0 have relatively poor string handling
> capabilities?
>
> Because XSLT is designed to process documents in which significant
> boundaries are indicated by XML markup, not non-XML text.

I'll buy this answer.  I suppose it's fair to say that the internal
non-markup content of an element is none of XLST's business.

But, in the real world, dates are in YYYY-MM-DDTHH:MM:SS format, not
<year>YYYY</year><month>mm</month>... and there are many XML schemas where
there is significant structure within the content of elements and attributes
(SVG for example).

If we don't have general purpose string handling functions then we must at
least have functions that can operate on known data-types (date, list, etc).
But these are also missing in XSLT 1.0.

> > 2	When attempting to view an XML document that contains an invalid
> > character (for the encoding) in IE it complains that the
> XML document
> > is invalid and displays nothing.  However in Firefox the
> document is
> > rendered but the character is shown as a black diamond containing a
> > question mark. Shouldn't Firefox reject the document?
>
> At least that part of the document that follows the invalid character.

That's what I thought - Firefox is taking a liberty by recovering and
parsing the rest of the document - too bad if it's in some script or
something where you don't get to spot it.  But, I'm sure IE will embrace and
extend when folk complain that their stuff works better in Firefox than in
IE ;(

David Carlisle wrote:
>   3	Where's the documentation for the Transformiix XSLT
> engine that's
>   embedded in Firefox?
>
> "Use the source, Luke..."
> there's a bit of top level documentation on the mozilla site.
> > What extensions are supported?
> none
:(
> > Is it scriptable, etc?
> yes see above
:)
>
>
> > Most links seem to point to the Netscape DevEdge
> odd, where were you looking?
Well this page http://www.mozilla.org/projects/xslt/ has a link to DevEdge,
but it also has a link to
http://www.mozilla.org/projects/xslt/js-interface.html which I somehow
missed.

Thank you, all.

Regards
George

George James Software
www.georgejames.com
An InterSystems Technology Partner





> -----Original Message-----
> From: David Carlisle [mailto:davidc@xxxxxxxxx]
> Sent: 13 December 2004 13:50
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Understanding XSLT Questions
>
>
>
> > 1	Why does XSLT 1.0 have relatively poor string handling
> capabilities?
>
> It's a bit of an open question:-)
> but a couple of reasonable guesses.
>
> a) It's version 1 of a language: more features can be added
> later (XSLT 2
>    has more string handling)
>
> b) In general XSLT 1 isn't designed to be optimal for "Up Translation"
>    ie going from less structure to more structure. It's primary design
>    goal was (explictly) "down translation" where you are
> styling highly
>    structured XML down to XSL FO (or HTML or text or whatever). If all
>    your structure is marked up in your XML source you don't need
>    extensive string handling. Of course XSLT go used for far
> more things
>    than its original designers might have imagined...
>
>
>   2	When attempting to view an XML document that contains an invalid
>   character (for the encoding) in IE it complains that the
> XML document is
>   invalid and displays nothing.  However in Firefox the
> document is rendered
>   but the character is shown as a black diamond containing a
> question mark.
>   Shouldn't Firefox reject the document?
>
> yes (harsh but true) well actually that "yes" has to be
> slightly conditional. The XML spec says that is a fatal
> error, so the xml parser is not supposed to make any
> automatic correction it has to stop and report an error. But
> a web browser is far more than an xml parser, if that decides
> to trap the error, fix the input by putting a bad character
> marker there and then restarting the XML parse, that is
> probbaly out of scope for any spec to outlaw.
>
>   3	Where's the documentation for the Transformiix XSLT
> engine that's
>   embedded in Firefox?
>
> "Use the source, Luke..."
> there's a bit of top level documentation on the mozilla site.
> > What extensions are supported?
> none
> > Is it scriptable, etc?
> yes see above
>
> google
> http://www.google.co.uk/search?hl=en&q=transformiix+xslt+script&meta=
> would have lead you fairly quuickly to the interface
> description to javascript
> http://www.mozilla.org/projects/xslt/js-interface.html
>
> > Most links seem to point to the Netscape DevEdge
> odd, where were you looking?
>
> google is your friend...
>
> David
>
> ______________________________________________________________
> __________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ______________________________________________________________
> __________

Current Thread