Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » COSMOS » SML validation exception
SML validation exception [message #5961] Tue, 16 January 2007 15:04 Go to next message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

I tryed to call the validator for this file:
org.eclipse.cosmos.rm.validation.tests\src\test-resources\ru les\Valid.xml

What I get is:

Severity: error Namespace for prefix 'u' has not been declared.
Severity: error java.lang.RuntimeException: Namespace for prefix 'u' has
not been declared.
Severity: error Could not compile stylesheet
Severity: error Could not compile stylesheet
Severity: error Could not compile stylesheet
Severity: error Could not compile stylesheet
ERROR: 'The input document is not a stylesheet (the XSL namespace is not
declared in the root element).'
FATAL ERROR: 'Could not compile stylesheet'
ERROR: 'The input document is not a stylesheet (the XSL namespace is not
declared in the root element).'
FATAL ERROR: 'Could not compile stylesheet'
ERROR: 'The input document is not a stylesheet (the XSL namespace is not
declared in the root element).'
FATAL ERROR: 'Could not compile stylesheet'
ERROR: 'The input document is not a stylesheet (the XSL namespace is not
declared in the root element).'
FATAL ERROR: 'Could not compile stylesheet'

Could you help please?
Thanks
Elena
Re: SML validation exception [message #5982 is a reply to message #5961] Wed, 17 January 2007 20:51 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 404
Registered: July 2009
Senior Member
Hi Elena,

I haven't been able to update the validator work on COSMOS CVS (still
waiting for my permission). I will be regularly posting a zip file on
COSMOS wiki page for the community to experiment with. You can access the
latest version from: http://wiki.eclipse.org/images/8/8f/Backup-v2.zip

- Extract the zip file
- Import all projects in Eclipse (using the "Existing Project into
Workspace" option)
- You can either run an instance of an Eclipse Workbench and use the "SML-IF
> Validate" context menu on an SML-IF document OR
run the validator as a standalone Java application using MainValidator <path
of the SML-IF document> (keep in mind that a valid file doesn't produce any
output)

Thanks,
Ali Mehregani

"elena t" <elena.tibrea@gmail.com> wrote in message
news:ff5c4c38b03d32a146cb6ce5bd51ec9d$1@www.eclipse.org...
>I tryed to call the validator for this file:
> org.eclipse.cosmos.rm.validation.tests\src\test-resources\ru les\Valid.xml
>
> What I get is:
> Severity: error Namespace for prefix 'u' has not been declared.
> Severity: error java.lang.RuntimeException: Namespace for prefix 'u' has
> not been declared.
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
>
> Could you help please?
> Thanks
> Elena
>
Re: SML validation exception [message #5998 is a reply to message #5982] Wed, 17 January 2007 22:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

Hi Ali,

I'm having the same problems(this time displayed in Problems view)
although I get the 'validation passed' info box (independent of Valid.xml
or InValid.xml)

I'm running Eclipse Version: 3.2.0
Build id: I20060223-16
on jre1.5.0_10


What am I missing:-?

Thanks for replying
Elena
Re: SML validation exception [message #6010 is a reply to message #5998] Thu, 18 January 2007 19:07 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 404
Registered: July 2009
Senior Member
You need to have xalan libraries to be able to run with Sun JRE 1.5.0_10.
Follow the instructions below:

1. Download Xalan from http://xml.apache.org/xalan-j/downloads.html
2. Download an updated copy of the projects from:
http://wiki.eclipse.org/images/8/8f/Backup-v2.zip
3. Import the project downloaded in step 2) in an Eclipse workbench
4. Unzip the xalan zip file downloaded in step 1) to an arbitrary directory
5. Add the following xalan jar files to the "lib" directory of
org.eclipse.cosmos.rm.validation and org.eclipse.cosmos.rm.validation.tests:

serializer.jar
xalan.jar
xml-apis.jar

Although the code compiles with Sun 1.5, it generates the prefix error when
the above Jar files are missing. IBM 1.5 compiles and runs the validator
without the need for the Xalan Jar files above. I'll open a defect to
further investigate this error. In the mean time you can follow the steps
above to make the validator work.

Thanks,
Ali Mehregani

"elena t" <elena.tibrea@gmail.com> wrote in message
news:9bb0c6d6a9e76027a04c2905a4ad54f0$1@www.eclipse.org...
> Hi Ali,
>
> I'm having the same problems(this time displayed in Problems view)
> although I get the 'validation passed' info box (independent of Valid.xml
> or InValid.xml)
>
> I'm running Eclipse Version: 3.2.0
> Build id: I20060223-16
> on jre1.5.0_10
>
>
> What am I missing:-?
>
> Thanks for replying
> Elena
>
Re: SML validation exception [message #6860 is a reply to message #6010] Sat, 20 January 2007 17:00 Go to previous messageGo to next message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

I added all the jar files to my projects but it did not work.
I switched to IBM 1.5, for the moment.

thanks
Re: SML validation exception [message #6934 is a reply to message #6860] Mon, 22 January 2007 19:07 Go to previous messageGo to next message
Sheldon Lee-Loy is currently offline Sheldon Lee-Loy
Messages: 48
Registered: July 2009
Member
Hi Elena,

Could you post the Valid.xml you are trying to validate.

I think the schematron rule uses the 'u' prefix and does not define
the namespace. You might need to add the following namespace prefix
in your schematron.

<sch:ns prefix="u" uri="urn:university" />

This is what I mean:

<sch:schema
xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:ns prefix="u" uri="urn:university" />
<sch:ns prefix="smlfn"
uri="http://schemas.serviceml.org/sml/function/2006/07"/>
<sch:pattern id="StudentPattern">
<sch:rule
context="smlfn:deref(u:EnrolledStudents/u:EnrolledStudent)" >
<sch:assert test="starts-with(u:ID,'99')">
The specified ID <sch:value-of
select="string(u:ID)"/>
does not begin with 99
</sch:assert>
<sch:assert test="count(u:Courses/u:Course)>0">
The student <sch:value-of
select="string(u:ID)"/> must be enrolled
in at least one course
</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>


On Sat, 20 Jan 2007 17:00:23 +0000 (UTC), elena.tibrea@gmail.com
(elena t) wrote:

>I added all the jar files to my projects but it did not work.
>I switched to IBM 1.5, for the moment.
>
>thanks
Re: SML validation exception [message #6980 is a reply to message #6934] Tue, 23 January 2007 22:21 Go to previous messageGo to next message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

Hi,

I did nothing to alter the valid.xml file supplied.

Thanks.
Re: SML validation exception [message #7003 is a reply to message #6980] Wed, 24 January 2007 15:52 Go to previous message
Sheldon Lee-Loy is currently offline Sheldon Lee-Loy
Messages: 48
Registered: July 2009
Member
You might have an old version of Valid.xml. I had to make the change
I suggested. The schematron should define the namespaces it uses.

On Tue, 23 Jan 2007 22:21:03 +0000 (UTC), elena.tibrea@gmail.com
(elena t) wrote:

>Hi,
>
>I did nothing to alter the valid.xml file supplied.
>
>Thanks.
Re: SML validation exception [message #568774 is a reply to message #5961] Wed, 17 January 2007 20:51 Go to previous message
No real name is currently offline No real name
Messages: 404
Registered: July 2009
Senior Member
Hi Elena,

I haven't been able to update the validator work on COSMOS CVS (still
waiting for my permission). I will be regularly posting a zip file on
COSMOS wiki page for the community to experiment with. You can access the
latest version from: http://wiki.eclipse.org/images/8/8f/Backup-v2.zip

- Extract the zip file
- Import all projects in Eclipse (using the "Existing Project into
Workspace" option)
- You can either run an instance of an Eclipse Workbench and use the "SML-IF
> Validate" context menu on an SML-IF document OR
run the validator as a standalone Java application using MainValidator <path
of the SML-IF document> (keep in mind that a valid file doesn't produce any
output)

Thanks,
Ali Mehregani

"elena t" <elena.tibrea@gmail.com> wrote in message
news:ff5c4c38b03d32a146cb6ce5bd51ec9d$1@www.eclipse.org...
>I tryed to call the validator for this file:
> org.eclipse.cosmos.rm.validation.tests\src\test-resources\ru les\Valid.xml
>
> What I get is:
> Severity: error Namespace for prefix 'u' has not been declared.
> Severity: error java.lang.RuntimeException: Namespace for prefix 'u' has
> not been declared.
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> Severity: error Could not compile stylesheet
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
> ERROR: 'The input document is not a stylesheet (the XSL namespace is not
> declared in the root element).'
> FATAL ERROR: 'Could not compile stylesheet'
>
> Could you help please?
> Thanks
> Elena
>
Re: SML validation exception [message #568796 is a reply to message #5982] Wed, 17 January 2007 22:30 Go to previous message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

Hi Ali,

I'm having the same problems(this time displayed in Problems view)
although I get the 'validation passed' info box (independent of Valid.xml
or InValid.xml)

I'm running Eclipse Version: 3.2.0
Build id: I20060223-16
on jre1.5.0_10


What am I missing:-?

Thanks for replying
Elena
Re: SML validation exception [message #568821 is a reply to message #5998] Thu, 18 January 2007 19:07 Go to previous message
No real name is currently offline No real name
Messages: 404
Registered: July 2009
Senior Member
You need to have xalan libraries to be able to run with Sun JRE 1.5.0_10.
Follow the instructions below:

1. Download Xalan from http://xml.apache.org/xalan-j/downloads.html
2. Download an updated copy of the projects from:
http://wiki.eclipse.org/images/8/8f/Backup-v2.zip
3. Import the project downloaded in step 2) in an Eclipse workbench
4. Unzip the xalan zip file downloaded in step 1) to an arbitrary directory
5. Add the following xalan jar files to the "lib" directory of
org.eclipse.cosmos.rm.validation and org.eclipse.cosmos.rm.validation.tests:

serializer.jar
xalan.jar
xml-apis.jar

Although the code compiles with Sun 1.5, it generates the prefix error when
the above Jar files are missing. IBM 1.5 compiles and runs the validator
without the need for the Xalan Jar files above. I'll open a defect to
further investigate this error. In the mean time you can follow the steps
above to make the validator work.

Thanks,
Ali Mehregani

"elena t" <elena.tibrea@gmail.com> wrote in message
news:9bb0c6d6a9e76027a04c2905a4ad54f0$1@www.eclipse.org...
> Hi Ali,
>
> I'm having the same problems(this time displayed in Problems view)
> although I get the 'validation passed' info box (independent of Valid.xml
> or InValid.xml)
>
> I'm running Eclipse Version: 3.2.0
> Build id: I20060223-16
> on jre1.5.0_10
>
>
> What am I missing:-?
>
> Thanks for replying
> Elena
>
Re: SML validation exception [message #568855 is a reply to message #6010] Sat, 20 January 2007 17:00 Go to previous message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

I added all the jar files to my projects but it did not work.
I switched to IBM 1.5, for the moment.

thanks
Re: SML validation exception [message #568954 is a reply to message #6860] Mon, 22 January 2007 19:07 Go to previous message
Sheldon Lee-Loy is currently offline Sheldon Lee-Loy
Messages: 48
Registered: July 2009
Member
Hi Elena,

Could you post the Valid.xml you are trying to validate.

I think the schematron rule uses the 'u' prefix and does not define
the namespace. You might need to add the following namespace prefix
in your schematron.

<sch:ns prefix="u" uri="urn:university" />

This is what I mean:

<sch:schema
xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:ns prefix="u" uri="urn:university" />
<sch:ns prefix="smlfn"
uri="http://schemas.serviceml.org/sml/function/2006/07"/>
<sch:pattern id="StudentPattern">
<sch:rule
context="smlfn:deref(u:EnrolledStudents/u:EnrolledStudent)" >
<sch:assert test="starts-with(u:ID,'99')">
The specified ID <sch:value-of
select="string(u:ID)"/>
does not begin with 99
</sch:assert>
<sch:assert test="count(u:Courses/u:Course)>0">
The student <sch:value-of
select="string(u:ID)"/> must be enrolled
in at least one course
</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>


On Sat, 20 Jan 2007 17:00:23 +0000 (UTC), elena.tibrea@gmail.com
(elena t) wrote:

>I added all the jar files to my projects but it did not work.
>I switched to IBM 1.5, for the moment.
>
>thanks
Re: SML validation exception [message #569039 is a reply to message #6934] Tue, 23 January 2007 22:21 Go to previous message
Eclipse User
Originally posted by: elena.tibrea.gmail.com

Hi,

I did nothing to alter the valid.xml file supplied.

Thanks.
Re: SML validation exception [message #569060 is a reply to message #6980] Wed, 24 January 2007 15:52 Go to previous message
Sheldon Lee-Loy is currently offline Sheldon Lee-Loy
Messages: 48
Registered: July 2009
Member
You might have an old version of Valid.xml. I had to make the change
I suggested. The schematron should define the namespaces it uses.

On Tue, 23 Jan 2007 22:21:03 +0000 (UTC), elena.tibrea@gmail.com
(elena t) wrote:

>Hi,
>
>I did nothing to alter the valid.xml file supplied.
>
>Thanks.
Previous Topic:Schematron validation
Next Topic:SML-IF editor available
Goto Forum:
  


Current Time: Fri Oct 31 18:05:36 GMT 2014

Powered by FUDForum. Page generated in 0.02959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software