Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343224 - [xpath2] "castable as" checks should have access to in-scope user defined simple type definitions
Summary: [xpath2] "castable as" checks should have access to in-scope user defined sim...
Status: NEW
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xpath (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jesper Moller CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 20:39 EDT by Mukul Gandhi CLA
Modified: 2011-10-26 01:19 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mukul Gandhi CLA 2011-04-18 20:39:08 EDT
Build Identifier: I20090313-0100

Let's say we have following XML document,

<X>
   <a>pass</a>
</X>

and it's validated by the following schema,

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	
    <xs:element name="X">
       <xs:complexType>
	   <xs:sequence>
	      <xs:element name="a" type="xs:string"/>			  
	   </xs:sequence>
       </xs:complexType>
    </xs:element>
	
    <xs:simpleType name="STATUS">
       <xs:restriction base="xs:string">
	  <xs:enumeration value="pass"/>
	  <xs:enumeration value="fail"/>
       </xs:restriction>
    </xs:simpleType>
	
</xs:schema>

Now when we evaluate an expression like following (within the context of above XML and schema documents),

X/a castable as STATUS

then this expression evaluation should be aware of the simple type definition STATUS.

This is particularly useful in scenarios where we use XML Schema 1.1 assertions as follows,

<xs:element name="X">
   <xs:complexType>
      <xs:sequence>
         <xs:element name="a" type="xs:string"/>			  
      </xs:sequence>
      <xs:assert test="a castable as STATUS" />
   </xs:complexType>
</xs:element>

I've written a patch for this, and would be committing it asap along with a test case.

Reproducible: Always
Comment 1 Mukul Gandhi CLA 2011-04-18 21:24:01 EDT
I've committed the changes to service branch.

Still not committing to HEAD location, since we need to sort few API issues for this fix, as per new API design and also not committing test cases for this at the moment (since that is also held due to newer API issues).

I'm leaving this bug report as NEW at the moment.