|
List Info
Thread: validating an xslt file?
|
|
| validating an xslt file? |

|
2007-10-05 18:20:00 |
I am trying to use XML::LibXML to validate an xslt file...
I'm getting an error that no DTD is found in the xsl file.
What is the proper way to validate xsl?
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.o
rg/resume/
http://utuxia.com/consul
ting
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 00:11:05 |
Hi Anthony,
* Anthony Ettinger <anthony chovy.com> [2007-10-06
01:25]:
> What is the proper way to validate xsl?
it’s not really possible to do that, and certainly not
with DTDs.
First, XSLT uses namespaces heavily; DTD and namespaces
don’t
really mix.
Next, any interesting transform will need to contain lots of
non-XSLT markup to generate its output, and each transform
will
contain different vocabularies. So you can’t write a
single
schema for all XSLT transforms.
Further, that non-XSLT markup is almost never a complete
document
of the output format; the construction of output is strewn
across
the entire transform in bits and pieces. So you cannot
validate
those bits with a generic schema for the output document
type.
You need a schema that can validate document fragments that
may
themselves include XSLT markup.
Now don’t forget that XSLT is also extensible, eg. EXSLT
and the
prioprietary Saxon/MSXSL extensions.
So you can see that the idea of writing a schema for all
that is
pretty hopeless.
You *can* partially validate XSLT using a RELAX NG schema,
eg the
one at <http://www
.thaiopensource.com/relaxng/>, but that’s
pretty useless: it’s basically just a weak syntax check.
You’ll
get better validation simply by checking whether your XSLT
processor will load the transform without complaining.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 01:01:51 |
On 10/5/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> Hi Anthony,
>
> * Anthony Ettinger <anthony chovy.com> [2007-10-06
01:25]:
> > What is the proper way to validate xsl?
>
> it's not really possible to do that, and certainly not
with DTDs.
>
> First, XSLT uses namespaces heavily; DTD and namespaces
don't
> really mix.
>
> Next, any interesting transform will need to contain
lots of
> non-XSLT markup to generate its output, and each
transform will
> contain different vocabularies. So you can't write a
single
> schema for all XSLT transforms.
>
> Further, that non-XSLT markup is almost never a
complete document
> of the output format; the construction of output is
strewn across
> the entire transform in bits and pieces. So you cannot
validate
> those bits with a generic schema for the output
document type.
> You need a schema that can validate document fragments
that may
> themselves include XSLT markup.
>
> Now don't forget that XSLT is also extensible, eg.
EXSLT and the
> prioprietary Saxon/MSXSL extensions.
>
> So you can see that the idea of writing a schema for
all that is
> pretty hopeless.
>
> You *can* partially validate XSLT using a RELAX NG
schema, eg the
> one at <http://www
.thaiopensource.com/relaxng/>, but that's
> pretty useless: it's basically just a weak syntax
check. You'll
> get better validation simply by checking whether your
XSLT
> processor will load the transform without complaining.
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
Thanks...I kind of figured that was the case, but since xslt
is *xml*
i figured there may be a way to validate that at least the
XSLT-specific markup was valid.
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.o
rg/resume/
http://utuxia.com/consul
ting
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 02:48:56 |
On Fri, 2007-10-05 at 23:01 -0700, Anthony Ettinger wrote:
> On 10/5/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> > Hi Anthony,
> >
> > * Anthony Ettinger <anthony chovy.com> [2007-10-06 01:25]:
> > > What is the proper way to validate xsl?
> >
> > it's not really possible to do that, and certainly
not with DTDs.
> >
> > First, XSLT uses namespaces heavily; DTD and
namespaces don't
> > really mix.
> >
> > Next, any interesting transform will need to
contain lots of
> > non-XSLT markup to generate its output, and each
transform will
> > contain different vocabularies. So you can't write
a single
> > schema for all XSLT transforms.
> >
> > Further, that non-XSLT markup is almost never a
complete document
> > of the output format; the construction of output
is strewn across
> > the entire transform in bits and pieces. So you
cannot validate
> > those bits with a generic schema for the output
document type.
> > You need a schema that can validate document
fragments that may
> > themselves include XSLT markup.
> >
> > Now don't forget that XSLT is also extensible, eg.
EXSLT and the
> > prioprietary Saxon/MSXSL extensions.
> >
> > So you can see that the idea of writing a schema
for all that is
> > pretty hopeless.
> >
> > You *can* partially validate XSLT using a RELAX NG
schema, eg the
> > one at <http://www
.thaiopensource.com/relaxng/>, but that's
> > pretty useless: it's basically just a weak syntax
check. You'll
> > get better validation simply by checking whether
your XSLT
> > processor will load the transform without
complaining.
> >
> > Regards,
> > --
> > Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
>
> Thanks...I kind of figured that was the case, but since
xslt is *xml*
> i figured there may be a way to validate that at least
the
> XSLT-specific markup was valid.
>
Unfortunately a DTD based validation is going to struggle
because
without namespaces it can't distinguish between the XSLT
stuff and the
"content".
You might however check out http://www.w3.org/TR/xs
lt#dtd , also there
is a schema for XSLT 2.0 at
http://w
ww.w3.org/TR/xslt20/#schema-for-xslt , but I suspect
that it
isn't backward compatible enough for the xslt that most
people use
(although it does target the same namespace)
/J
--
Make war on hippies
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 04:27:12 |
On 10/6/07, Jonathan Stowe <jns gellyfish.com> wrote:
> On Fri, 2007-10-05 at 23:01 -0700, Anthony Ettinger
wrote:
> > On 10/5/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> > > Hi Anthony,
> > >
> > > * Anthony Ettinger <anthony chovy.com> [2007-10-06 01:25]:
> > > > What is the proper way to validate xsl?
> > >
> > > it's not really possible to do that, and
certainly not with DTDs.
> > >
> > > First, XSLT uses namespaces heavily; DTD and
namespaces don't
> > > really mix.
> > >
> > > Next, any interesting transform will need to
contain lots of
> > > non-XSLT markup to generate its output, and
each transform will
> > > contain different vocabularies. So you can't
write a single
> > > schema for all XSLT transforms.
> > >
> > > Further, that non-XSLT markup is almost never
a complete document
> > > of the output format; the construction of
output is strewn across
> > > the entire transform in bits and pieces. So
you cannot validate
> > > those bits with a generic schema for the
output document type.
> > > You need a schema that can validate document
fragments that may
> > > themselves include XSLT markup.
> > >
> > > Now don't forget that XSLT is also
extensible, eg. EXSLT and the
> > > prioprietary Saxon/MSXSL extensions.
> > >
> > > So you can see that the idea of writing a
schema for all that is
> > > pretty hopeless.
> > >
> > > You *can* partially validate XSLT using a
RELAX NG schema, eg the
> > > one at <http://www
.thaiopensource.com/relaxng/>, but that's
> > > pretty useless: it's basically just a weak
syntax check. You'll
> > > get better validation simply by checking
whether your XSLT
> > > processor will load the transform without
complaining.
> > >
> > > Regards,
> > > --
> > > Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
> >
> > Thanks...I kind of figured that was the case, but
since xslt is *xml*
> > i figured there may be a way to validate that at
least the
> > XSLT-specific markup was valid.
> >
>
> Unfortunately a DTD based validation is going to
struggle because
> without namespaces it can't distinguish between the
XSLT stuff and the
> "content".
>
> You might however check out http://www.w3.org/TR/xs
lt#dtd , also there
> is a schema for XSLT 2.0 at
> http://w
ww.w3.org/TR/xslt20/#schema-for-xslt , but I suspect
that it
> isn't backward compatible enough for the xslt that most
people use
> (although it does target the same namespace)
>
> /J
> --
I was thinking XMLSchema for validating the XSL (not DTD,
obviously).
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.o
rg/resume/
http://utuxia.com/consul
ting
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 16:04:33 |
* Anthony Ettinger <anthony chovy.com> [2007-10-06
11:30]:
> I was thinking XMLSchema for validating the XSL (not
DTD,
> obviously).
I really doubt WXS is capable of validating XSLT because of
its
limitations in expressing common XML constructs. Seems to me
you really can’t use anything other than RNG for
grammar-based
validation, or more likely a hybrid RNG+Schematron schema.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 19:53:29 |
On 10/6/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> * Anthony Ettinger <anthony chovy.com> [2007-10-06
11:30]:
> > I was thinking XMLSchema for validating the XSL
(not DTD,
> > obviously).
>
> I really doubt WXS is capable of validating XSLT
because of its
> limitations in expressing common XML constructs. Seems
to me
> you really can't use anything other than RNG for
grammar-based
> validation, or more likely a hybrid RNG+Schematron
schema.
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
So if i'm writing xslt then which spec do I follow?
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.o
rg/resume/
http://utuxia.com/consul
ting
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 21:11:50 |
* Anthony Ettinger <anthony chovy.com> [2007-10-07
02:55]:
> So if i'm writing xslt then which spec do I follow?
What do you mean?
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/&g
t;
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-06 21:23:39 |
On 10/6/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> * Anthony Ettinger <anthony chovy.com> [2007-10-07
02:55]:
> > So if i'm writing xslt then which spec do I
follow?
>
> What do you mean?
>
I guess what i really mean is an xslt reference...i couldn't
find it on w3c.
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.o
rg/resume/
http://utuxia.com/consul
ting
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Re: validating an xslt file? |

|
2007-10-07 03:33:10 |
On 2007-10-06 19:23:39 -0700, Anthony Ettinger wrote:
> On 10/6/07, A. Pagaltzis <pagaltzis gmx.de> wrote:
> > * Anthony Ettinger <anthony chovy.com> [2007-10-07 02:55]:
> > > So if i'm writing xslt then which spec do I
follow?
> >
> > What do you mean?
> >
>
> I guess what i really mean is an xslt reference...
http://www.w3.org/TR/xslt
a> (XSLT 1.0) or
http://www.w3.org/TR/xslt
20 (XSLT 2.0).
> i couldn't find it on w3c.
Strange. There's a link in the "W3C A to Z" box on
the homepage.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a
pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp hjp.at |
__/ | http://www.hjp.at/
| -- Sam in "Freefall"
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
|
|