| Author |
Message |
|
|
Post subject: [Workaround] XML Validation fails with XSLT
Posted: Sep 27, 2005 - 05:21 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
We noticed a few folks writing XSLTs having problems with validation failing, and the problem here is there is no official Schema for XSLTs, however there is a community maintained one that one of our developers made some fixes to in order to get inline with the current spec that should allow you to validate your transforms.
The link for the file is here: http://www.myeclipseide.com/examplecode/schema-for-xslt20.xsd
You will need to add this to your XML Catalog using the key: http://www.w3.org/1999/XSL/Transform
You can do that by navigating to Window > Preferences > MyEclipse > Editors > XML Editor > XML Catalog, clicking "Add" and filling out the information as follows:
URI: file:/<path to file>/schema-for-xslt20.xsd
Key Type: Public ID
Key: http://www.w3.org/1999/XSL/Transform
Where <path to file> is your path wherever you stuck the XSD. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 03, 2005 - 07:23 PM
|
|

Joined: Sep 19, 2005
Posts: 6
|
|
When I try to add it, it wont let me use "Public ID".
It forces to Namespace Name.
Then when I valitade an XSL file, it says "Validation Complete" but the box says no validator is set up for this type. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 03, 2005 - 07:24 PM
|
|

Joined: Sep 19, 2005
Posts: 6
|
|
Resource foo.xsl was not validated because none of the enabled validators validates that type of resource.
Validation of resource foo.xsl is complete. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 03, 2005 - 09:00 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
| Make sure your XML validator is enabled for your project and/or globally for the workbenhc. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 01, 2005 - 09:45 AM
|
|
Registered Member


Joined: Aug 29, 2005
Posts: 7
|
|
I get the same result as lkb, and i (think) have the xml validator enabled, (how do i check that)
regards
Petter |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 01, 2005 - 02:00 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
| You can check for your project level by opening up your project properties and going to MyEclipse-Validation, if they are all grayed out then you need to navigate to Window > Prefs > MyEclipse > Validation and check there. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 16, 2006 - 10:56 PM
|
|

Joined: Feb 16, 2006
Posts: 7
|
|
I've followed the instructions here, but I still get the validation error:
2 cvc-elt.1: Cannot find the declaration of element 'xsl:stylesheet'. article_simple.xsl pcw/web/WEB-INF/xsl line 2 February 16, 2006
I've checked and I do have the xml validator enabled.
MyEclipse version info:
Version: 4.1.0
Build id: 20060122-4.1-GA
Eclipse version info:
Version: 3.1.2
Build id: M20060118-1600
any ideas? this is mostly just a nuisance, but it would be nice to get rid of this nuisance. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 16, 2006 - 11:02 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
pcwappdev,
Be sure to clear your error markers then re-run validation. MyEclipse > Remove All Error Markers |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 16, 2006 - 11:26 PM
|
|

Joined: Feb 16, 2006
Posts: 7
|
|
i didn't have an option to remove all error markers, I right clicked on my project clicked on MyEclipse > Remove All Validation Markers
I then right clicked on my xsl file and clicked on "Validate XSL file", got the same error mentioned above.
I tried right clicking the xsl file and then clicking on MyEclipse > Run Validation, but I got the following error:
Resource /pcw/web/WEB-INF/xsl/article_simple.xsl was not validated because none of the enabled validators validates that type of resource.
Validation of resource /pcw/web/WEB-INF/xsl/article_simple.xsl is complete.
As I mentioned, xml validation is enabled for this project.
Thanks for the quick response |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 16, 2006 - 11:46 PM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
| Can you post the contents of the file so I can dump it into a project on my end and try it out? |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 16, 2006 - 11:49 PM
|
|

Joined: Feb 16, 2006
Posts: 7
|
|
the validation fails for any kind of xsl file. Here is a very simple xsl file which on my system fails validation as described above.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:variable name="apos">'</xsl:variable>
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
</xsl:stylesheet> |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 17, 2006 - 02:39 AM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
| Did you not follow the steps outlined in the first post of this thread? I just did and the file validates fine. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 17, 2006 - 06:26 AM
|
|

Joined: Feb 16, 2006
Posts: 7
|
|
I did follow the steps outlined in the first post of this thread, and yet my xsl file still does not validate.
when i right click on my xsl and select "Validate XSL File", I get:
Severity Description Resource In Folder Location Creation Time Id
2 cvc-elt.1: Cannot find the declaration of element 'xsl:stylesheet'. article_simple.xsl pcw/web/WEB-INF/xsl line 2 February 16, 2006 10:17:35 PM 3366
when I right click on my xsl and select "MyEclipse > Run Validation", I get:
Resource /pcw/web/WEB-INF/xsl/article_simple.xsl was not validated because none of the enabled validators validates that type of resource.
Validation of resource /pcw/web/WEB-INF/xsl/article_simple.xsl is complete.
I should mention that previously, I had saved this file: http://www.myeclipseide.com/examplecode/schema-for-xslt20.xsd with an .xml extension. I noticed this and changed the extension to .xsd . Once I did this, the only options I had for "Key Type" when adding this file to the xml catalog are "Schema Location" and "Namespace Location". Currently the details for my user specified xml catalog are:
URI: platform:/resource/pcw/web/WEB-INF/xsd/xsl-schema.xml
Key Type: Schema Location
Key: http://www.w3.org/1999/XSL/Transform
But no matter what I select for Key Type, I still get the same errors when trying to validate the xsl file. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 17, 2006 - 08:26 AM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23307
|
|
| Change it to namespace, that is what I have mine set to. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 17, 2006 - 05:20 PM
|
|

Joined: Feb 16, 2006
Posts: 7
|
|
hehehe, I figured out what it was, there was a trailing space in the key for the xml catalog, so the key was "http://www.w3.org/1999/XSL/Transform " instead of "http://www.w3.org/1999/XSL/Transform"
doh!
once I removed the trailing space, the xsl file validates.
thanks for your patience Riyad. |
|
|
| |
|
|
|
 |
|
|