Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re: eclipse xml validation
Re: eclipse xml validation [message #545549] Thu, 08 July 2010 08:30 Go to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2307
Registered: July 2009
Senior Member
Perhaps putting this into the WTP newsgroup will help.

On 6/30/2010 1:42 PM, batsup@gmail.com wrote:
> Hello, I have a problem with validating a xml scheme for some dynamic
> web pages, the wierd thing is that the scheme gets validated just fine
> in IntellliJ. In Eclipse i get errors:
>
> src-resolve: Cannot resolve the name 'className' to a(n) 'simpleType
> definition' component.
> src-resolve.4.1: Error resolving component 'descriptorType'. It was
> detected that 'descriptorType' has no namespace, but components with no
> target namespace are not referenceable from schema document
> 'file:///C:/Users/tommasino/workspace/inovioweb/src/descript or.xsd'. If
> 'descriptorType' is intended to have a namespace, perhaps a prefix needs
> to be provided. If it is intended that 'descriptorType' has no
> namespace, then an 'import' without a "namespace" attribute should be
> added to 'file:///C:/Users/tommasino/workspace/inovioweb/src/descript
> or.xsd'.
>
> Looks like the errors arent related. Here is the scheme, not complete
> (deleted non relevant lines).
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema elementFormDefault="qualified"
> targetNamespace="http://www.bellman.cz/schema/descriptor"
> xmlns:ns="http://www.bellman.cz/schema/descriptor"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:simpleType name="className">
> <xs:restriction base="xs:string">
> <xs:pattern value="\w+(\.\w+)*" />
> </xs:restriction>
> </xs:simpleType>
> <xs:element name="descriptor" type="descriptorType"/>
> <xs:complexType name="viewType">
> <xs:attribute type="className" name="name" use="required"/>
> </xs:complexType>
> <xs:complexType name="descriptorType">
> </xs:complexType>
> </xs:schema>
>
> If I add xmlns="http://www.bellman.cz/schema/descriptor" to the scheme
> tag i get rid of these errors, but get a chain of another errors. The
> thing is, this application is actually deployed, I simply cant get it
> working in Eclipse. Any ideas why?
>
> PS: this may not be a Eclipse issue, if so, sorry for posting in bad
> forums. I tried validating it using other tools
> (http://www.validome.org/grammar/validate/) and got the same output, so
> Im not sure ;)


--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: eclipse xml validation [message #545700 is a reply to message #545549] Thu, 08 July 2010 16:20 Go to previous message
Valentin is currently offline Valentin
Messages: 36
Registered: July 2009
Member
It's a bit hard to help without seeing the entire picture, but from what I
see, I also think the schema snippet you've attached is not valid.

Here's one typical way to fix it: use the ns prefix - which is already
declared to match the target namespace - to refer to components from the
target namespace:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://www.bellman.cz/schema/descriptor"
xmlns:ns="http://www.bellman.cz/schema/descriptor"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="className">
<xs:restriction base="xs:string">
<xs:pattern value="\w+(\.\w+)*" />
</xs:restriction>
</xs:simpleType>
<xs:element name="descriptor" type="ns:descriptorType" />
<xs:complexType name="viewType">
<xs:attribute type="ns:className" name="name"
use="required" />
</xs:complexType>
<xs:complexType name="descriptorType">
</xs:complexType>
</xs:schema>

Hope this helps, Valentin

"Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
news:i142b4$k4k$2@build.eclipse.org...
> Perhaps putting this into the WTP newsgroup will help.
>
> On 6/30/2010 1:42 PM, batsup@gmail.com wrote:
>> Hello, I have a problem with validating a xml scheme for some dynamic
>> web pages, the wierd thing is that the scheme gets validated just fine
>> in IntellliJ. In Eclipse i get errors:
>>
>> src-resolve: Cannot resolve the name 'className' to a(n) 'simpleType
>> definition' component.
>> src-resolve.4.1: Error resolving component 'descriptorType'. It was
>> detected that 'descriptorType' has no namespace, but components with no
>> target namespace are not referenceable from schema document
>> 'file:///C:/Users/tommasino/workspace/inovioweb/src/descript or.xsd'. If
>> 'descriptorType' is intended to have a namespace, perhaps a prefix needs
>> to be provided. If it is intended that 'descriptorType' has no
>> namespace, then an 'import' without a "namespace" attribute should be
>> added to 'file:///C:/Users/tommasino/workspace/inovioweb/src/descript
>> or.xsd'.
>>
>> Looks like the errors arent related. Here is the scheme, not complete
>> (deleted non relevant lines).
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema elementFormDefault="qualified"
>> targetNamespace="http://www.bellman.cz/schema/descriptor"
>> xmlns:ns="http://www.bellman.cz/schema/descriptor"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>> <xs:simpleType name="className">
>> <xs:restriction base="xs:string">
>> <xs:pattern value="\w+(\.\w+)*" />
>> </xs:restriction>
>> </xs:simpleType>
>> <xs:element name="descriptor" type="descriptorType"/>
>> <xs:complexType name="viewType">
>> <xs:attribute type="className" name="name" use="required"/>
>> </xs:complexType>
>> <xs:complexType name="descriptorType">
>> </xs:complexType>
>> </xs:schema>
>>
>> If I add xmlns="http://www.bellman.cz/schema/descriptor" to the scheme
>> tag i get rid of these errors, but get a chain of another errors. The
>> thing is, this application is actually deployed, I simply cant get it
>> working in Eclipse. Any ideas why?
>>
>> PS: this may not be a Eclipse issue, if so, sorry for posting in bad
>> forums. I tried validating it using other tools
>> (http://www.validome.org/grammar/validate/) and got the same output, so
>> Im not sure ;)
>
>
> --
> Nitin Dahyabhai
> Eclipse WTP Source Editing and JSDT
> IBM Rational
Previous Topic:(general) Is there any plan to improve the JSP editing functionalities in JST?
Next Topic:Re: How does eclipse handle multi target projects?
Goto Forum:
  


Current Time: Mon Oct 20 21:14:52 GMT 2014

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

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