By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,664 Members | 1,999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,664 IT Pros & Developers. It's quick & easy.

how to make sure a xsl document has valid xsl syntax? i tried loading it into an xml document but that doesnt show syntax errors inside attributes such as "foo/bar" vs "bar\foo"

P: n/a
how to make sure a xsl document has valid xsl syntax? i tried loading it
into an xml document but that doesnt show syntax errors inside attributes
such as "foo/bar" vs "bar\foo"
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Daniel wrote:
how to make sure a xsl document has valid xsl syntax? i tried loading it
into an xml document but that doesnt show syntax errors inside attributes
such as "foo/bar" vs "bar\foo"


System.XML performs only checks for the well-formedness of Documents,
not for validity. You need a Schema for XSLT wich defines Regular
Expressions to check for "syntax errors inside attributes" (I think you
mean the select-ones and XPath-syntax errors?) and XmlValidatingReader.

An other, easier way is to try to execute the transformation inside a
try-catch-block, if an error occurs, you made errors...

Nov 12 '05 #2

P: n/a
Daniel wrote:
how to make sure a xsl document has valid xsl syntax? i tried loading it
into an xml document but that doesnt show syntax errors inside attributes
such as "foo/bar" vs "bar\foo"


Load it into an XSLT processor, e.g. XslTransform class. That would run
compilation which always checks syntax and semantics.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.xmllab.net
http://blog.tkachenko.com
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.